Greetings all,
I am really new to IPHone coding (I use android programming mostly but have delved into the world of Apple now)
Here is what I am looking to do
Use inputs specific variables that they setup on my server then go get the app.
When they run the app they put in the same variables into the phone and push a button to get the infromation that they are allowed to under their specific varialbes which the PHP file creates (I know that it works because the android app is working just fine)...
I can see the JSON string in the variable that I have setup through NSLog strings and the results are stored in an NSString variable that is identified and available.
What I need to know now is to how to input it in a NSDictionary and then parse out the JSON once the button is pushed
I have tried over 300 variations of things that I have found on the web and I am beating my head against the wall for three days straight on this.
Anyone have any suggestions for me?
I am also having significant problems inputing things like SBJSON and JSON.h into my fiels and I could use some help with that as well
Thanks
John
I am really new to IPHone coding (I use android programming mostly but have delved into the world of Apple now)
Here is what I am looking to do
Use inputs specific variables that they setup on my server then go get the app.
When they run the app they put in the same variables into the phone and push a button to get the infromation that they are allowed to under their specific varialbes which the PHP file creates (I know that it works because the android app is working just fine)...
I can see the JSON string in the variable that I have setup through NSLog strings and the results are stored in an NSString variable that is identified and available.
What I need to know now is to how to input it in a NSDictionary and then parse out the JSON once the button is pushed
I have tried over 300 variations of things that I have found on the web and I am beating my head against the wall for three days straight on this.
Anyone have any suggestions for me?
I am also having significant problems inputing things like SBJSON and JSON.h into my fiels and I could use some help with that as well
Thanks
John
Code:
- (IBAction)retrieve : (id) sender {
PhoneText = PhoneTextField.text;
PinText = PinTextField.text;
ConfirmText = ConfirmTextField.text;
NSLog (@"%@", PhoneText);
NSLog (@"%@", PinText);
NSLog (@"%@", ConfirmText);
NSString *strURL = [NSString stringWithFormat:@"http://x.x.x.x/order/mobile.php?Fone=%@&pincode=%@&confirm=%@&edit=Register", PhoneText, PinText,ConfirmText ];
NSData *dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString : strURL]];
NSString *strResult = [[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding];
NSLog (@"%@", strURL);
NSLog (@"Result = %@", strResult);
NSDictionary *RetorderTicket = [[[NSDictionary alloc] initWithObjectsAndKeys:strResult @"id",
@"firstname",
@"lastname",
@"phonenumber",
@"companycode",
@"email",
@"confirmationcode",
@"part",
@"desc",
@"price",
@"retrieved",
@"sku",
@"item"
@"itemimg",
@"salesperson",
@"companyimg",
@"datetime",
@"location",
@"count",
nil];
NSLog (@"%@", RetorderTicket);
Last edited: