zoukankan      html  css  js  c++  java
  • 【ios开发】ios开发问题集锦

    1、

    ARC forbids explicit message send of'release'

    'release' is unavailable: not available inautomatic reference counting mode

     

    解决办法:

    打开当前工程,打开"Build Settings",找到Objective-C Automatic Reference Counting项,将它的值设置为NO。

    再次编译,就消除了这个错误了。


    2、

    ld: warning: ignoring file [Path/FileName.a], missing required architecture i386 in file [Path/FileName.a] (2 slices)

    Undefined symbols for architecture i386:

    "_OBJC_CLASS_$_HRMonitor", referenced from:

    objc-class-ref in ViewController.o

    ld: symbol(s) not found for architecture i386

    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    解决方法:

    This warning means that you're trying to use library made for Device (ARM) with your Simulator (i386).

    You can use this terminal command to create a universal library:

    lipo -create lib_arm.a lib_i386.a -output lib_universal.a

    More info about lipo command here (Mac Developer Library).


    3、

    Multiple errors occurred while copying the files.

    解决方法:

    如果往Xcode中添加多个图片时出现这个错误,那说明这不是你第一次做这种尝试了,而第一次添加的时候,因为某张图片有重名现象,或者格式问题等原因,导致第一次没有添加成功,之后再添加多个图片的时候就会报这个错误,原因就是因为第一次的时候,部分图片没有添加成功,但是大部分还是给添加到项目里,但是你在 Xcode上是看不到的,所以直接导致添加失败,解决的办法很简单;

    首先product-->clean一下,这是个好习惯,然后在Xcode中打开项目所在目录(show in finder),你会发现你添加的图片在里面,删除重新添加即可。


    4、

     *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Requesting the window of a view (<CallView: 0x17664950; frame = (0 0; 0 0); transform = [0, 0, 0, 0, 0, 0]; alpha = 0; opaque = NO; layer = (null)>) with a nil layer. This view probably hasn't received initWithFrame: or initWithCoder:.'

    解决办法:

      if (self = [super init])

    {

    }

     

    这种问题基本是是没用init。

    stackOVerflow链接


    5、

    Undefined symbols for architecture i386

    解决办法:

    这个错误的发生原因一般是“XXX”这个文件(类库)虽然引入了工程中,但是由于种种原因(常见于多人开发,svn同步不规范)导致“XXX”并未被添加到project.pbxproj这个文件中。

    解决方法是点击工程,在targets界面中找到Build Phases,根据提示信息“XXX”来判断缺少什么文件,一般如果缺少自定义的文件,XXX会是缺少的类名,那么就在Complie Sources中加入该文件。如果缺少类库,则在Link Binary With Libraries中加入该类库。


     

     6、

    ld: warning: directory not found for option '-L/Users/wxian/Documents/DoubleDie/sim-libs'

    解决办法:

    If it is a "directory not found for option '-L/..." That means it's a Library Error, and you might want to try:

    • Click on your project (targets)
    • Click on Build Settings
    • Under Library Search Paths, delete the paths

    If it is a "directory not found for option '-F/..." That means it's a Framework Error, and you might want to try:

    • Click on your project (targets)
    • Click on Build Settings
    • Under Frameworks Search Paths, delete the paths

    ld: library not found for -lg7221codec-arm-apple-darwin9

    解决办法:

         缺少库文件

     


     

    7、

    更新证书错误Code Sign error: Provisioning profile ‘XXXX'can't be found

    解决方法:

          在Xcode中当你在更新了你得证书而再重新编译你的程序,真机调试一直会出现 Code Sign error: Provisioning profile ‘XXXX’ can't be found是不是会另你很恼火。下面说说解决方法,让你很好的解决这个问题。

    • 关闭你的项目,找到项目文件XXXX.xcodeproj,在文件上点击右键,选择“显示包内容”(Show Package Contents)。会新打开一个Finder。注:XXXX.xcodeproj就是一个文件夹,这里新打开的一个Finder里面的三个文件就是该XXXX.xcodeproj文件夹里面的文件。
    • 在新打开的Finder中找到project.pbxproj,并且打开。在这之中找到你之前的证书的编码信息。
    • 保存,重新启动你的项目,再编译。就OK了。
  • 相关阅读:
    nginx端口被占用解决方案
    linux安装pip报错
    小程序学习-小程序特点及适用场景
    总结行内元素与块级元素
    重装系统之无法在驱动器0的分区1上安装windows
    重装系统之win10不能进入bios界面
    重装系统之U盘设为第一启动项
    重装系统之制作U盘启动盘
    Vue-条件渲染v-if与v-show
    Cookie与Session
  • 原文地址:https://www.cnblogs.com/ymonke/p/3382348.html
Copyright © 2011-2022 走看看