How are photos in Xcode labeled?
我很好奇如何在Xcode中标记照片。基本上,我正在创建一个访问相机以拍照的应用程序。当您转到该应用程序的相册时,它仅显示该应用程序拍摄的照片,但是,我希望这些照片也出现在"相机胶卷"中(因此,我不想保存拍摄的照片)通过此应用程序进入自己的目录)。如果我知道照片的标签方式,那么我可以将该应用程序拍摄的照片存储在数据库中,并告诉应用程序仅列出该应用程序拍摄的照片(大概是TableView)。似乎会有某种常数,例如PHOTO_INDEX或类似的东西...我认为它是存在的,因为当您将照片从iPhone保存到计算机时,它们是以这种方式存储的。有什么想法吗?
如果使用
1 2 3 4 5 6 7 8 9 | void (^endBlock)(NSURL*, NSError*) = ^(NSURL *url, NSError *e) { if (!e) { // you can use the url to do whatever you want, save the index of the image, save directly the url or what you need } }; ALAssetsLibrary* lib = [[ALAssetsLibrary alloc] init]; [lib writeImageToSavedPhotosAlbum:[image CGImage] orientation:(ALAssetOrientation)[image imageOrientation] completionBlock:endBlock] |