|
Xcode Template error when trying to build an iPhone app for iOS 3.1 |
|
|
Saturday, 26 November 2011 |
|
If you get the following error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIWindow setRootViewController:]: unrecognized selector sent to instance 0x1185e0' This is because of a bug in XCode project templates that are not compatible with older iOSes (for example with 3.x series or even 4.x). To fix that replace the following line: self.window.rootViewController = self.viewController;
with:
if ([self.window respondsToSelector:@selector(setRootViewController:)])
self.window.rootViewController = self.viewController;
else
[self.window addSubview:self.viewController.view];
in your ViewController.m file.
|
|
ARC forbids synthesizing a property of an Objective-C object with unspecified ownership or storage a |
|
|
Saturday, 26 November 2011 |
|
If you get the following error when compiling an Objective C Project for iPhone or iPad:
ARC forbids synthesizing a property of an Objective-C object with unspecified ownership or storage attribute then you must disable Automatic Reference Couting in order for your code to compile.
To deactivate Automatic Reference Counting go to Xcode -> Project Target (blue icon on top of your project tree) -> Build Settings and select No for Objective - C Automatic Reference Counting.
|
|
Last Updated ( Saturday, 26 November 2011 )
|
|
warning: Semantic Issue: Writable atomic property 'mode' cannot pair a synthesized setter/getter wit |
|
|
Thursday, 10 November 2011 |
If you get the following error when trying to compile a Cocoa Project in XCode 4.2:
warning: Semantic Issue: Writable atomic property 'mode' cannot pair a synthesized setter/getter with a user defined setter/getter
To remove the warning you could either:
- declare that property nonatomic, like for example: @property (nonatomic) int var1;
or:
- use @synthesize and use getter and setter (instead of your own manualy defined getter and setter)
or:
- use @dynamic instead of @synthesize
or: do not use @properties at all.
|
|
Automatic Reference Counting Issue: ARC forbids explicit message send of 'dealloc' |
|
|
Sunday, 06 November 2011 |
If you got the following error when compiling a Cocoa Touch / Objective C source code, when using Xcode 4.x:
error: Automatic Reference Counting Issue: ARC forbids explicit message send of 'dealloc'
you must disable Automatic Reference Couting in order for your code to compile. Or do not use dealloc methods, leave everything to autorelease.
To deactivate Automatic Reference Counting go to Xcode -> Project Target (blue icon on top of your project tree) -> Build Settings and select No for Objective - C Automatic Reference Counting.
|
|