so i am using presentmodalviewcontroller to change the active views in an ipad app. however when i try to change it using the statement [self presentModalViewController:createCharacter animated:NO]; in an ibaction that is triggered by a button. however i get an error saying expected expression before ‘createCharacter’. createCharacter is a custom view controller that i have created… does anyone know what i am doing wrong? if you need any more relevant code just let me know,thanks
additional relevant code:
#import "createCharacter.h";
-(IBAction) buildCharacter{
[self presentModalViewController:createCharacter animated:NO];
}
createCharacter.h :
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
@interface createCharacter : UIViewController {
IBOutlet UIView *view;
}
@end
I’d love to see some code to look at, and without it maybe this advice will be wrong, BUT…in my experience I’ve always used IBActions with a single argument, and that argument has always been the sender, so something like tying a button press to `
where sender is the button that was pressed.
If you use a method like that to detect the button press from IB, then in code what you would want is something like: