Using presentModalViewController with UIImagePickerController causing Crash on iOS 5 (its running fine on version<5), i am trying to get all the albums on the device, using 'UIImagePickerControllerSourceTypeSavedPhotosAlbum' is only getting the Camera images, so when i change the sourceType to 'UIImagePickerControllerSourceTypePhotoLibrary' it crashes, i appreciate any help, here is my code:
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
if(version < 5)
imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
else
imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
//imgPicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
[self presentModalViewController:imgPicker animated:YES];
From the official doc:
Maybe point 4 is causing troubles.