Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 01-08-2012, 05:34 PM   #1 (permalink)
Banned
 
Join Date: Jan 2012
Posts: 1
mike boss is on a distinguished road
Default Slideshow with multiple images needing a previous image button.

I want this button to be able to display the previous image that was shown

This is the code for the 'next' button:
-(IBAction)nextbutton: (id)sender;
{
int ptr = rand() % 6;
NSArray *images = [[NSArray alloc] initWithObjects:@"Americans.png",@"Approach.png",@ "Arianny.png",@"Atoms.png",@"Australia.png",@"Aver age.png",nil];

}

This is the code i am having trouble with I want this button to show the image that was shown previously. from the array randomized above but it doesnt do that:
-(IBAction)previousbutton: (id)sender;
{


int ptr=0;

if (ptr <=5)
{

ptr = 5;
ptr--;
[imageView setImage:[images objectAtIndex: ptr]];
}

NSArray *images = [[NSArray alloc] initWithObjects:@"Americans.png",@"Approach.png",@ "Arianny.png",@"Atoms.png",@"Australia.png ",@"Average.png",nil];

[imageView setImage:[UIImage imageNamed:[images objectAtIndex: ptr]]];
}
mike boss is offline  
Old 01-08-2012, 05:51 PM   #2 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

Is there a reason why you not only created a duplicate thread, but an additional account as well?

http://www.iphonedevsdk.com/forum/ip...us-button.html
baja_yu is offline  
Closed Thread

Bookmarks

Tags
iphone, xcode

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 390
10 members and 380 guests
Atatator, buggen, guusleijsten, j.b.rajesh@gmail.com, morterbaher, QuantumDoja, sacha1996, Sami Gh, tim0504, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,674
Threads: 94,122
Posts: 402,907
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Atatator
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:36 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0