Hi everyone. I have been struggling for a few days on how to make my UIActionSheet button open a new view. I thought I finally had it with this code, but it is throwing me a bunch of errors. Does anyone have an idea of what I am doing wrong?
I'm trying to open the AboutUs view.
ViewController.h
Code:
-(IBAction)menubutton;
ViewController.m
Code:
#import "AboutUs.h"
//menu button
-(IBAction)menubutton {
UIActionSheet *menu1 = [[UIActionSheet alloc] initWithTitle:@"Menu"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"About Us", @"Submit Idea", nil];
[menu1 showInView:[self view]];
[menu1 release];
}
-(void)actionSheet:(UIActionSheet *)menu1 clickedButtonAtIndex:(NSInteger)buttonIndex {
switch (buttonIndex) {
case 0: {
AboutUs *aboutuspage = [[AboutUs alloc] initWithNibName:@"About Us Page" bundle:nil];
[self presentModalViewController:aboutuspage animated:NO];
[aboutuspage release]; }
break;
case 1:
//code
break;
}
}
//End of Menu Button
The errors I am getting are:
-(3) use of undeclared identifier 'aboutuspage' following the "AboutUs *aboutuspage" line
-instance method '-bundle' not found. (return type defaults to id)
-it says I'm missing a [ between the ininWithNibName: and @"About Us Page: