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 06-23-2009, 01:37 AM   #1 (permalink)
pete42
Registered Member
 
Join Date: Jun 2009
Posts: 31
pete42 is on a distinguished road
Default Use string to call a function

I'm creating a game and I need to call an action. My problem is that I need the function being called to change according to the level the user is one. I have the whole thing basically worked out where the game finds what level the user is one and then adds one to it but since the game has 50 levels so far using if statements is kind of stupid. So I have been experimenting with makeing a string that has an integer value that changes but I can't get my application to recognize that the string is a function and nothing happens.

Thus what i have and have tried many variations of this idea:
Code:
int points = [num.text intValue]; /*find the level*/
points = points +1

function = [NSString stringwithFormat:@"Q%iR:(id)sender", points];

[self function];
pete42 is offline   Reply With Quote
 

» Advertisements
» Online Users: 456
13 members and 443 guests
baja_yu, buggen, coolman, Droverson, givensur, guusleijsten, Kieren Harrold, mer10, pochuang, sledzeppelin, Speed, TheStalker, thestojkovic
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,636
Threads: 94,101
Posts: 402,819
Top Poster: BrianSlick (7,990)
Welcome to our newest member, samdanielblr
Powered by vBadvanced CMPS v3.1.0

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