Search code examples
iosxcode6watchkit

No visible @interface for 'WKInterfaceController' declares the selector 'initWithContext:'


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:'

enter image description here

Where is the problem ? Thanks


Solution

  • 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];