Get Updates By E-mail 

Article Written By:
Johann Dowa

Parse.Com Allows Easy Data Caching, Push Notifications, And More (Completely Free While In Beta)

  •  
  •  
  •  
  •  
  •  

The first time I heard of Parse I dismissed it as “just another push notification service” and didn’t give it a second look – as it seems like I get e-mails all the time from a new startup looking to get into the push notification sending service.

When the guys at Parse purchased some advertising on this site, and sent me an e-mail about a new tutorial they’d written I decided to give Parse another look – and while parse is still completely free while in beta – they have added a very cool service for saving/loading data to the Parse servers in the last couple of months.

What I really like about Parse is the ability to cache queries, and retrieve that cached data very easily with no need to mess around with Core Data, SQLite, or Plists yourself.

Here’s an example of a query that will connect to Parse.Com, and save the query to a local cache for those times they may not be connected to the internet:

PFQuery *query = [PFQuery queryWithClassName:@"ObjectSavedToParse"];
query.cachePolicy = kPFCachePolicyNetworkElseCache;
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
// Results were successfully found, looking first on the
// network and then on disk.
} else {
// The network was inaccessible and we have no cached data for
// this query.
}
}];

As you can see it’s a very simple syntax, and just adding in the line query.cachePolicy = kPFCachePolicyNetworkElseCache; enables cache use if not connected to the internet.  Other policies are available such as query.cachePolicy = kPFCachePolicyCacheElseNetwork; which will use the local cache to find the object, and only use Parse if that objects not available..

There’s some other very useful services included such as secure user logins with other services such as Facebook logins being added and just recently they added in the capability to associate your objects with a geographic location.

You can read more about using Parse on iOS on the documentation page.  You can find a full example of how to save a high score list to Parse here.

So be sure to check out the Parse service here.  Not only is it free right now while still in beta, but if you look over at the pricing it will be rather inexpensive compared to other services.

Looks like a great service that is constantly improving.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments