I want to share data between iphone app and watchapp,following code I have used to share data between them: //At iphone viewcontroller:
mydefaults=[[NSUserDefaults alloc]initWithSuiteName:@"group.sample.TodayExtensionSharingDefaults"];
[mydefaults synchronize];
NSString *msgStatus=[mydefaults objectForKey:@"msgStatus"];
//At iwatch side
appdefaults=[[NSUserDefaults alloc]initWithSuiteName:@"group.sample.TodayExtensionSharingDefaults"];
[appdefaults setObject:@"read" forKey:@"msgStatus"];
[appdefaults synchronize];