-5

i would like to know or maybe if someone can guide me what to do. for now im putting my mind on creating an app that gets the featured products on my website, using storyboard. where i click on products on my list in the tables view the it'll send me to next view to choose the product and when i click on the product and it'll go to another view where its details are written. i would know that it'll be done with parsing, or am i wrong.

its like, products --> products name list from web --> details

the interface and the tableview are already set, coding is just missing i just need to know where to begin.

James Webster
  • 31,873
  • 11
  • 70
  • 114
Ace Munim
  • 325
  • 3
  • 18
  • this question is too broad - it's asking how do you create an app. SO is a Q/A site - not so much a do it for me site :) – bryanmac Aug 06 '13 at 12:33
  • Would recommend going one of the many iOS books and online tutorials. Then where to start will start to clear up. – bryanmac Aug 06 '13 at 12:34
  • 1
    To get you going - if you want the app to get products from your site then you want your site to expose RESTful APIs returning JSON. Then use NSJsonSerialization along with NSURLConnection to get data and then UITableView and it's protocol to display the data. – bryanmac Aug 06 '13 at 12:36
  • than for reply bryan, and im not asking for the whole code or stuff like that i just needed a kick start guidelines and justin just wrote a brief one below. – Ace Munim Aug 06 '13 at 12:57

2 Answers2

2

Just a heads up, this question is far too broad for StackOverflow. You need to break this up and ask several smaller questions.

  1. User Loads app, and it makes a request to your webserver asking for product list (NSURLConnection)
  2. Webserver receives request and sends encoded data back down. XML? JSON? Up to you. (What software is running on your webserver? PHP? MySQL? Gather data and encode)
  3. App Receives product data. Parse the encoding wrapper to get your object data. (JSON or XML to NSDictionary, some good libraries available)
  4. Populate data source with this data
  5. Display data

If you have hundreds of products you'll probably need to reproduce this over and over, but that's up to you. If you only have a dozen or so it's probably easier to just send the whole chunk over on app startup.

Daddy
  • 9,045
  • 7
  • 69
  • 98
0

Ace, if understand you correctly, the products itself should be fetched from the server. Then you can pick one or display the details. So, I would use a framework to connect and get the results from the server. There are things to consider: XML/JSON data parsing and mapping, Storing and caching the products, so you would be able to display them when there is no connections and updating with the latest changes. I am currently using RestKit which handles pretty much all of these things but for JSON. If you consider CoreData (database storage in iOS) you may need some additional help with retrieving the objects - MagicalRecord framework (on top of RestKit). It will handle things like findAll, findByAttribute:name: so you can get the objects you need. These frameworks are somewhat advanced, but on the other hand, they provide a sound ground for the UI stuff.

When you set up the backend integration and get your objects/collection of objects into the client, you can start populating the TableViews and displaying details.

One more thing to consider for a new project - CocoaPods. It is a very nice way to manage third-party libraries and frameworks. You just specify the libs you need and their versions (the good practice is to always specify the version, so the libs stay in sync) and it will fetch them and create a XCode workspace with them, so you don't have to worry about integrating them into the project. Both of the frameworks are there, just use

pods search <your_framework>

Good luck

Roman Zolin
  • 121
  • 1
  • 7