I'm trying to code an app in Xcode 4, with storyboarding.
My project is something like this:
1 table view controller
1 detail view controller with 4 buttons,
and say 6 images( 1-1.jpg/1-2.jpg/1-3.jpg, and 2-1.jpg/2-2.jpg/2-3.jpg.
I have got my app to show the images(1-1.jpg and 2-1.jpg) in the array when clicking the cells.
And this is my code:
// TableViewController.m:
@synthesize myTitle = _myTitle; @synthesize myScene = _myScene; @synthesize myImages = _myImages; - (void)viewDidLoad { [super viewDidLoad]; self.myTitle = [[NSArray alloc] initWithObjects:@"Chicken", @"Flower", nil]; self.myScene = [[NSArray alloc] initWithObjects:@"1", @"2", nil]; self.myImages = [[NSArray alloc] initWithObjects:@"1-1.jpg", @"2-1.jpg", nil]; } // DetailViewController.m
@synthesize titleLabel = _titleLabel; @synthesize sceneLabel = _sceneLabel; @synthesize imageView = _imageView; @synthesize myDetailModel = _myDetailModel; - (void)viewDidLoad { [super viewDidLoad]; self.navigationItem.title = self.titleLabel.text = [self.myDetailModel objectAtIndex:0]; self.sceneLabel.text = [self.myDetailModel objectAtIndex:1]; self.imageView.image = [UIImage imageNamed: [self.myDetailModel objectAtIndex:2]]; I want my DetailView page to show the next or previous image(1-2.jpg/1-3.jpg... / 2-2.jpg, 2-3.jpg...) each time I press next or previous (black)button,
and to show next or previous scene(chicken scene and flower scene) when I press another (green)buttons,
like https://dl.dropboxusercontent.com/u/7493131/q3.jpg
I don't know how to array 1-2.jpg, 1-3.jpg, 2-2.jpg and 2-3.jpg and what to do with them.
I am so new that I would like some example code to help please to study how it works, and how I can implement similar within my app. Thank you.