Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RobertD63

macrumors 6502
Original poster
Feb 17, 2008
403
42
A place
Okay guys, If your willing to help heres my little pickle im in. :eek:

I have an App called ReAct(I know, we've all seen it) and I wanna know how to be able to save the reaction time then when the user taps the button to send it off to iPhoneLB.com Here is a video showing you a little more. THe video is a little dated because I over looked the first part and forgot to put in a [alert show]; function.

Anyways would I make an array or something? I'm a very beginner Developer and if you cant tell I suck at it. But I'm hoping to get better:confused:

Thanks in advance!
 
Oops I forgot to say the it shows the UIAlert and everything. Now my main focus is to take the last reaction time, save it, then send it off to iPhoneLB.com for the high scores. :) Sorry for not being clear
 
So, you're stuck on Step 4? If so, the problem probably is your trying to call submitHighScore: from within your view or viewController but it's defined in your appDelegate. You'll want to do something like this instead:
Code:
AppNameAppDelegate *appDelegate = (AppNameAppDelegate *)[[UIApplication sharedApplication] delegate];
NSString *response = [appDelegate submitHighScore:@"brandontreb" score:199.5 url:@"http://twitter.com/brandontreb"];
P.S. Replace "AppNameAppDelegate" with the real name of your AppDelegate class.
 
Yea I see that but wouldn't it send the same score every time? and everything else would remain the same?

Edit: I just want the user to be able to their last reaction time to iPhoneLB.com using submitHighScore thats already been called. If that makes it any clearer?
 
Well, you also need to replace the values for the parameters to submitHighScore: with more appropriate values, including the score. You were able to include the score in the alert, right?, so it's already in a variable? So, something more along the lines of:
Code:
NSString *response = [appDelegate submitHighScore:userName score:userScore url:userURL];
where userName and userURL are NSStrings for the current user and userScore is a float containing their reaction time.

This is all fairly basic Objective-C stuff. Perhaps it is time to step back from the real code and relearn the basics before continuing on.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.