Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
George Dendle
Courses Plus Student 33 PointsParse.com; Geo Query TableView with images.
Hi Guys
I am creating an app using Parse.com, I want to be able to display the users and there profile pictures in a table view, but I want it to query the closest users to the current user first, in the User class there is a cell called 'location' which will store the location of the users last time on the app, I am assuming that I have to use Geo Query's but does any one know, firstly how to display images queried from parse in a table view, and secondly sort these by closest to current users location?
Thanks
1 Answer
Thorsten Herbst
11,935 PointsHi. Okay first of all it is a bad idea to store location related infos in a tableviewcell class. A tableviewcell should NOT act as Model. Which will be the case if you store Data in it. The better way: Define a model class in which you can Store your Data.
With NSUrlSession you can retrieve Data in a JSON Format From Parse.com.
Using the Delegation Pattern you can Store the Data in your Model.
Include the UITableViewData Source to your TableView Controler and implement the 3 required Methods:
TableView:numberOfSections TableView: numberOfRowsInSection TableView: cellForRowAt IndexPath:IndexPath
Implement these with your Model. Reference to your Tableviewcell and everything should work. If not... ask:)
Greets Thorsten
George Dendle
Courses Plus Student 33 PointsGeorge Dendle
Courses Plus Student 33 PointsHi
Thanks for your response. How would i go out implementing this. Do you have any code for it??