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://stackoverflow.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://stackoverflow.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://stackoverflow.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://stackoverflow.com/questions/17377190/assigning-values-in-nsarrays



Error:A valid provisioning profile matching the application's Identifier '' could not be found
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 Project > Build Settings > Code Signing > Code Signing Identity - this was the main clue to a solution. If you can't see that option there, check your Xcode Organizer.

Inside it, go to Library > Provisioning Profiles:
Xcode编译错误和警告汇总(持续更新中)

Now what you should see if everything were right is this:
Xcode编译错误和警告汇总(持续更新中)

But if on the other hand you see an empty list, click the Refresh button in the lower right corner of the Organizer:
Xcode编译错误和警告汇总(持续更新中)

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 http://stackoverflow.com/questions/11985611/a-valid-provisioning-profile-matching-the-applications-identifier-could-not



你可能感兴趣的:(Objective-C,xcode)