Xcode编译错误和警告汇总(持续更新中)

[size=medium][color=red]Error:Cannot assign to 'self' outside of a method in the init family[/color]
my solution:
如果你的方法是一个初始化方法,则方法名必须用“init”开始,或者,你也可以把方法改为一个类方法,返回一个单例对象,我的问题方法如下:[/size]
-(id)initwithPage:(unsigned)pageNum {...}
[size=medium]注意小写‘w’
我把它改为:[/size]
-(id)initWithPage:(unsigned)pageNum {...}
[size=medium]注意大写‘W’
我的问题就解决了。
From [url]http://stackoverflow.com/questions/16013238/cannot-assign-to-self-out-of-a-method-in-the-init-family[/url][/size]

[size=medium]
[color=red]Error:Could not load NIB in bundle with name XXX[/color]
my solution:
因为我是用Storyboard,但是却用ViewController的方法加载,所以出错了,改为:[/size]
UIStoryboard *sboard = [UIStoryboard storyboardWithName:@"StoryboardFileName" bundle:nil];
YourViewController *vc1 = [sboard instantiateInitialViewController];
[size=medium]问题解决.
From [url]http://stackoverflow.com/questions/12443385/could-not-load-nib-in-bundle-with-name-secondviewcontroller/12443395#12443395[/url][/size]

[size=medium]
[color=red]Error:Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x7d90880> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key currentTime.'[/color]
my solution:
选中 'currentTime'控件所在的storyboard(或nib),点击'currentTime'控件,storeboard左侧的View Controller Scene中的对应控件也会选中,在Scene选中控件中右键弹出窗口查找删除无效的Referencing Outlets连接,问题解决,
From [url]http://stackoverflow.com/questions/5932397/the-class-is-not-key-value-coding-compliant-for-the-key[/url][/size]
[size=medium]
[color=red]Error:-[__NSArrayI isEqualToString:]: unrecognized selector sent to instance 0x7d1b3c0
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI isEqualToString:]: unrecognized selector sent to instance 0x7d1b3c0'[/color]
my solution:
原来是我把NSMutableDictionary错写成NSMutableArray,包括相应的方法调用,改过来就好了,
From [url]http://stackoverflow.com/questions/17377190/assigning-values-in-nsarrays[/url][/size]

[size=medium]
[color=red]Error:A valid provisioning profile matching the application's Identifier '' could not be found[/color]
my solution:
I had the same error message when I was trying to build an app on my iPhone. Everything seemed to be in order, I.e. the certificates were all valid and present and so on, but I just couldn't get it to work.

I just couldn't find the option "iOS team provisioning profile" in [b]Project > Build Settings > Code Signing > Code Signing Identity[/b] - this was the main clue to a solution. If you can't see that option there, check your Xcode [b]Organizer[/b].

Inside it, go to [b]Library > Provisioning Profiles[/b]:
[align=center][img]http://i.stack.imgur.com/kDVv1.png[/img][/align]
Now what you should see if everything were right is this:
[align=center][img]http://i.stack.imgur.com/qfLrz.png[/img][/align]
But if on the other hand you see an empty list, click the [b]Refresh[/b] button in the lower right corner of the Organizer:
[align=center][img]http://i.stack.imgur.com/1oCyZ.png[/img][/align]
After said procedure, Xcode started churning out wonderful messages of "adding" and "finishing" and then my app appeared on my iPhone. The End.
Good luck!
From [url]http://stackoverflow.com/questions/11985611/a-valid-provisioning-profile-matching-the-applications-identifier-could-not[/url][/size]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值