I have two view controller and in frist view controller i have one button,now i want to that the user wen click that button then they will go to second view controller. I am not using storyboard and do use ARC,I have tried this but it show error “no visible @interface for uiviewcontroller declare the selector alloc”.
- (IBAction)SendMsg:(id)sender {
UIViewController *MessageViewController = [MessageViewController alloc] initWithNibName:@"MessageViewController" bundle:nil];
[self presentModalViewController:MessageViewController animated:YES];
[MessageViewController release];
}
You are declaring “*MessageViewController” as type UIViewController. And then calling the “MessageViewController” alloc method. You can’t do that. Maulik is on the right track, but if you are using ARC you need to remove the last line ([aMessageViewController release];)
try:
Don’t forget you’ll need a way to dismiss the modal view controller, and you can set the presentation and transition styles by adding something like this before the last line above:
There are other styles, I just used examples. Good luck