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

View Single Post
Old 01-01-2010, 05:29 PM   #9 (permalink)
BrianSlick
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,978
BrianSlick has a spectacular aura about
Default

If the buttons are in IB, tag is one of the fields in the inspector. Select a button and hit cmd-1. If not, setTag:

Your action should look something like this:
Code:
- (IBAction)buttonPressed:(id)sender;
To retrieve the tag:
Code:
int theTag = [sender tag];
Make a property in your scroll view controller, possibly called currentIndex.

Code:
ScrollViewController *svc = ....
[svc setCurrentIndex: [sender tag]];
In your scroll view controller:
Code:
[... setContentOffset:...(([self currentIndex] - 1) * 480, 0)];
__________________
BriTer Ideas LLC - Code review, consulting, development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
 

» Advertisements
» Online Users: 625
17 members and 608 guests
ADY, baja_yu, David-T, Davor, dcool, delldd, iAppDeveloper, ibrahimadnan, jstonebrook, MaestroApps, mer10, mtl_tech_guy, pipposanta, Sami Gh, SLIC, Steve Shanks, Xaphann
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,422
Threads: 94,020
Posts: 402,547
Top Poster: BrianSlick (7,978)
Welcome to our newest member, iAppDeveloper
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:46 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.