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

iOS-真机运行错误整理 第一. info.plist could`t be removed 解决方法: 快捷键:shift + command + G , 输入含自己电脑路径(/Users/XX/Library/Developer/Xcode),删除DerivedData文件夹,回到xcode,选择 product 后 clean 一下,运行OK! 第二.Signing for "XXX" require 阅读详情
转载内容。很有用,需要常常总结自己所遇到的错误然后以后能快速的解决。

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.即可。

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

uiview2012-10-10 12:17
1,  错误信息:
  "_OBJC_CLASS_$  xxxxx  ", 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)
解决方法:
 查看工程,看是不是没有导入相关的框架。或者工程里添加的有相同".m",".h" 文件


2,  错误信息:
Couldn't register dy.CKRiLiText with the bootstrap server. Error: unknown error code.
This generally means that another instance of this process was already running or is hung in the debugger.Current language:  auto; currently objective-c

解决方法: 可能是电脑内存问题引起,重启电脑即可解决。如果重启解决不了问题,那就是你刚刚改动的代码引起的问题。

3 、 错误信息:
ios 5是调试正常的,ios 6真机调试的时候,出现如下错误:ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/mac4/Desktop/my desktop/My app/MyApp name 20:09:12  /MyApp name/ZBarSDK/libzbar.a for architecture armv7serror: linker command failed with exit code 1 (use -v to see invocation)
解决方法:在Xcode里,点击相应的Target,然后点Build Settings,找到VALID_ARCHS,看里面的是不是arvm7s,如果不是改成arvm7s就可以了。

4 、 错误信息:
 error: receiver type 'ViewController' for instance message does not declare a method with selector 'hideSearchBar:' [4]
ViewController 中没有声明一个方法选择'hideSearchBar:
解决方法:
在ViewController .h 中声明一下这个方法 “ hideSearchBar ”  即可。

5、 错误信息:当json从服务端请求时得到的字符串,如果这样写的话,会报错,';' after top level declarator
NSString *ss= @"{"recommend":"世界末日","
dogname":"机器人"}";  
解决方法:
就是,把   “   替换成  \"  即可。
NSString *ss= @"{ \"recommend \": \"世界末日 \", \"dogname \": \"机器人 \"}";  

6 、 错误信息:
 error: Existing instance variable '_datasource' for property 'datasource' with  assign attribute must be __unsafe_unretained

解决方法:
     id<ListViewDataSource> _datasource; 改为     __unsafe_unretained id<ListViewDataSource> _datasource:即可

7 、 错误信息:
error: No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).

解决方法:
     targets ->build setting 下的 Build Active Architecture Only 设置 NO  即可.

湘南七少2012-10-10 16:52
3q,先阅读明天升级.哎界面修改一大堆

uiview2012-10-16 15:03
31,警告:
 warning: Semantic Issue: Incompatible integer to pointer conversion assigning to 'BOOL *' (aka 'signed char *') from 'BOOL' (aka 'signed char')

解决办法: 检查 BOOL *换为BOOL就可以了,检查是不是多写一个   *  号。


32:Jsonkit中的警告

Direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass()
object->isa 替换为 object_getClass(object)
keyObject->isa 替换为 object_getClass(keyObject)
(id)keys[idx]->isa 替换为 object_getClass((id)keys[idx])

format specifies type 'unsigned long' but the argument has type 'nsuinteger' (aka 'unsigned int')
给变量增加(unsigned long)进行类型转换


33:md5加密(iOS SDK中自带了CommonCrypto

Implicit declaration of function 'CC_MD5' is invalid in C99

[plain] view plaincopy

    #define CC_MD5_DIGEST_LENGTH 16  
    +(NSString *)MD5HashForString:(NSString *)input {  
        const char *cStr = [input UTF8String];  
        unsigned char result[CC_MD5_DIGEST_LENGTH];  
        CC_MD5(cStr, strlen(cStr), result);  
        return [NSString stringWithFormat: @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",  
                result[0], result[1], result[2], result[3],  
                result[4], result[5], result[6], result[7],  
                result[8], result[9], result[10], result[11],  
                result[12], result[13], result[14], result[15]];  
    }  

引入函数定义的头文件

#import <CommonCrypto/CommonDigest.h>


34:ASIDataDecompressor中的警告

format specifies type  'short' but the  argument has type 'int'

在+ (NSError *)deflateErrorWithCode:(int)code 和 +(NSError *)inflateErrorWithCode:(int)code中

[NSString stringWithFormat:@"Compression of data failed with code %hi",code] 中

将code改为 (short)code,类型转换


35:Reachability中警告

Using 'stringWithString:' with a literal is redundant

statusString = [NSString stringWithString: @"Not Reachable"]; 

改为:statusString = @"Not Reachable";


36.format specifies type 'id' but the argument has type 'const char *'

NSCAssert(NO, @"Unhandled error encountered during SAX parse. msg is %@", msg);
改为:NSCAssert(NO, @"Unhandled error encountered during SAX parse. msg is %@", [NSString stringWithUTF8String:msg]);

37 Using 'stringWithString:' with a literal is redundant
改为:self.locationInput.text = @"captured change";


38 在项目中设置控件的layer属性时,会发生错误,
"Property 'c' cannot be found in forward class object 'CALayer *",


这时需要引入  #import <QuartzCore/CALayer.h>。

uiview2012-11-30 10:58
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,就可以了。

zcrrr2013-08-01 10:59
这么好的帖子,顶一个,谢谢

mop1502013-09-24 19:04
iOS真机调试中出现identity(The identity 'iPhone Developer)证书不匹配的问题

提示(null) error: could not read CFBundleIdentifier from Info.plist (null)

新建一个同名工程,拷贝其plist文件,将原工程中的plist文件替换掉即可。
在Macbook m4上编译mono出错:error: incompatible pointer to integer conversion assigning to ‘__uint64_t‘ 由于想理解一下C#的底层实现,同时也想看一下游戏引擎里使用脚本Mono,按这样个性之后,就可以正确运行了。因为m4是64位的ARM了。所以今天就去mono的github上下载了一个源码,这里要根据自己的目录来定义:PREFIX。 阅读详情

相关推荐

保姆级教程:手把手教你从NASA Earthdata免费下载ASTER L2地表温度数据(附shp文件拖拽技巧)

本文提供了一份详细的ASTER L2地表温度数据下载指南,涵盖从NASA Earthdata注册、数据定位到shp文件拖拽技巧的全流程。特别针对新手常见问题如邮箱选择、密码设置、云量筛选等给出实用解决方案,帮助用户高效获取遥感数据并避免常见陷阱。

weixin_42662605的博客 427

常遇见的警告、错误以及相关解决方法

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

xietao3 1万+

C++时间复杂度分析

如果想要知道一个程序运行需要花费多少时间,直接运行测试不是更简单更准确吗?何必去花精力推算复杂度!首先,这个想法没问题,确实可以直接跑出来,但这属于马后炮,无法提前预估算法的时间复杂度,而且也非常受限:1、测试结果在不同处理器上运行的结果会有很大波动2、即使在同一环境下运行,不同数据也会导致结果有很大波动所以需要一个不用具体测试就能评估程序执行效率的方法,也就是时间、空间复杂度分析方法。

hls0611的博客 3860

Xcode运行程序提示 Executable Path is a Directory 问题解决

在网上找了半天也没找到最终解决方法。最后发现在项目设置中,TARGET->Build Settings->Architectures -> Exclude Architectures 里面填入了arm64,把这个去除掉后,一切都正常了。提示“Executable Path is a Directory”,貌似说可执行文件是个文件夹。无法进行运行和调试。这里删掉后,再build和运行,一切OK。

Coding My Way 6570

华为防火墙NAT避坑指南:当双ISP出口遇到服务器发布,这些细节不注意会翻车

本文深入解析华为防火墙在双ISP出口环境下服务器发布的实战配置,重点探讨no-reverse参数对Server-Map表的影响、源进源出功能的实现及线路切换时的会话保持问题。通过策略路由和智能选路技术,确保HTTP/FTP服务在多运营商链路中的高可用性,避免路径不对称和NAT映射冲突等常见陷阱。

weixin_30897233的博客 555

基于VH6501的Busoff测试

摘要: 本文介绍使用VH6501和CANoe工具测试ECU的Busoff Recovery机制。通过干扰报文触发Busoff状态,验证快恢复(连续32次,间隔100ms)和慢恢复(间隔1000ms)的时序及次数是否符合要求。测试步骤包括硬件配置、干扰参数设置及Trace窗口错误帧分析,最终通过错误帧间隔判定恢复机制的正确性。

酒酿丸子的博客 1054

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

Xcode 升级后,常常遇到的遇到的警告、错误,解决方法 从sdk3.2.5升级到sdk 7.1中间废弃了很多的方法,还有一些逻辑关系更加严谨了。 1,警告:“xoxoxoxo”  is deprecated 解决办法:查看xoxoxoxo的这个方法的文档,替换掉这个方法即可。 2,警告:Declaration of "struct sockaddr" will not be visi

braddoris的专栏 3万+

中移物联ML307C模组OPENCPU开发环境搭建全攻略

本文详细介绍了中移物联ML307C模组OPENCPU开发环境搭建的全过程。从OPENCPU模式的核心优势解析,到SDK获取、Python与scons工具安装,再到解读SDK目录结构与实战编译命令,最后提供常见问题避坑指南,帮助开发者快速构建高效的物联网应用编译环境。

weixin_29168393的博客 757

xcode升级到6.0以后遇到的警告错误解决方法

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

a1311010193的博客 213

机器学习项目(四)疫情期间网民情绪识别 (一)

疫情期间网民情绪识别 赛题背景 2019新型冠状病毒(2019-nCoV)感染的肺炎疫情发生对人们生活生产的方方面面产生了重要影响,并引发国内舆论的广泛关注,众多网民参与疫情相关话题的讨论。为了帮助政府掌握真实社会舆论情况,科学高效地做好防控宣传和舆情引导工作,本赛题针对疫情相关话题开展网民情绪识别的任务。 数据介绍 训练集 10万条 无标记样本90万条 测试集1万条 数据集依据与“新冠肺炎”相关...

qq_33357094的博客 8980

手把手教你搭建基于Springboot+Vue的酒店管理系统

友友们,又是好久没更新了,马上元旦了,要迈入2025蛇年了,提前祝大家蛇年快乐,学有所成,本文博主将带领大家使用Springboot和Vue搭建一个酒店管理系统,受限于本文篇幅内容,本文罗列仅有部分简单示例内容,主要包括前后端示例源码。通过本文,你将大致掌握如何快速搭建一个现代化的Web应用。如果您想学习完整开发方案,包括项目源码+数据库文件+全套环境资源+代码部署视频教程+开发文档】获取学习资源,支持远程安装调试:一、项目背景随着互联网技术的不断发展,酒店行业对信息化的需求越来越高。

暴力码农的博客 1329

Xcode 升级带来的警告、错误和解决方法

Xcode 升级后,常常遇到的遇到的警告、错误,解决方法从sdk3.2.5升级到sdk 7.1中间废弃了很多的方法,还有一些逻辑关系更加严谨了。 1,警告:“xoxoxoxo” is deprecated 解决办法:查看xoxoxoxo的这个方法的文档,替换掉这个方法即可。2,警告:Declaration of "struct sockaddr" will not be visible outsi

陆讯 3687

threejs中使用Reflector实现出倒影效果,并实现背景透明的效果(Reflector镜面背景透明, 倒影弱化)

在项目中遇到要实现倒影效果,threejs给我们提供了Reflector,可以轻松完成镜面效果,实现倒影。但背景不透明;并且反射出的倒影太亮了;网上没搜到解决方案, 自己修改了下源码实现了想要的效果,做个记录...

weixin_40856652的博客 5726
上一篇: 宏定义的黑魔法
下一篇: 学习GCD
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值