我有一個應用程序,它將圖像存儲到iphone中相冊中的自定義庫。將圖像保存到自定義庫
我叫ALAssetLibrary
以下功能-(void)saveImage:(UIImage*)image toAlbum:(NSString*)albumName withCompletionBlock:(SaveImageCompletion)completionBlock
{
//write the image data to the assets library (camera roll)
[self writeImageToSavedPhotosAlbum:image.CGImage orientation:(ALAssetOrientation)image.imageOrientation
completionBlock:^(NSURL* assetURL, NSError* error) {
//error handling
if (error!=nil) {
completionBlock(error);
return;
}
//add the asset to the custom photo album
[self addAssetURL: assetURL
toAlbum:albumName
withCompletionBlock:completionBlock];
}];
}
在我SaveImage IBAction爲
-(IBAction)saveToLib:(id)sender
{
UIImage *savedImage = imgPicture.image;
NSLog(@"Saved Image%@",savedImage);
[self.library saveImage:savedImage toAlbum:@"Touch Code" withCompletionBlock:^(NSError *error) {
if (error!=nil) {
NSLog(@"Big error: %@", [error description]);
}
}];
}
,但我的應用不斷得到墜毀 幫我出 由於提前
上發言出發的NSLog – WaaleedKhan 2012-04-05 16:43:29
無法識別的選擇發送到實例 – WaaleedKhan 2012-04-05 16:47:04
請告訴您的完全崩潰日誌... – Aravindhan 2012-04-05 16:47:54