Thanks... but
my 'main window' has
@class cameraClass; // this is a controller
@interface hellomainwindow : UIView
{
IBOutlet cameraClass *myCamera;
IBOutlet UILabel *myMainViewText;
IBOutlet UIImageView *myCameraImage;
}
camera class is...
@interface cameraClass : UIViewController <UINavigationControllerDelegate, UIImagePickerControllerDelegate>
{
UIView *windowView;
UILabel *windowText;
UIImageView *windowCameraImage;
UIImagePickerController *cameraImgPicker;
}
so cameraClass is a UIViewController
and startTheCamera is called when the button on main window is pressed
- (bool)startTheCamera: (UIView*) aView : (UILabel*)aWindowText: (UIImageView*)aWindowCameraImage
{
bool retval = false;
windowView = aView;
windowText = aWindowText;
windowCameraImage = aWindowCameraImage;
if ( (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourc eTypeCamera]))
{
windowText.text = @"Camera not available";
}
else
{
// now start the camera
windowText.text = @"Started picker";
self.view = windowView;
self.cameraImgPicker = [[UIImagePickerController alloc] init];
self.cameraImgPicker.allowsImageEditing = YES;
self.cameraImgPicker.delegate = self;
self.cameraImgPicker.view = windowView;
//// self.cameraImgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.cameraImgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:self.cameraImgPicker animated:YES];
retval = true;
}
return retval;
}
If I check 'self' wen I ask it to animate the cameraImgPicker the UIViewController member is full of nulls - including the UIView *_view member(looks totally uninitialised to me), in contrast a working program from the web seems to show this member has something in it. I can't work out how the difference occurs.
|