我不熟悉 WKInterfaceController
在 Apple Watch 中的两个之间传输或传递数据。我想做的是,我有一些变量name
,所以我需要在用户点击一行时将一些值传递给age
它们。这是代码:SecondInterfaceController
WKInterfaceTable
- (void)table:(WKInterfaceTable *)table didSelectRowAtIndex:(NSInteger)rowIndex {
NSString *name;
NSString *age;
switch (rowIndex) {
case 0:
name = @"Jack";
age = @"22";
break;
default:
break;
}
NSDictionary *d = [NSDictionary dictionaryWithObject:name forKey:@"kName"];
[self pushControllerWithName:@"SecondInterfaceController" context:d];
}
但我不知道如何从 SecondIntefaceController 访问字典并将其传递给 _name (WKInterfaceLable) 。