Reputation: 391
I added a bunch of WKInterfaceLabels to the storyboard, added them as IBOutlets in InterfaceController.h, and used the SetText method to set some text on them. However, I get no change on the view. The console gives the message "Unknown property in Interface description" for each label. How do I fix this?
In InterfaceController.h, I define the label as follows:
IBOutlet WKInterfaceLabel *hdate;
In InterfaceController.m, I set it's text as follows:
- (void)willActivate {
// This method is called when watch view controller is about to be visible to user
[super willActivate];
[hdate setText:@"blah"];}
Upvotes: 2
Views: 585
Reputation: 6306
Since the correct answer is in the comments of the question, I will just post it here again:
You can't create the IBOutlet in the .h file with just
IBOutlet WKInterfaceLabel *hdate
in brackets, I have to set them as properties.
(Credits to user3261697)
Upvotes: 3
Reputation: 3520
Change
IBOutlet
To
@IBOutlet
Or reconnect the label to the view.
In my case, it ran successfully.
Upvotes: -1