首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

保留图片到相册

2012-09-29 
保存图片到相册//接口中定义这个方法,然后在实现类中实现他- (void)imageSavedToPhotosAlbum:(UIImage *)i

保存图片到相册

//接口中定义这个方法,然后在实现类中实现他- (void)imageSavedToPhotosAlbum:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *) contextInfo;//实现类中实现- (void)imageSavedToPhotosAlbum:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *) contextInfo {    NSString *message;    NSString *title;    if (!error) {        title = @"成功提示";        message = @"成功保存到相";    } else {        title = @"失败提示";        message = [error description];    }    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title                                                    message:message                                                   delegate:nil                                          cancelButtonTitle:@"知道了"                                          otherButtonTitles:nil];    [alert show];    [alert release];}//调用方法保存到相册的代码 UIImageWriteToSavedPhotosAlbum(img, self, @selector(imageSavedToPhotosAlbum: didFinishSavingWithError: contextInfo:), nil);
1 楼 liuxing_iphone 2012-02-26   好东西呀,谢谢斑竹

热点排行