Xcode编译异常和警告汇总(持续更新中)

Xcode编译错误和警告汇总(持续更新中)
Error:Cannot assign to 'self' outside of a method in the init family
my solution:
如果你的方法是一个初始化方法,则方法名必须用“init”开始,或者,你也可以把方法改为一个类方法,返回一个单例对象,我的问题方法如下:

-(id)initwithPage:(unsigned)pageNum {...}
注意小写‘w’
我把它改为:

-(id)initWithPage:(unsigned)pageNum {...}
注意大写‘W’
我的问题就解决了。
From http://*.com/questions/16013238/cannot-assign-to-self-out-of-a-method-in-the-init-family



Error:Could not load NIB in bundle with name XXX
my solution:
因为我是用Storyboard,但是却用ViewController的方法加载,所以出错了,改为:

UIStoryboard *sboard = [UIStoryboard storyboardWithName:@"StoryboardFileName" bundle:nil];
YourViewController *vc1 = [sboard instantiateInitialViewController];
问题解决.
From http://*.com/questions/12443385/could-not-load-nib-in-bundle-with-name-secondviewcontroller/12443395#12443395



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.'
my solution:
选中 'currentTime'控件所在的storyboard(或nib),点击'currentTime'控件,storeboard左侧的View Controller Scene中的对应控件也会选中,在Scene选中控件中右键弹出窗口查找删除无效的Referencing Outlets连接,问题解决,
From http://*.com/questions/5932397/the-class-is-not-key-value-coding-compliant-for-the-key


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'

my solution:
原来是我把NSMutableDictionary错写成NSMutableArray,包括相应的方法调用,改过来就好了,
From http://*.com/questions/17377190/assigning-values-in-nsarrays