I am attempting to allow a user to select an image from the photo gallery and assign a comment to it.
The photo class presents a UIIMagePickerController and I am able to successfully retain the image chosen by the user. However, when I create a view controller for the comment box and present/dismiss it, I am not sure how to save the value of the text the user entered because that value is declared in a separate objective-c class whose variables are not visible to my photo class.
The subroutine below is from the photo class. It is called after the user has chosen an image from the iphone photo gallery:
- (void)imagePickerController:(UIImagePickerController*)picker
didFinishPickingImage:(UIImage*)image
editingInfo:(NSDictionary*)editingInfo
{
// I do something with the image here
[self uploadImage];
// now I dismiss the modalviewcontroller for the photo library
[self dismissModalViewControllerAnimated:YES];
// creating and displaying the view that will allow a user to enter a comment
UserPhotoComment* comment = [[UserPhotoComment alloc] init];
[self presentModalViewController:comment animated:YES];
// how do I get the value entered by user? The text is in another obj-c class.
// dismissing the modal view for the comments
[self dismissModalViewControllerAnimated:YES];
[picker release];
}