Search Results

Search found 2 results on 1 pages for 'cgp'.

Page 1/1 | 1 

  • Sort NSFetchedResultsController results by user location

    - by cgp
    I have an application that contains some Locations in Core Data, and I want to show them to the user in order of proximity to the user's location. I am using an NSFetchedResultsController to serve the locations to the Table View. I thought about creating a virtual accessor method that returns the location's distance from the user, that would be calculated using a "global" CoreLocationManager, but it crashes with reason: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'keypath distanceFromCurrentLocation not found in entity < NSSQLEntity Location id=4' I also give the user the option to sort alphabetically, so I would prefer it if I kept the NSFetchedResultsController, if possible. How should I do it? Thanks!

    Read the article

  • Where should I put some code for loading application data?

    - by cgp
    I have a tab-bar and navigation controller application (like Youtube app or Contacts app). Where is the correct place to have the code for loading some data from the web? These data are necessary for all the tabs of the Tab Controller and the app can't display anything before all data are downloaded and parsed from the app (except a loading indicator view of course). Up to now I put it in the AppDelegate but it somehow doesn't feel right.. What's the correct way to do it? Thanks!

    Read the article

1