Ste*_*fan 1 iphone cocoa-touch memory-leaks memory-management
这是一个众所周知的片段,如何从iPhone照片库中选择一张图片:
- (IBAction)selectExistingPicture {
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:picker animated:YES];
[picker release];
}
}
Run Code Online (Sandbox Code Playgroud)
在这里,您可以看到仪器的屏幕截图(全屏).
替代文字http://img.skitch.com/20090624-rtqp2mgsnyynkgb97c9e8d2g9c.jpg
它为什么泄漏?我不明白,因为选择器被正确释放,我想.
| 归档时间: |
|
| 查看次数: |
426 次 |
| 最近记录: |