我已经使用 appgroup 在手表应用程序和 iphone 应用程序之间发送数据,但我无法将数据从手表应用程序发送回 iphone 应用程序。此问题存在于手表操作系统中。
我的代码是:
@implementation InterfaceController
@synthesize MedText,MedImage,selImage;
- (void)awakeWithContext:(id)context {
[super awakeWithContext:context];
// Configure interface objects here.
// Configure interface objects here.
NSUserDefaults *userDefaultVIT=[[NSUserDefaults alloc] initWithSuiteName:@"group.Medapp"];
[userDefaultVIT synchronize];
NSString *str= [userDefaultVIT stringForKey:@"MedOrgWatchVIT"];
MedText.text=str;
NSLog(@"%@",str);
i=0;
MedArr=[[NSArray alloc] init];
MedImageArr=[[NSArray alloc] init];
}