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

Reply
 
LinkBack Thread Tools Display Modes
Old 03-03-2011, 10:47 PM   #1 (permalink)
Registered Member
 
Mr.Abe90's Avatar
 
Join Date: Sep 2010
Posts: 45
Mr.Abe90 is on a distinguished road
Exclamation Help with a slider changing a variable

I really need help!!!
I really need some simple code to just make it so you slide the UISlider and it changes the value of a specific "int"
Code:
int Speed = 23;

(IBAction) slider {
???????????
}
Please fill in the "???????"
Mr.Abe90 is offline   Reply With Quote
Old 03-03-2011, 11:24 PM   #2 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 651
kapps11 is on a distinguished road
Default

xProgress.com - UISlider tutorial - example how to use slider in iPhone SDK / XCode

Loading…

plz at least try before asking ppl to help you
kapps11 is offline   Reply With Quote
Old 03-04-2011, 09:42 AM   #3 (permalink)
Registered Member
 
Join Date: Feb 2011
Posts: 60
GFish is on a distinguished road
Default

Quote:
Originally Posted by Mr.Abe90 View Post
I really need help!!!
I really need some simple code to just make it so you slide the UISlider and it changes the value of a specific "int"
Code:
int Speed = 23;

(IBAction) slider {
???????????
}
Please fill in the "???????"
Code:
-(IBAction) sliding:(id)sender {
	UISlider *s = (UISlider *) sender;
	int value = (int) s.value;
	NSString *newLabel = [[NSString alloc]initWithFormat:@"%i", value];
	sLabel.text = newLabel;
	[newLabel release];
}
GFish is offline   Reply With Quote
Old 03-04-2011, 09:54 AM   #4 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 1,106
Meredi86 is on a distinguished road
Default

i also know of at least 3 posts on this site, though they will be quite a few pages back where people have asked exactly the same question uislider to change value iphonedevsdk - Google Search

Please read through a few of the posts that you will find on that google link GFish has also given you a good start here but there is more to a slider (using IB as that is how i know and have done it myself in the past) than just the code he has suggested.

This is also quite the classic post that fits into this category:http://www.iphonedevsdk.com/forum/ip...new-topic.html

Last edited by Meredi86; 03-04-2011 at 09:55 AM. Reason: added another link
Meredi86 is offline   Reply With Quote
Old 03-04-2011, 04:20 PM   #5 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 651
kapps11 is on a distinguished road
Default

Quote:
Originally Posted by GFish View Post
Code:
-(IBAction) sliding:(id)sender {
	UISlider *s = (UISlider *) sender;
	int value = (int) s.value;
	NSString *newLabel = [[NSString alloc]initWithFormat:@"%i", value];
	sLabel.text = newLabel;
	[newLabel release];
}
try not to just give ppl the code they need. If ppl write it for them, then they never learn anything
kapps11 is offline   Reply With Quote
Old 03-04-2011, 05:11 PM   #6 (permalink)
Registered Member
 
Mr.Abe90's Avatar
 
Join Date: Sep 2010
Posts: 45
Mr.Abe90 is on a distinguished road
Default

Quote:
Originally Posted by kapps11 View Post
try not to just give ppl the code they need. If ppl write it for them, then they never learn anything
I beg to differ...
I simply love when "ppl" just give the code
Mr.Abe90 is offline   Reply With Quote
Old 03-04-2011, 05:26 PM   #7 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 651
kapps11 is on a distinguished road
Default

and thats why you post questions on here instead of trying to figure things out for yourself...
kapps11 is offline   Reply With Quote
Reply

Bookmarks

Tags
int, slider, variable

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: 369
16 members and 353 guests
Absentia, akphyo, apatsufas, BinHex, dre, Error404, Gaz, gmarro, jeroenkeij, Kirkout, MarkC, mottdog, Music Man, PavelMik, whitey99, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,666
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, cpsclicker
Powered by vBadvanced CMPS v3.1.0

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