I am trying to use the camera or photo album to first pick an image when adding a new item.
When I use the below code I get an error because the addItem modal view controller is not finished loading yet before I attempt to press another. Is it possible to respond to a view did load delegate? I am using itemCreatedForSectionAtIndex but the modal view is not finished loading.
- (void)tableViewModel:(SCTableViewModel *) tableViewModel itemCreatedForSectionAtIndex:(NSUInteger) index item:(NSObject *) item
{
NSLog(@"Item created");
[self editPhoto];
}
- (void) editPhoto{
// If iPod Touch and no Camera
//if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
NSLog(@"Album Time~");
UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
//picker.cameraOverlayView.
[self presentModalViewController:picker animated:YES];
}
Here is the error:
2010-08-31 11:24:00.401 iScoutShoes[2703:307] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attempting to begin a modal transition from <UINavigationController: 0x17d0d0> to <UINavigationController: 0x1efd30> while a transition is already in progress. Wait for viewDidAppear/viewDidDisappear to know the current transition has completed'