尝试通过图像选择器从照片库获取照片时应用程序崩溃

发布于 2024-12-08 21:05:21 字数 253 浏览 2 评论 0原文

有人在尝试使用图像选择器访问照片库时遇到过此错误吗?

NSInvalidArgumentException  Cannot set metadata in read-only store.

任何有关实际问题的建议以及如何解决此问题的建议将不胜感激。

错误堆栈的快照如下所示

在此处输入图像描述

Anyone encountered this error before when trying to access the photo library using the image picker?

NSInvalidArgumentException  Cannot set metadata in read-only store.

Any advise on what actually went wrong and suggestions on how I can resolve this will be greatly appreciated.

A snapshot of the error stack is shown below

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陪你到最终 2024-12-15 21:05:21

开发者论坛上有一篇帖子,可能会有点帮助(奇怪的是,它标记为“Apple 机密信息”)尽管 iOS 5 已经发布)。

我们也一直看到这些。我的第一印象是它与未连接到 iCloud 时使用 PhotoStream 有关,但“recordVersion:forStore:”表明它正在尝试将照片库升级到 5.0 格式(作为非特权/沙盒,它可能无法做到这一点) /etc 进程)。

除了“与 iTunes 同步”之外,以下操作可能会解决该问题:

  • 启动照片
  • 启动相机并拍照

这似乎在 OS 5.0.1 中并未得到修复,但报告数量已大幅减少,表明人们的照片库最终正在升级。

There's a post on the dev forums which might be slightly helpful (it's curiously marked "Apple Confidential Information" despite iOS 5 being released).

We've been seeing these too. My first impression was that it was related to using PhotoStream while not being connected to iCloud, but "recordVersion:forStore:" suggests it's trying to upgrade the photo library to the 5.0 format (which it presumably can't do as an unprivileged/sandboxed/etc process).

In addition to "sync with iTunes", the following things might fix the problem:

  • Launching Photos
  • Launching Camera and taking a picture

This doesn't seem to have been fixed in OS 5.0.1, but the number of reports has drastically reduced, suggesting people's photo libraries are eventually being upgraded.

铁轨上的流浪者 2024-12-15 21:05:21

这个问题仅限于 IOS5 - 已在开发论坛上询问 Apple,但没有答案。我无法重现自己,但是..

我的 beta 测试人员报告说,与 iTunes 同步似乎可以清除此错误 - 所以我的猜测是 iTunes 同步正在修复权限问题。

我将此代码包装在 @try/@catch 中,但它仍然崩溃:(。

- (void)showImagePicker {
 UIImagePickerController *imagePicker = [[[UIImagePickerController alloc] init] autorelease];     
 imagePicker.delegate = self;
 imagePicker.hidesBottomBarWhenPushed = YES;
 imagePicker.allowsEditing = YES;
 imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
 [tabController presentModalViewController:imagePicker animated:YES];  // sometimes crash 
}

当我调用 UIImageWriteToSavedPhotosAlbum 时,其他用户也很少/不可重现地遇到相同的崩溃

This issue is IOS5 only- have asked Apple on the dev forums, but no answer. I have not been able to repro myself, but..

My beta testers reported that syncing with iTunes seems to clear this error up- so my guess is that iTunes sync is fixing a permissions problem.

I wrapped this code in a @try/@catch but it's still crashing :(.

- (void)showImagePicker {
 UIImagePickerController *imagePicker = [[[UIImagePickerController alloc] init] autorelease];     
 imagePicker.delegate = self;
 imagePicker.hidesBottomBarWhenPushed = YES;
 imagePicker.allowsEditing = YES;
 imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
 [tabController presentModalViewController:imagePicker animated:YES];  // sometimes crash 
}

also getting the same crash infrequently/non-reproducibly for other users when I call UIImageWriteToSavedPhotosAlbum

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文