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

mehdies

macrumors member
Original poster
Jun 10, 2012
41
0
Hi Friends,

I have 3 ViewController : 1 - ViewController.h/.m/.xib
2 - FirstViewController.h/.m/.xib
3 - ShowContentViewController.h/.m/.xib

My first and second ViewController's have TableView(each one has a TableView) for showing Name element of first JSON file (category.json) and ShowContentViewController have a UIImageView to show an image.

First JSON file have like this :

Code:
[{"parentid":0,"id":1,"name":"Norway"},
{"parentid":0,"id":2,"name":"Italy"},
{"parentid":0,"id":3,"name":"Finland"},
{"parentid":0,"id":4,"name":"Japan"},
{"parentid":1,"id":100,"name":"Oslo"},
{"parentid":2,"id":101,"name":"Milan"},
{"parentid":3,"id":102,"name":"Helsinki"},
{"parentid":4,"id":103,"name":"Tokyo"}]

and second JSON file have like this :

Code:
[{"pid":103,"image":"tokyo.jpg"},
{"pid":102,"image":"helsinki.jpg"},
{"pid":101,"image":"milan.jpg"},
{"pid":100,"image":"oslo.jpg"}]

i want to program work like following :

1 - when program starts : first ViewController show name's with parented = 0 in cells
2 - when user select any on Name's,program show second ViewController with correspond item in JSON.for example if user Select Norway(id=1) program show Oslo(parentid=1).
3 - if user select any of items in second ViewController program show correspond image from second JSON file.for example if user first select Norway and the select Oslo(id=100) we must see oslo.jpg(pid=100)


* these are sample JSON file and maybe when user select any parentid=0 item program show more items than one.
* i can show item's with parentid=0 but after that i can't continue!


Could you explain me roadmap??


Thanks
 

IDMah

macrumors 6502
May 13, 2011
316
11
I used this Tutorial as a framework. And .. JSON Parse Tutorial

I find Ray's stuff awesome also has a few UITableView tutorials.

Both were extremely useful to a 'nube' like me.
Good Luck good code.
Ian
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.