Search code examples
iosapple-watch

Black Screen Output in Apple Watch app


I created a simple Apple Watch app in Xcode 6.2 to show a label displaying just "HELLO". But when the watch app is run,the watch screen appears,but it is completely BLACK. How to recover from this ? What are the general procedures to be followed while running an Apple Watch application?

- (void)awakeWithContext:(id)context {
       [self.watchlbl setText:@"Hello"];
        [super awakeWithContext:context];
    }

Is anything wrong in this initialisation? I have also initialised the label in the storyboard.


Solution

  • First, always make the call to [super awakeWithContext:] before everything else.

    Second, you might put your code into the willActivate method:

    - (void)willActivate {
        [super willActivate];
        [self.watchlbl setText:@"Hello"];
    }
    

    EDIT

    Also, make sure to use the right target in the XCode menu - the WatchKit App has to be started - like so:

    Xcode Menu