Hey Guys..just started with xcode today. I started an app using the "view-based application" template.
I got a UISlider to work. I have a maximum value of 12 and it starts at 0. When I slide it, the label above changes from 0 to 12.
My question is, as that value increases, I want to spell something out. For example, if I am at value 8 and have a string of "Hello World!!", the label would read, "Hello Wor", increasing it to 9 would give me "Hello Worl"..get it?
I am a flash and php guy so I am familiar with arrays, substrings etc. Just new to the xcode stuff. Many thanks!
Hey Guys..just started with xcode today. I started an app using the "view-based application" template.
I got a UISlider to work. I have a maximum value of 12 and it starts at 0. When I slide it, the label above changes from 0 to 12.
My question is, as that value increases, I want to spell something out. For example, if I am at value 8 and have a string of "Hello World!!", the label would read, "Hello Wor", increasing it to 9 would give me "Hello Worl"..get it?
I am a flash and php guy so I am familiar with arrays, substrings etc. Just new to the xcode stuff. Many thanks!
Take a look at the XCode docs for NSString. There are quite a few methods that let you extract substrings. In your case, you probably want substringToIndex.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
Hey Guys..just started with xcode today. I started an app using the "view-based application" template.
I got a UISlider to work. I have a maximum value of 12 and it starts at 0. When I slide it, the label above changes from 0 to 12.
My question is, as that value increases, I want to spell something out. For example, if I am at value 8 and have a string of "Hello World!!", the label would read, "Hello Wor", increasing it to 9 would give me "Hello Worl"..get it?
I am a flash and php guy so I am familiar with arrays, substrings etc. Just new to the xcode stuff. Many thanks!
Try to use:
- (NSString *)substringToIndexNSUInteger)to;
i hope it helps you...