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

Throdne

macrumors newbie
Original poster
Jul 11, 2012
9
0
Well, I decided that it's time to learn a new skill, programming objective-c. My programming knowledge is very minimal, It consists of PHP, little bit of HTML, and a little bit of MySQL. What I want to do is take some JSON that is made with php and populate a iOS table view.

here is my json.php:

<?php
$array = array(1,2,3,4,5,6,7,8,9,10);
$json = json_encode($array);
echo $json;
?>

My only problem is, is I have no idea where to start on how to use JSONKit framework. https://github.com/johnezang/JSONKit/ I would prefer to use JSONKit over the other alternatives just because it seems it has more support.

NSString *strURL = [NSString stringWithFormat:mad:"http://api.tekop.net/json.php"];
NSData *dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString:strURL]];
NSString *strResult = [[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding];
NSLog(@"%@", strResult);

I was able to print the results of the JSON page in the debug console. Now my only question is what next? I have tried to look for some tutorials online but all I could find was something more advanced Jason phraser. To advanced for my basic needs. I know my questions very vague and open to a lot of different answer, but I figured this is the place to ask these types of questions.
 
Last edited:
O, if ios 5 or later has built in Json, then no. I didn't know i had that option. Ever tutorial I have found online was using a third party json library plus it seemed like more widely used, even more used then the built in json.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.