iphone - 选择多个图像的问题

标签 iphone ios camera uiimagepickercontroller freeze

最佳答案

我假设单击“完成”按钮会调用取消选择器;在这种情况下,您可以尝试是否尝试实现委托(delegate)方法:

 - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
      [self dismissViewControllerAnimated:YES completion:^(void) {
           NSLog(@"Cancelled pick");
      };
 }

而且看起来您正在调用 release——您有什么理由不使用 ARC?

如果非要我猜的话,我会说警报关闭可能实际上是在调用类似的东西

 [imagePicker.delegate imagePickerControllerDidCancel:imagePicker];

但它已经发布,所以您会看到这个“锁定”问题。也许在调试器中单步执行并确保这些对象仍然存在。

编辑:

虽然它不能解决您的原始问题,但您可以在启动图像选择器之前检查可用空间,可能使用类似 this so post 的东西建议:

- (uint64_t)freeDiskspace
 {
     uint64_t totalSpace = 0;
     uint64_t totalFreeSpace = 0;

     __autoreleasing NSError *error = nil;  
     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);  
     NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths lastObject] error: &error];  

     if (dictionary) {  
         NSNumber *fileSystemSizeInBytes = [dictionary objectForKey: NSFileSystemSize];  
         NSNumber *freeFileSystemSizeInBytes = [dictionary objectForKey:NSFileSystemFreeSize];
         totalSpace = [fileSystemSizeInBytes unsignedLongLongValue];
         totalFreeSpace = [freeFileSystemSizeInBytes unsignedLongLongValue];
         NSLog(@"Memory Capacity of %llu MiB with %llu MiB Free memory available.", ((totalSpace/1024ll)/1024ll), ((totalFreeSpace/1024ll)/1024ll));
     } else {  
         NSLog(@"Error Obtaining System Memory Info: Domain = %@, Code = %d", [error domain], [error code]);  
     }    

     return totalFreeSpace;
 }

关于iphone - 选择多个图像的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14324617/

相关文章:

iphone - 在 iPhone 应用程序中进行 Google 搜索

objective-c - 获取 UIWebView 屏幕上的所有文本

ios - 在 UIPageViewController 中访问已经创建的 View Controller

iphone - iOS - 快门触发时捕获数据

Android Camera 如何在全屏预览期间显示按钮

iphone - 绘制到 GPU 的图形的屏幕截图?

objective-c - iOS:重用 UITableViewCell 的 imageView 属性不尊重 contentMode 或 ClipsToBounds

IOS 在 App Store 构建中崩溃

camera - 使用 MTP 控制尼康相机

iphone - 未调用 RobbieHanson 的 XMPPFramework didReceiveMessage