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