Xcode 升级后,常常遇到的遇到的警告、错误,解决方法

从sdk3.2.5升级到sdk 7.1中间废弃了很多的方法,还有一些逻辑关系更加严谨了。
1,警告:“xoxoxoxo”  is deprecated
解决办法:查看xoxoxoxo的这个方法的文档,替换掉这个方法即可。

2,警告:Declaration of "struct sockaddr" will not be visible outside of this function
解决办法:在你的开源.m文件中添加 #import <netinet/in.h>

3,警告:Implicit conversion from enumeration type 'UIInterfaceOrientation' to different enumeration type 'UIDeviceOrientation'
解决办法:类型不匹配。跳到出错的那一行,UIInterfaceOrientation强制转换为UIDeviceOrientation就行了。

4,警告:incompatible pointer types assigning to 'MyArrayList*'from 'NSMutableArray'
解决办法:加入强制转换(MyArrayList*)

5,警告:'&&' within '||'
问题出处:
    if (exists && !isDirectory || !exists)………
  解决办法: if ((exists && !isDirectory) || !exists)………

6,警告:Warning:The Copy Bundle Resources build phase contains this target's Info.plist file
解决办法:将Info.plist文件移到Resources目录下,而不要直接放在target下。

7,警告:在使用ASIHttp…第三方库的,运行报错。
解决办法:看你的项目中是否添加CFNetwork.framework、SystemConfiguration.framework, MobileCoreServices.framework,
CoreGraphics.framework和libz.1.2.3.dylib,如果是sdk5.0以上,改添加libz.1.2.5.dylib

8,警告:xxxooo,missing required architecture i386 in file 
解决办法:如果是错误信息的话:Target->Build Settings->Search Paths, 删除FrameworkSearch Paths 里面内容就可以了。
要只是一个警告的话,真机调试可以过。具体解决方法待大神出现。

9,警告:
clang: error: no such file or directory: '/demo2/控件代码/13/Recorder/Recorder_Prefix.pch'
clang: error: no input files
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
解决办法: 在你的主工程文件 target搜素,pch ,找到Prefix Header    把它后面的值,都删除,再运行就解决了。

10,警告:
“ARC forbids synthesizing a property of an Objective-C object with unspecified ownership or storage attribute
解决办法:如果定义了ARC有效,那么必须要有所有者属性的定义;所以代码改成下面这样
@property (nonatomic, strong, readonly) NSString *ss;

11,警告:
io6一下的xib系统均没有自动选择Use Autolayout, Supporting iOS 5 and below with xib of iOS 6 
解决办法:Just un-select “Use Autolayout” in the file inspector of the xib’s view and we are back to the familiar autosizing in size inspector and boom, it supports iOS 5 and below.

12,警告:
Warning: Multiple build commands for output file xxx.png 
解决办法:找到项目里xxx.png重复,删除重复的资源。

//以下是升级到 xcode 5.0.1 之后使用遇到的警告
13,警告:
 “iOS 模拟器”未能安装此应用程序。
解决办法:删除模拟器上当前要运行那个APP,重新运行项目。就ok

14,警告:
SpringBoard无法启动应用程序 错误:-3
解决办法:退出模拟器,重新运行这个项目。

15,警告:
The server certificate failed to verify.   
解决办法:
1、打开终端(实用工具 -->终端),在终端中输入如下命令:
svn ls https://192.100.1.11?0/svn/xxxxxx(注意下面的url更换成你自己的url地址)
然后直接输入 “ p ”  确认,就可以重新连接了。

16,警告:
Bitmasking for introspection of Objective-C object pointers is strongly discouraged.   
解决办法:
某数字& 0x1的时候是代表要取最低位是否为1,改成了  if(JK_EXPECT_F(((NSUInteger)object)%2))即可。

17,警告:
Implicit conversion loses integer precision: 'unsigned long' to 'CC_LONG' (aka 'unsigned int').   
解决办法:
    CC_MD5(str,strlen(str), r);,改成了     CC_MD5(str, (CC_LONG)strlen(str), r);即可。

18,警告:
error: failed to launch '/private/var/mobile/Applications/xxxxx' -- failed to get the task for process 11140.   
解决办法:
    重启你的开发手机即可,还有一种可能是你的开发者证书与发布证书搞错了,检查在xcode中证书是否一直 。

19,警告:
error: ignoring filxxxxxx/libBaiduMobStat.a, missing required architecture x86_64 in filexxxx/libBaiduMobStat.a   
解决办法:
    targets ->build setting 下的  architectures 设置为 standard architetures(armv7,armv7s)   vaild architectures 设置为armv7,armv7s。

20,警告:
error: Directory not found for option '-L/Users/joryoubonxx/BaiduStatistic   
解决办法:
  删除  targets ->build setting 下的  library search path不正确的地址,如果还不行,重新添加第三库、clean ,重启Xcode.即可。

