Xcode中的各种警告以及处理方法
2017-02-16 22:31
344 查看
从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,[b]missing required architecture i386 in file
解决办法:如果是错误信息的话:[/b]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.即可。
遇到相关的警告,一般编译器都会提供解决方案,所以,作为新手,我们应该看懂编译器给我们的提示,这样我们解决问题就会事半功倍。
8. iOS真机调试中出现identity(The identity ‘iPhone Developer)证书不匹配的问题
提示(null) error: could not read CFBundleIdentifier from Info.plist (null)
新建一个同名工程,拷贝其plist文件,将原工程中的plist文件替换掉即可。
41,错误
Error launching remote program: failed to get the task for process
解决方法:
把真机上的软件,删除,然后,clean 一下,重新运行就可以了。
42,真机调试的时候,出现 [attachment=49364] 这正常,但是不识别机器的。
解决方法:
把 , [attachment=49365] 设置为以上相对应的版本就可以了。
43,真机调试的时候,出现 ios Broken pipe
解决方法:
:推出xcode
:断开机器(iphone,ipad,ipod)链接
:重启iPhone在联接xcode,就可以了
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,[b]missing required architecture i386 in file
解决办法:如果是错误信息的话:[/b]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.即可。
遇到相关的警告,一般编译器都会提供解决方案,所以,作为新手,我们应该看懂编译器给我们的提示,这样我们解决问题就会事半功倍。
|
提示(null) error: could not read CFBundleIdentifier from Info.plist (null)
新建一个同名工程,拷贝其plist文件,将原工程中的plist文件替换掉即可。
|
Error launching remote program: failed to get the task for process
解决方法:
把真机上的软件,删除,然后,clean 一下,重新运行就可以了。
42,真机调试的时候,出现 [attachment=49364] 这正常,但是不识别机器的。
解决方法:
把 , [attachment=49365] 设置为以上相对应的版本就可以了。
43,真机调试的时候,出现 ios Broken pipe
解决方法:
:推出xcode
:断开机器(iphone,ipad,ipod)链接
:重启iPhone在联接xcode,就可以了
相关文章推荐
- Xcode中的各种警告以及处理方法
- xcode中处理工程警告的几种方法
- XCode7,打包上传的一些警告,及参考处理方法
- values of type NSInteger should not be used as format arguments; 关于Xcode中烦人的32位与64位警告处理方法.
- [iOS]Xcode处理过时方法的警告
- [ios专项]Xcode 常见错误/警告,处理方法 (持续更新ing.._20140601)
- XCode7,打包上传的一些警告,及参考处理方法
- [ios专项]Xcode 常见错误/警告,处理方法 (持续更新ing.._20140601)
- 各种与视频编解码以及视频图像处理的应用相关的新技术,新方法,各种软件开发相关的算法,思想。
- Xcode中的一些代码警告的处理方法
- MVC中返回JSON格式以及客户端处理方法的总结
- [emacs] Python代码补全的各种方法介绍以及对比
- Linux系统平台下关于GCC编译及使用的方法(-Werror,它要求GCC将所有的警告当成错误进行处理 )
- WEB全能服务器总结,及各种问题处理方法.apache+tomcat+jsp+php+mysql+虚
- Unparsed aapt error(s)错误的处理方法 以及 音乐播放
- window.open()方法,window.opener的用法,以及用该属性处理父子级页面的访问
- Session失效以及页面访问权限的处理方法
- PF使用率过高的解析以及处理方法
- linux下各种压缩文件以及相应的解压方法
- Flex :HTTPService处理XML文件的两种方法, Asp生成Xml的方法,以及Flex定义变量、赋值的运用。。。。