是否可以跨2个不同的iOS应用访问数据?

假设我在App1中存储了一些ID数据,并希望在同一设备上的App2中访问它。 这可能在平台上吗? 如果不是,有没有解决方法?

我的应用程序Instagram之间的图像共享:

NSURL *instagramURL = [NSURL URLWithString:@"instagram://location?id=1"]; if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) { NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@"Image.ig"]; NSData *imageData = UIImagePNGRepresentation(originalImageView.image); [imageData writeToFile:savedImagePath atomically:YES]; NSURL *imageUrl = [NSURL fileURLWithPath:savedImagePath]; UIDocumentInteractionController * docController = [[UIDocumentInteractionController alloc] init]; docController.delegate = self; [docController retain]; docController.UTI = @"com.instagram.photo"; [docController setURL:imageUrl]; [docController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES]; } 

您可以使用iOS钥匙串 。 这是一个关于钥匙串访问组的好教程。

一种解决方法是将应用程序注册为处理某些文件类型。 当这样的文件即将打开时,用户可以选择可以处理它的应用程序,并且所选应用程序会获得复制到它的~Documents/Inbox目录的文件的副本。 但我认为你对一些外部服务更好。