• 常见编辑错误汇总


    转载自CSDN --andyweike
    1. 编译iPad真机时,选择了 Architetures:Standard(armv6) BaseSDK:iPhoneDevice3.2 TargetDeviceFamily:iPad.
    若编译出现如下错误:
    Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
    则修改 GCC4.2CodeGeneral区域中的ComplieForThumb为非选中.
    已经有了开发者证书及私钥后,可直接在越狱的手机上调试.
     
    2. 编译链接时, "_OBJC_CLASS_$_xxx", referenced from:可能需要重新建立某个类的文件.
        或者:选择项目名,在detail列表中的target列(显示为一个又圆圈),把这个文件的复选选中,或者再次选中.以把它加入到这个target里面来.
     
    3.在sdk4.0及以上使用RegexKitLite报'captureCount' was not declared in this scope错误,是在非.m文件中使用了它的原因.
       http://www.cocoachina.com/bbs/read.php?tid=38784&page=e&#a
     
    4.there is no sdk with the name or path.
       从网上down的开源代码,结果运行的时候常出现这样的错,并且在deployment中没有ios deployment target 选项.
       http://blog.aztaru.com/2010/10/05/ios筆記there-is-no-sdk-error/
       尝试 Project/Edit Active Target/ 及 Set Active SDK菜单项,来回切换一下Active Configuration。
     
    5.常见的EXEC_BAD_ACCESS,EXC_BAD_INSTRUCTION错误,一般是因为访问已经被release的对象造成的。尤其是在一个线程中访问另外一个线程的autorelease库中的对象,尤其要注意此类问题。
    定位错误:
    在工程中加入 NSZombieEnabled 环境变量,并设为启用,则在 EXC_BAD_ACCESS 发生时,XCode 的 Console 会打印出问题描述。双击Executables 下的 可执行模组,在弹出窗口中,Variables to be set in the environment,添加 NSZombieEnabled,并设定为 YES,点击选中复选框启用此变量。
    2011-08-03 15:35:32.334 ShanTouMM[1436:207] *** -[UIButton release]: message sent to deallocated instance 0x5f7fcf0
    需要更多的提示来帮助定位问题,再加入 MallocStackLogging 来启用malloc记录。
    在gdb窗口输入 (格式: shell   malloc_history <id>   <address>)    shell malloc_history 14360x5f7fcf0, 也可以在终端中去运行 就要去掉以上的shell 指令 如 malloc_history <id>   <address>
    http://www.cocoachina.com/macdev/objc/2011/0219/2661.html
    http://www.cnblogs.com/likwo/archive/2011/02/10/1950664.html
    应该仅当需要调试内存时,才设置上述环境变量.
     
    6.运行一个IPhone程序时,弹出窗口说“程序运行失败,预置描述文件已过期” 。 解决办法是,在Xcode中, window-> Orgnazier -> 你的iphone ->删除带有红*的该程序之前的Profile 。 然后从Xcode运行该程序.
    7. 真机编译时报 Code Sign error: The identity doesn't match any valid certificate/private key pair in the default keychain
        修改工程和Targets的get infouild 中的code signing identity为空

    8.调试打印
       CFShow(coreFoundationThingy) will print out a description of coreFoundationThingy to the console. Output looks something like: {value = w:1186.000000 h:687.000000 type = kAXValueCGSizeType}   If NSLog() is printing something out as an NSCFType, try CFShow().
     
    9. 编译时报 Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1,修改C/C++ Compiler Version为gcc4.2

    10.this class is not key value coding-compliant for the key viewController
    可能在创建了一个基于view的工程,而后把生成的viewcontroller删除了,但是在.xib中还有对它的引用,在IB中直接用delete键删除掉它就行了。

    11.这台电脑上已经存在一个名为“embedded.mobileprovision”的预置文件,您是否要替换么?
    http://blog.sina.com.cn/s/blog_6907b67f0100o2vw.html

    12.真机调试时报failed to upload *.app
    http://hi.baidu.com/_1989/blog/item/9649f49f805f05aec8eaf466.html
    http://www.shouyanwang.org/thread-462-1-1.html

     
    error: macro names must be identifiers YourProject_prefix.pch 原因: 因为你弄脏了预处理器宏,在它处于<Multiple Values>的时候修改了它   解决方法: Configiration选择All Configirations,清空它 然后分别重新定义你的Debug,Release,Distributin预处理器宏吧     warning: no rule to process file '$(PROJECT_DIR)/LoadingView.h' of type sourcecode.c.h for architecture armv6 原因: Target里Compile Sources里含有头文件 了,那里面不需要头文件   解决方法: 从Target里Compile Sources里删除头文件     Command /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneOS Build System Support.xcplugin/Contents/Resources/copypng failed with exit code 1 原因: png图像文件拷贝失败,看看信息上面提示Can't find哪个文件,一般都是从文件系统里删除文件而没有通过Xcode删除造成的,Xcode的项目配置文件依然纪录着这个文件的引用 解决办法: 给文件系统里增加相应的文件,或者从Xcode的Groups & Files删除它,或者从Target的Copy Bundle Resources里删除它     Code Sign error: The identity 'iPhone Developer: Your Name' doesn't match any valid certificate/private key pair in the default keychain 原因: 签名错误 解决办法: Target -> Get Info -> Build -> Code Signing -> 修改签名 记得左上角的Configuration类型要跟当前Build类型对应(Debug, Release, Distribution),否则改了也白改
     
    could not create bundle folder for versioned model *.moda(好像是这个后缀名的这个文件)
    原因:编译一次会产生一个新的,应该把编译产生出来的moda文件都删了,然后clean下工程,重新build即可

  • 相关阅读:
    <iframe>相关问题
    文字描边
    jquery 设置css margin-left
    uni-app mustache表达式
    Uni-app 响应式像素upx
    Uni-app页面进入和返回
    Uni-app 生命周期
    Sql添加/删除默认值
    Uni-app初体验(创建新路由)
    Uni-app初体验(页面绑定数据)
  • 原文地址:https://www.cnblogs.com/xubojoy/p/3931711.html
Copyright © 2020-2023  润新知