iphone开发中常遇到的错误及解决方法(不断补充中⋯⋯)
2011-08-29 17:32
393 查看
相信刚开始进行iphone开发的各位童鞋,也会跟我一样,会常常遇到一些警告或错误提示,现将问题整理如下:
解决方法,在.m文件开始的地方,添加
@interface
UIViewController()
- (void)xxx;
@end
其中红色字段,根据所报的警告提示替换,即可。
参考帖:http://stackoverflow.com/questions/5917747/warning-uiviewcontroller-may-not-respond-to-xxx
NSLog([NSString stringWithFormat:@"%@ %@, %@", errorMsgFormat, error, [error userInfo]]);
输出日志,往往会出现“format not a string literal and no format arguments”警告。遇到这种情况时,只需把调用方式改成:
NSLog([NSString stringWithFormat:@"%@ %@, %@", errorMsgFormat, error, [error userInfo]], nil); 即可。
参考帖:/article/4001105.html
3.warning:'Failed
1.warning: 'UIViewController' may not respond to 'xxx'
这个错误是因为ObjC语言的特点导致的,ObjC不同于Java、.net、Flex等面向对象的语言,它源于C,语法相对严格,所以定义方法的时候,若被调用方法位于调用它的方法的后面,它会找不到,就报出这样的提示。解决方法,在.m文件开始的地方,添加
@interface
UIViewController()
- (void)xxx;
@end
其中红色字段,根据所报的警告提示替换,即可。
参考帖:http://stackoverflow.com/questions/5917747/warning-uiviewcontroller-may-not-respond-to-xxx
2.warning:'format not a string literal and no format arguments'
这个错误是跟XCODE的版本有关,在XCode 3.2.1以后系统中开发时,如果使用:NSLog([NSString stringWithFormat:@"%@ %@, %@", errorMsgFormat, error, [error userInfo]]);
输出日志,往往会出现“format not a string literal and no format arguments”警告。遇到这种情况时,只需把调用方式改成:
NSLog([NSString stringWithFormat:@"%@ %@, %@", errorMsgFormat, error, [error userInfo]], nil); 即可。
参考帖:/article/4001105.html
3.warning:'Failed
to launch simulated application: Unknown error'
有时会遇到无法使用模拟器的未知错误,这个错误的发生我也没搞明白是为什么,这时只要改变一下product的名字, [code]一般就能解决问题。
参考帖:http://stackoverflow.com/questions/779115/iphone-failed-to-launch-simulated-application-unknown-error
相关文章推荐
- iphone开发中常遇到的错误及解决方法(不断补充中⋯⋯)
- 用iReport开发出一个jasper文件并嵌入到jsp中所遇到的错误以及解决方法
- iphone 开发中使用zbar时遇到的几个典型问题解决方法。
- Android开发中遇到的错误及解决方法
- android 开发中经常遇到的错误以及解决方法
- iphone 开发中使用zbar时遇到的几个典型问题解决方法。
- 开发Android的时候遇到的问题及解决方法(不断更新)
- 用PB6开发WINCE时常遇到的错误以及解决方法汇兑
- Android开发过程中遇到的错误汇总及其解决方法
- winpcap开发开始遇到的错误的解决方法
- 自己遇到的Android虚拟机出现的错误及解决方法【不断更新】
- iPhone开发 UI TextField 输入英文会出现EXC_BAD_ACCESS错误的解决方法
- Qualcomm Camera 开发遇到的错误及解决方法
- winpcap开发开始遇到的错误的解决方法
- iphone 开发中使用zbar时遇到的几个典型问题解决方法。
- Android开发中遇到的错误及解决方法(1)
- 说说在MVC开发中,遇到的错误及解决方法(本文章是我在实际开发中总结出来的,希望对您有帮助)
- 用PB6开发WINCE时常遇到的错误以及解决方法汇兑
- 在软件开发中遇到ORA-06413错误的解决方法
- IOS开发-cocoaPod安装遇到的错误以及解决方法