Monday, May 21, 2012

Weird Switch error in Obj-C

I have this switch statement in my code:



switch(buttonIndex){
case 0:
[actionSheet dismissWithClickedButtonIndex:buttonIndex animated:YES];
break;
case 1:
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:[imagePicker autorelease] animated:YES];
break;
default:
[self openEmailViewInViewController:self];
}


And at the UIImagePickerController instantiation in Case 1 I am getting an error:



error:expected expression before 'UIImagePickerController'


and I have no idea what I am doing wrong. Thoughts?



Oh, and buttonIndex is an NSInteger





No comments:

Post a Comment