i am a fairly new iOS programmer, and I’ve lately been having trouble with my multi view app. Im using a paged based application with two view. I just don’t seem to be able to make an IBAction that allows me to switch between each view. i tried using:
[self presentModalViewController: SecondViewController animated: YES];
but i keep getting an error that says:
“use of undeclared identifier ‘SecondViewController’
So you should declare that FIRST.
Please follow these steps:
In your first view controller, add the code to the head of the FirstViewController.m file to import the second view controller:
#import “SecondViewController.h”
When you present the second view controller, you should initialize it first, you should write:
SecondViewController *secondVC = [[SecondViewController alloc] initWithNibName:nil bundle:nil];
Now you can invoke your code but with the instance:
[self presentModalViewController: secondVC animated: YES];
Do not forget cleaning up:
[secondVC release];
Hope to help:)