Reputation: 642
From the last Xcode beta i've got an error in all my project and in all my sample code , also as in Apple Sample code like Lister app !
No visible @interface for 'WKInterfaceController' declares the selector 'initWithContext:'
Where is the problem ? Thanks
Upvotes: 3
Views: 3199
Reputation: 13313
From Apple's Docs, this was changed between beta's:
The WKInterfaceController method initWithContext: has been deprecated. Please use awakeWithContext: instead. The designated initializer for WKInterfaceController is now init.
See: https://developer.apple.com/library/prerelease/ios/releasenotes/General/RN-iOSSDK-8.2/index.html
Upvotes: 3
Reputation: 3899
Instead of
self = [super initWithContext:context];
use
self = [super init];
Upvotes: 5
Reputation: 11197
Just make sure your super class has that method declaration with same method signature. Hope this helps.. :)
If you look at WKInterfaceController document you can't see any method named initWithContext
. Apple said;
The WKInterfaceController method initWithContext: has been deprecated. Please use awakeWithContext: instead. The designated initializer for WKInterfaceController is now init.
You should use :
self = [super init];
Not:
self = [super initWithContext:context];
Upvotes: 2