guidelines from a pro for IOS 6

92 Views Asked by At

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.

2

There are 2 best solutions below

1
On BEST ANSWER

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.

0
On

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