can setText for WKInterfaceLabel in init method but not in didselectrow method

旧巷老猫 提交于 2019-12-08 04:50:42

问题


I have a storyboard with two scenes, both scenes are handled by the same WKInterfaceController. In the second scene there are 3 WKInterfaceLabels

In the init() method of the interface controller I am able to change the Label with setText function. When I try to change the WKInterfaceLabel "Dienst" in

- (void)table:(WKInterfaceTable *)table didSelectRowAtIndex:(NSInteger)rowIndex
    NSManagedObject *dienst = [TableArray objectAtIndex:rowIndex];
    [self.Dienst setText:@"Selected"];
    NSError *error;
    NSString *MP = [self read_KC_Pass:&error];
    [self.Benutzer setText:[self get_Benutzer:[dienst valueForKey:@"dienst"]:MP]];
    [self pushControllerWithName:@"Detail" context:nil];

The Value of WKInterfaceLabel Dienst is nil. Does anybody has a clue? I am not used to storyboard The outlet is defined, can be accessed in the init() method, but not in another method

来源:https://stackoverflow.com/questions/29736155/can-settext-for-wkinterfacelabel-in-init-method-but-not-in-didselectrow-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!