遇到相关的警告,一般编译器都会提供解决方案,所以,作为新手,我们应该看懂编译器给我们的提示,这样我们解决问题就会事半功倍。

Xcode常见警告和错误的更多相关文章

  1. XCode消除警告、错误

    1.集成支付宝SDK后,报一堆warning: (arm64) /Users/scmbuild/workspace/standard-pay/.....警告 解决方法: 1)  Go to Build ...

  2. KEIL C编译器常见警告与错误信息的解决办法

    对于函数的自变量.局部变量和全局变量声明如果没有指定内存类型,则内存模式将成为内定的内存类型.如果指定了内存类型的变量,则不理会内存模式,完全有所指定的内存类型为主.    SMALL模式:小模式   ...

  3. iOS开发总结-Xcode常见错误

    iOS开发总结-Xcode常见错误 "file/file.h"filenotfound 如果遇到这种类型的问题报错,可以分为三部来解决,由简到复杂一步一步来,直到解决问题位置. 1 ...

  4. Xcode常见的编译、运行等错误的解决

    Xcode常见的编译.运行等错误的解决 项目没找到Info.plist的错误 The solution for this particular instance of the error was “I ...

  5. 【转】【整理】将Linux脚本中的正常输出,警告,错误等信息输出到文件中

     本文来自:http://blog.csdn.net/woshinia/article/details/18040063   很早以前  编译的时候 就在用 2>&1,但是一直没有生成一 ...

  6. 总结Selenium自动化测试方法(六)常见的异常错误处理

    六.常见的异常错误处理 NoSuchElementException: Message: Unable to locate element: {"method":"xpa ...

  7. keil MDK编译器警告和错误详解(不定期更新)

    工作后从单片机转成ARM,刚开始用ADS1.2编译器,用了一段时间,因为我接手的项目的老程序正是用ADS编译的,部门也大都在用.在学单片机的时候用的是keil c51编译器,ads和这个编译器在易用性 ...

  8. 常见的SQL错误和解决方法

    前言 今天你会看到每个人——从新手到专家——在使用SQL时犯的各种常见错误.你不能永远避免犯任何错误,但是熟悉广泛的错误将帮助你在尽可能短的时间内解决这些错误. 注:在我们的例子中我们使用的是Orac ...

  9. 编写合格的C代码(1):通过编译选项将特定警告视为错误

    目录 快速设定 向错误的执念开炮,向C编译器开炮 编译警告应当被忽略吗?warning不重要吗? 个人总结的应当视作error的warning 1. 函数没有声明就使用 2. 函数虽然有声明,但是声明 ...

随机推荐

  1. qq空间认证教程:借助企鹅媒体平台认证QQ公众空间

    年轻人,最近你是否眼看众多新开的QQ空间认证成功,自己却一筹莫展,而心情极度狂躁焦虑,别急,以下是详细教程,不能保证100%,但老夫已认证成功几个号. 不废话,直接上流程: 方法大致有2种: 1. 通 ...

  2. Python学习3——变量如何存储数据

    数值类型:包括整型.浮点型 变量名字代表的是存储地址. num01 = 100 print(id(num01)) #输出变量num01存储的内存地址,输出的是十进制值 num02 = num01 pr ...

  3. linux 通过 openconnect 来连接学校内网

    参考 http://xingda1989.iteye.com/blog/1969908 https://blog.csdn.net/edin_blackpoint/article/details/70 ...

  4. golang使用rabbitMQ入门代码

    package main import ( "github.com/streadway/amqp" "log" "time" ) func ...

  5. create a nodejs npm package

    1. create a folder named m1 2. run command: npm init, this will create the package.json file 3. crea ...

  6. Android UI控件:TextView

    TextVIew的属性详解 android:autoLink设置是否当文本为URL链接/email/电话号码/map时,文本显示为可点击的链接.可选值(none/web /email/phone/ma ...

  7. SpringBoot-03:SpringBoot+Idea热部署

      ------------吾亦无他,唯手熟尔,谦卑若愚,好学若饥------------- 所谓热部署,就是在项目启动中,修改class类中做的修改操作,无需重新启动项目,就可以变更,在网页展示中有 ...

  8. linux 中文输出

    #include <stdio.h> #include <stdlib.h> #include <string> #include <fstream> ...

  9. yield学习

    如果要控制内存占用,最好不要用list来保存中间结果,而是通过iterable对象(range, xrange, generator等)来迭代.   yield 使函数变为generator,返回对象 ...

  10. 「日常训练」More Cowbell(Codeforces Round #334 Div.2 B)

    题意与分析(CodeForces 604B) 题意是这样的:\(n\)个数字,\(k\)个盒子,把\(n\)个数放入\(k\)个盒子中,每个盒子最多只能放两个数字,问盒子容量的最小值是多少(水题) 不 ...