Adding a Cloud Backend for Your iOS App Using Parse – Part 1
When we first started the iOS programming course, we built a simple Recipe app together and walk you through the usage of table view. The initial version of Recipe app is very simple. All the recipe data are stored locally in an array. Later, we enhance the app by putting the recipes in a property list file. That’s better as it’s a good practice to separate static data from code.
However, both approaches face the same problem. Suppose you’ve published the Recipe app on App Store, what if you need to add more recipes or change some of the recipes?
Obviously, you’ll need to update the code (or the property file), re-build the app and submit to App Store again. And your users have to upgrade the app before viewing the updated recipes. That’s a lengthy process (normally it takes a week for Apple to review and approve your app).
A common solution is to put the recipe data into a backend database. Every time when the app launches, it retrieves the data from the backend via web service. As the data is saved and loaded remotely, you’re free to edit the recipe without rebuilding the app.

The downside is that you have to develop the backend. Apparently, this requires a different skill set and huge amount of work if you’re a beginner. Fortunately, several companies have pre-built the backend for you that your app can be easily integrated with the backend using API. This kind of service provider is usually known as Backend as a Service provider (or BaaS for short). Most of them offer the service for free to get you started. You only need to pay when the requests reach a certain volume.
In this series of tutorial, we’ll show you how to integrate the Recipe app with the Parse cloud. We’re not affiliate with Parse. We choose Parse as it is one of the leading BaaS providers and now a part of Facebook. Parse provides an easy-to-use SDK which is another reason we select Parse for the tutorial.
We’ll break the tutorials into two parts. The first part focuses on data retrieval from Parse backend. We’ll leave data update and deletion to the next article.
Okay, let’s get started.
Revisiting the Recipe App
Before we setup the Parse backend, let’s revisit the Recipe app and give you an idea about it. The Recipe app is a simple app that displays a list of recipes. User is allowed to tap on any of the recipes and the app will show the details.

Simple Recipe App
So what are we going to change?
The user interface and table layout will remain the same. After going through the tutorial, you’ll end up with an app that looks just like before. However, internally the app will pull the recipes from the backend and we’ll add “Pull to Refresh” feature to the table view as well.
To save your time from building the Recipe app, you can download the Xcode project from here (tested on Xcode 4.6.3). Unzip it and try it out. The rest of the tutorial will be built on this code template.
Creating Your Parse Backend and Setup the Data
First, sign up a free account on Parse.com. During the sign-up process, you’ll be prompted to create your first app. Simply use “RecipeApp” as the name.

Sign up and create your first app
Once registered, log into the dashboard. The dashboard provides general and application-specific usage metrics for APIs, a data browser for viewing your data in the backend and interface for managing push notifications. In this tutorial, we’ll mainly deal with the data browser that is used for managing the recipe data.

Before you can upload the recipe data to your Parse backend, you have to define the recipe class in the data browser. Click “New Class” to create a new class. Set the name as “Recipe” and type as “Custom”. Once created, you should see the class under the class sidebar.
In the Recipe app, a recipe consists of the following properties:
- the name of recipe
- the recipe image
- the preparation time
- the ingredients
Each of the above properties should be mapped to a specific column of Recipe class in the data browser. So select the Recipe class and click “+ Col” to add a column.

Adding a new column in data browser
When prompted, set the column name as “name” and the type as “String”. Repeat the same procedures to add the other three columns with the following column name and type:
- recipe image – set the column name as “imageFile” and type as “File”. The PFile type is used for binary data like image.
- preparation time – set the column name as “prepTime” and type as “String”
- ingredients – set the column name as “ingredients” and type as “Array”
The Parse SDK handles the translation of native Objective-C types to JSON. For instance, if you retrieve a String type from Parse, it will be translated into a NSString object in the app.
Next, we’ll add the recipe data in the Recipe class. Click “+ Row” button to create a new row.

Adding a new row for Recipe class
Each row represents a single recipe. You only need to upload the recipe image and fill in the name, preparation time and ingredients columns. For the objectId, createdAt and updatedAt columns, the values will be automatically generated by Parse.
As an example, here is the code of a Recipe object:
1 2 3 4 5 |
Recipe *recipe1 = [Recipe new]; recipe1.name = @"Egg Benedict"; recipe1.prepTime = @"30 min"; recipe1.imageFile = @"egg_benedict.jpg"; recipe1.ingredients = [NSArray arrayWithObjects:@"2 fresh English muffins", @"4 eggs", @"4 rashers of back bacon", @"2 egg yolks", @"1 tbsp of lemon juice", @"125 g of butter", @"salt and pepper", nil]; |
To put this recipe into Parse, fill in the “name” column as “Egg Benedict”, the “prepTime” column as “30 min” and upload the “egg_benedict.jpg” for the “imageFile” column. To fill in the “ingredients” array, use the following format:
1 |
["2 fresh English muffins","4 eggs","4 rashers of back bacon","2 egg yolks","1 tbsp of lemon juice","125 g of butter","salt and pepper"] |
Repeat the above procedures to add the rest of recipes.

Recipes in data browser
Isn’t it tedious to add the data one by one? Actually, we’ve prepared a data file for you. We just want to walk you through the data browser. Anyway, download the recipe data file here and import the data into the data browser (you may need to drop the Recipe class before importing).
Setting Up the Xcode Project for Parse
With the recipe data configured, we’ll tweak the Recipe app to retrieve the data from the backend. But you’ll first need to configure the Xcode project to work with Parse.
First, download the Parse SDK for iOS. Unzip the file and drag the Parse.framework folder into your Xcode project folder target.

Adding Parse SDK into Framework
You’ll need to add the following libraries into the project:
- AudioToolbox.framework
- CFNetwork.framework
- CoreGraphics.framework
- CoreLocation.framework
- libz.1.1.3.dylib
- MobileCoreServices.framework
- QuartzCore.framework
- Security.framework
- StoreKit.framework
- SystemConfiguration.framework
Under the “RecipeBook” targets, select “Build Phases” and expand the “Link Binary with Libraries”. Click the “+” button and add the above libraries one by one.

Adding libraries
Before your app can connect to Parse, you have to register it with the backend when it launches. Open “RecipeBookAppDelegate.m” and add the following header at the top of the file:
1 |
#import <Parse/Parse.h> |
Next, add the following code in the didFinishLaunchingWithOptions: method:
1 2 |
[Parse setApplicationId:@"IRVN6Y5kIGL9RnHcFnpgbAq4QwVWWVBxN2lTTvLq" clientKey:@"ANOHDG88JXVfHqYRbT3wLK9bXBOou94bTyWktOkU"]; |
Your application ID and client key will be different from the above. Make sure you replace them with your own ID and client key that can be found under “Settings” of the Parse dashboard.

Parse Dashboard – Settings
You’ve completed the configuration with Parse. Your app should be ready to connect with the Parse backend. Try to compile and run it. If you get everything correct, you should be able to run the app without any error.
Next, we’ll see how to retrieve the recipe objects that are just created from Parse.
Using PFQueryTableViewController for Cloud Data
As of now, the app uses the standard UITableViewController to display the list of recipes. This is a standard way in iOS for displaying data in table form. To retrieve data from backend and populate them into the table, however, it is a different story. There are a number of issues to consider:
- As we need to load the data from backend over Internet, it’s required to handle any network related errors such as connection failure.
- We can now update the recipe in the backend. The app should provide a mean for user to refresh the data without relaunching.
- The existing app saves the recipes and images locally. The recipe data are ready to load into table when the app launches. That’s a complete different story when the recipes are retrieved from the backend. During the app launches, the recipe data may not be ready. It’ll take time to download the recipe data and images. How can you ensure the recipes are ready before displaying them in the table?
- The time required to load the images varies depending on the network speed. Should your app wait until all images are downloaded before showing the recipes in the table? That’s an unpleasant user experience if it takes too long to load. It’s better to display the list of recipes while loading the recipe image in background.
- What if you have a large set of recipes? In this case you may not want to load the recipes all at once. For the sake of performance, you may just load a subset of recipes. Your app will only display another subset of recipes when users hit a “Load more” button.
- For best performance, you may consider to implement data caching in the app. So once the recipes are downloaded, they will be cached locally.
The above are some of the design considerations when developing data-driven apps with a backend. Luckily, the Parse SDK pre-built a controller named PFQueryTableViewController that handles the background loading, caching and error exception. This should save you a large amount of work from creating your own solution.
With this class, you’ll be able to setup a UITableView that displays your Parse data. The class inherits from UITableViewController but comes with a bunch of handy methods that make it easy to query, paginate, and display objects from Parse backend.
How To Use PFQueryTableViewController
When using Parse, each cell of a UITableView typically represents data from a PFObject. Basically, to display data in PFQueryTableViewController, all you have to do is to override these two methods:
1 2 |
- (PFTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object:(PFObject *)object - (PFQuery *)queryForTable |
The first method is similar to the cellForRowAtIndexPath: method defined in the UITableViewDataSource protocol. You override the method to provide your implementation to return a custom table cell for the PFObject. The queryForTable: method is for you to load the objects from Parse backend.
Next, we’ll tweak the Recipe app and replace the UITableView with the PFQueryTableViewController. First, open RecipeBookViewController.h and change it as a subclass of PFQueryTableViewController. Don’t forget to import the Parse header too.
1 2 3 |
#import <Parse/Parse.h> @interface RecipeBookViewController : PFQueryTableViewController |
Now open the RecipeBookViewController.m. As we no longer use UITableView and the recipe array, remove the following methods and the initialization code in the viewDidLoad: method:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [recipes count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *simpleTableIdentifier = @"RecipeCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier]; } Recipe *recipe = [recipes objectAtIndex:indexPath.row]; UIImageView *imageView = (UIImageView*) [cell viewWithTag:100]; imageView.image = [UIImage imageNamed:recipe.imageFile]; UILabel *nameLabel = (UILabel*) [cell viewWithTag:101]; nameLabel.text = recipe.name; UILabel *prepTimeLabel = (UILabel*) [cell viewWithTag:102]; prepTimeLabel.text = recipe.prepTime; return cell; } |
And replace them with these methods:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
- (id)initWithCoder:(NSCoder *)aCoder { self = [super initWithCoder:aCoder]; if (self) { // The className to query on self.parseClassName = @"Recipe"; // The key of the PFObject to display in the label of the default cell style self.textKey = @"name"; // Whether the built-in pull-to-refresh is enabled self.pullToRefreshEnabled = YES; // Whether the built-in pagination is enabled self.paginationEnabled = NO; } return self; } - (PFQuery *)queryForTable { PFQuery *query = [PFQuery queryWithClassName:self.parseClassName]; return query; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object:(PFObject *)object { static NSString *simpleTableIdentifier = @"RecipeCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier]; } // Configure the cell PFFile *thumbnail = [object objectForKey:@"imageFile"]; PFImageView *thumbnailImageView = (PFImageView*)[cell viewWithTag:100]; thumbnailImageView.image = [UIImage imageNamed:@"placeholder.jpg"]; thumbnailImageView.file = thumbnail; [thumbnailImageView loadInBackground]; UILabel *nameLabel = (UILabel*) [cell viewWithTag:101]; nameLabel.text = [object objectForKey:@"name"]; UILabel *prepTimeLabel = (UILabel*) [cell viewWithTag:102]; prepTimeLabel.text = [object objectForKey:@"prepTime"]; return cell; } |
Let’s go through the above methods one by one. In the initWithCoder: method, we configure the behaviour of the PFQueryTableView. Here we set the name of the Parse class to retrieve, enable the built-in pull-to-refresh feature but disable the pagination.
We specify the objects to load into PFQueryTableView by implementing the queryForTable: method. The PFQuery class provides a handy way to load a list of objects from Parse. You can simply create the PFQuery object with the Parse class to query.
The cellForRowAtIndexPath: method is very similar to the one we’ve implemented before. The main difference is with the use of PFObject. In brief, storing data on Parse is built around the PFObject. Each PFObject contains key-value pairs of JSON-compatible data. Here is a sample PFObject of the Recipe class:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
"imageFile": { "__type": "File", "name": "2516c9e3-ebd6-4e11-89cf-972ad77a942b-mushroom_risotto.jpg", "url": "http://files.parse.com/4838f7c6-c40b-4ed8-b750-a5a3d2948599/2516c9e3-ebd6-4e11-89cf-972ad77a942b-mushroom_risotto.jpg" }, "ingredients": [ "1 tbsp dried porcini mushrooms", "2 tbsp olive oil", "1 onion, chopped", "2 garlic cloves", "350g/12oz arborio rice", "1.2 litres/2 pints hot vegetable stock", "salt and pepper", "25g/1oz butter" ], "name": "Mushroom Risotto", "prepTime": "30 min" |
When the cellForRowAtIndexPath: method is called, you’ll get a PFObject of the Recipe class. In other words, you get a single recipe. To get the values out of the PFObject, use the objectForKey: method. Say, to get the values of the “name” key, we use:
1 |
nameLabel.text = [object objectForKey:@"name"]; |
Parse stores files (such as images, audio, document) in the cloud in the form of PFFile. We use PFFile to reference the recipe image. The Parse SDK offers a handy class named PFImageView that downloads and displays remote image stored on Parse’s server. Best of all, the download is automatically done in background.
1 2 3 4 5 |
PFFile *thumbnail = [object objectForKey:@"imageFile"]; PFImageView *thumbnailImageView = (PFImageView*)[cell viewWithTag:100]; thumbnailImageView.image = [UIImage imageNamed:@"placeholder.jpg"]; thumbnailImageView.file = thumbnail; [thumbnailImageView loadInBackground]; |
We simply specify the recipe image (i.e. thumbnail) to load by setting the “file” property of PFImageView. Before the full recipe image is downloaded, the image view will just show the placeholder image.
Lastly go back to Storyboard. Change the class of the thumbnail in the Recipe Book View Controller from UIImageView to PFImageView.

Changing the custom class from UIImageView to PFImageView
Now compile and run the app. If everything is correct, the Recipe app should be able to retrieve data from Parse backend.

Pull to Refresh and Pagination

Other than pull to refresh, the PFQueryTableViewController also comes with the pagination feature. In the above section, we disable the pagination feature. To enable it, change the paginationEnabled property to YES. By default, it shows 25 objects per page. You can change the number by altering the objectsPerPage property.
1 2 |
self.paginationEnabled = YES; self.objectsPerPage = 10; |
Let’s say we limit the number of object per page to 10. Compile and run the app again. The app will only load the first 10 recipes when it first runs. Tapping the “Load more” row will automatically retrieve the next 10 records. The pagination feature is especially useful when dealing with a large date set.
Caching for Speed and Offline Access
Try to close the app and re-launch it. Every time it opens, you’ll a “Loading…” screen that the app is downloading recipes from backend. What if there is no network access? Try to close the app and disable the network connection of your iPhone or Simulator. When running the app again, you’ll see an error message.

There is a better way to handle this situation. Parse query has a built-in support for caching that makes it a lot easier to save query results on disk. In case there is no network access, your app can load the result from cache. Caching also improves the app performance. Instead of loading data from Parse every time when the app runs, it retrieves the data from cache on startup.
By default, caching is disabled. But it can be easily enabled using a single line of code. Add the following code in queryForTable: method (after the initialization of PFquery):
1 |
query.cachePolicy = kPFCachePolicyCacheThenNetwork |
The Parse query supports various types of cache policy. The kPFCachePolicyCacheThenNetwork policy is just one of them. It first loads data from the cache, then from the network.
Try to compile and run the app again. After you run it once, disable the WiFi or other network connection and launch the app again. This time, your app should be able to show the recipes even it’s offline.
Your Exercise
The recipe detail view doesn’t work right now. When you select any of the recipes, you’ll see a screen without any recipe information. So far we haven’t changed any code in the RecipeDetailViewController class. Also the prepareForSegue: method is still referring to the recipes array that is already obsolete. I’ll leave the changes for you as an exercise.

What’s Coming Next
In this tutorial, we’ve migrated all the recipes from the app to the Parse cloud backend. With the Parse SDK, it’s pretty easy to integrate the app with Parse to retrieve the data from the cloud. This is just the first part of the tutorial series. In part 2, we’ll show you how to store and update the recipe to the backend.
Parse is just one of the BaaS providers in the market. It’s easy to integrate and works pretty well. However, you’re free to explore other providers (such as StackMob, Kinvey, Kii Cloud, MobDB, etc) and pick the most suitable one for your development. The startup cost for most of the providers are almost zero. They’re free to use and you only need to pay when the number of requests reach a certain volume.
For complete reference, you can download the full source code from here. The Xcode project already includes answers for the exercise.
As always, leave us comment and share your thought about the tutorial. We want to hear your feedback and keep improving. Stay tuned. Part 2 of the tutorial series is on the way.
Update: Part 2 of the tutorial series is now here.
Comments
Blake Jennings
AuthorThis is incredibly thorough and helpful! Looking forward to Part 2.
Erik
AuthorExcellent, thanks!
Ly4S
AuthorThis is brilliant, thanks for putting this together!
Joao
AuthorHello guys,
I am trying to retrieve Current User’s profile picture, when loading my profileViewController. As I am a beginner, I am pretty sure I am struggling with something very simple; syntax maybe.
I was able to get the userName in a label, but still problems with the picture.
Here follows what I am doing:
-(void)viewDidAppear:(BOOL)animated {
//Prepare the query to get the profile image
//1
PFQuery *query = [PFQuery queryWithClassName:@”User”];
PFQuery* queryPhoto = [PFQuery queryWithClassName:@”WallImageObject”];
//2
PFUser* currentUser = [PFUser currentUser];
if (currentUser) {
[query whereKey:@”user” equalTo:currentUser];
[queryPhoto whereKey:@”image” equalTo:currentUser];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
// Verify if there are no errors
if (!error) {
// Set username
self.profileViewUsernameLabel.text = [NSString stringWithFormat:@”%@”,[[PFUser currentUser]valueForKey:@”username”]] ;
// Retrieve Photo
PFFile* currenUserPhoto = [[PFUser currentUser] objectForKey:@”image”];
self.profileViewPhotoImageView.image = [UIImage imageWithData:currenUserPhoto.getData];
} else {
//4
NSString *errorString = [[error userInfo] objectForKey:@”error”];
UIAlertView *errorAlertView = [[UIAlertView alloc] initWithTitle:@”Error” message:errorString delegate:nil cancelButtonTitle:@”Ok” otherButtonTitles:nil, nil];
[errorAlertView show];
}
}];
}
Many Thanks.
Sabre
AuthorI downloaded full source and tried to run before replace app ID and Client key with mine. Then It worked fine except showing placeholder images only, not any menu images. After I replaced them with my app ID and Client key, it just showed empty table view and cells. When I tapped any empty table cell, it gives an error message “RecipeBook[357:907] error: (null).”
Could anybody tell me what was wrong?
Sabre
AuthorShould replace image files on the imported recipe.json file with my image files…
Ross Viviani
Authormmmm…. anyone worked out how to retrieve saved text from parse?
SrK
AuthorI get 2 Apple Mach-O Linker Error. Please help.
Martin
Authoryou forget to import into Build phases coreGraphics.framework thats all 🙂
Manu
Authori added all the frameworks..still the same
SRK
AuthorThanks a lot for this tutorial. Waiting for part 2.
Nic
AuthorThanks for this great tutorial!!
But there is a problem with imageviews. They only show placeholder image no matter how long I’ve waited
Pietro Bertini
AuthorSame for me
Chris
AuthorNic & Pietro,
This seems to be a problem with the json file uploaded.
Go to the parse data interface and remove the images from the images column – then re-upload the images from your computer – this should resolve the issue.
Pietro Bertini
AuthorThanx a lot Chris! It worked!
Nic
AuthorIt works! So json file has an issue
Alex
AuthorThanks for your help man !
Will Dennis
AuthorAbove solution worked for me as well!
JClements
AuthorThanks for putting this together. Like others, I’m getting the blank table cells issue even after replacing the image files. Is there any way you can post your final RecipeBookViewController.m file, I know my issue is in there somewhere, but I can’t figure it out without seeing it. Thank you.
sobrienti
AuthorExcellent tutorial. However I do have a question : How can I implement a PFQueryTableViewController inside a UIViewController? I need to display extra information, aside from the table view cells. Thank you.
Instead of using the PFQueryTableViewController protocol in the RecipeBookViewController.h file, I tried to use UIViewController but then I don’t have any Delegate/Data Source to supply….help would be greatly appreciated 🙂
Adrienne Henry
AuthorI think what you are looking for is a container and then set a pfquerytable.
yiannis ioannides
AuthorHi mate,
I tried the tutorial and it works fine. The only problem i have is that it changes the cell size although i configured it in the storyboard as the your previous tutorials. Now the table cell looks smaller and does not fit the 58×58 image and the labels.
Additionally how would i go about filtering recipes based on their prep time? lets say i want to show recipes that have 30 mins and less of prep time using the code above?
thank you
Marian
Author2013-08-17 13:08:28.646 RecipeBook[632:c07] -[UIImageView setFile:]: unrecognized selector sent to instance 0x7ca6b10
2013-08-17 13:08:28.647 RecipeBook[632:c07] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[UIImageView setFile:]: unrecognized selector sent to instance 0x7ca6b10’
*** First throw call stack:
(0x1f13012 0x1d38e7e 0x1f9e4bd 0x1f02bbc 0x1f0294e 0x342d 0x3a231 0xf608fb 0xf609cf 0xf491bb 0xf59b4b 0xef62dd 0x1d4c6b0 0x43afc0 0x42f33c 0x42f150 0x3ad0bc 0x3ae227 0x3ae8e2 0x1edbafe 0x1edba3d 0x1eb97c2 0x1eb8f44 0x1eb8e1b 0x29407e3 0x2940668 0xea5ffc 0x2cdd 0x2c05)
libc++abi.dylib: terminate called throwing an exception
(lldb)
and Xcode marks line
thumbnailImageView.file = thumbnail;
What did i wrong? There is only the Loading-View and this Error…
sobrienti
AuthorPlease check if thumbnailImageView belongs to the PFImageView class. The error you get means that there is no file property for thumbnailImageView.
Nick G.
Authorthanks, that was it! I was almost head over heals trying to figure out what it was.
God Bless
Ken
Author2013-08-19 20:12:27.575 City[2137:6d03] Encountered stream error: Error Domain=NSPOSIXErrorDomain Code=61 “The operation couldn’t be completed. Connection refused”
2013-08-19 20:12:27.581 City[2137:6d03] Encountered stream error: Error Domain=NSPOSIXErrorDomain Code=61 “The operation couldn’t be completed. Connection refused”
2013-08-19 20:12:27.581 City[2137:6103] Failed download from S3. Going to try again. Response: (null), Error: Error Domain=NSPOSIXErrorDomain Code=61 “The operation couldn’t be completed. Connection refused”
2013-08-19 20:12:27.581 City[2137:6103] Error: Download failed. (Code: 100, Version: 1.2.11)
Anyone has any idea about this problem?
I try run the downloaded full source code, then it is showing this error.
At the end, i was able to download the text and textview, except the image.
I try to connect to my parse account by changing the client key and application key, it still have the same problem
Patrick
AuthorHi did you manage to solve this? I got same error
EgemenOkur
Authori got the same error guys how did yo manage it ?
Hugh Jeremy
AuthorGreat tutorial, I have a problem though 🙁 On the ‘RecipeDetailViewController.m’ I get the error “Incompatible pointer types assigning ‘PFFile *’ from ‘NSString *'”. The app still works but I was hoping I would be able to get rid of the error.
Any help is much appreciated 🙂
misato
AuthorHi Hugh,
I run into the same problem and solved it by adding (PFFile *).
Here is the line of code that worked out for me. It goes inside the viewDidLoad method.
self.recipePhoto.file = (PFFile *)recipe.imageFile;
hope it helps!
Guest
AuthorHi, I got “Parse Issue”, even I tried to download your sample and change the ApplicationID and ClientKey. Please help!
Jonatan Lindahl
AuthorTry to delite the “parse framwork” and then put a new one back in again. Some times the old parse framwork from the sample does not work, you need to have a new and fresh one.
antonio
Authorhi anyone can say me how i can put a search bar? thanks in advanced
Bratkartoffl
AuthorHow Can i Order the TableView Cell by the Time? Any ideas?
Danilo Lutti
AuthorHow about ordering and search?
Li Fang
AuthorI have a question about using third party cloud service or iCloud. Which one should I use to back up data? third party for developer’s data and iCloud for user’s data? Or use one Cloud service for all data?
Happy Mask
AuthorDear Simon, this is a great tutorial 😉
1. Btw, i found some issue and i dont know that if it belong to Parse or not ?
If you set
query.cachePolicy = kPFCachePolicyCacheThenNetwork;
and
self.paginationEnabled = YES;
self.objectsPerPage=10;
When you click loadmore and pull and do it again sometime,
somehow the data is duplicated 🙁
2. When i click loadmore, i get the wrong indexPath.row 🙁
It’s count begin from 0
Do you have any idea ?
Happy Mask
AuthorI’m back to nofity if someone gets error like me.
Just add a check when when set cached
if ([self.objects count] == 0) {
query.cachePolicy = kPFCachePolicyCacheThenNetwork;
}
Noel
AuthorHi,
How would you be able to make the details you pull in from parse show up in the detail view controller as I’m unsure how this would be done?(complete beginner in ios)
Be grateful for any help
Noel
Filip
AuthorCan someone help me with passing images to detail view? Only image that will load into my detail view is the thumbnail, which is in table view cell. When I want to display different image, it doesn’t work. I am not getting any error a classes are set correctly. I’ve tried almost everything and I don’t know where the problem can be. Thank you
EgemenOkur
Authorhow did you solve this ?
Niha
AuthorCan any one guide me:
In my app i need to create functionality like whats app.
If i upload a picture or video,it will look like its uploaded,and actual upload process will be done when device is connected with internet.
I don’t know from where to start !!!
Can any one help plz..
Thanks
Niha
Marsant
AuthorTried run this example with Xcode 5.1 with target iOS 7.0 and got an error on line
thumbnailImageView.file = thumbnail;
2014-04-07 12:49:52.746 RecipeBook[2624:70b] -[__NSCFString url]: unrecognized selector sent to instance 0x9d93590
2014-04-07 12:49:52.749 RecipeBook[2624:70b] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[__NSCFString url]: unrecognized selector sent to instance 0x9d93590’
marsant
AuthorDid not see the imageFile column after importing the Recipe.json file into Parse.
marsant
AuthorManually added 4 rows to Parse and it worked.
g2sleeper
AuthorWhen I try to import the json recipe model that is provided, I get an Error in Parse “Name must start with a letter”… can someone help me with this?
Brian
AuthorI got the same error. Then I realized the Class name was blank. From the instructions, it sounded like it would provide the class name during the import, but it doesn’t. You have to type in the class name “Recipe” and then import the file.
g2sleeper
AuthorYes! I figured that out as well… boy did I feel stupid on that one…
Rajat Gupta
AuthorMy tableviewdelegate is not calling and it showing a error “Offline error something went wrong.please try again”.i checked my internet its working properly.then i download your source code its working fine.Why my table view delegate is not calling.please help.
Juan Nozaleda
AuthorCan anybody help me?
I have tried to do de exercise, but when I click in each cell it doesn’t show anything.
thanks
Collin
AuthorHow can i get the application to show an image from a URL? Thank you!
Nick
AuthorI’m getting this error after the first half of the tutorial:
*** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘-[UITableViewController loadView] loaded the “vXZ-lx-hvc-view-kh9-bI-dsS” nib but didn’t get a UITableView.’
Everything worked fine after inserting the Parse header and keys. But when I try to get the data from Parse, I get the error above.
Guest
AuthorI have
Lionel Mischler
AuthorI have the same error. Can someone help?
Will Dennis
AuthorI had the same error. You may have an extra view in the Table View Controller if you look in your storyboard. Make sure your storyboard is set up with Table View Controller > [Deleted extra view] > Table View > RecipeCell.
Morris
AuthorI get a complie error of Parse Header not found when I try to run the downloaded version of the code what gives?
Manu
AuthorHi.. I am getting 4 Apple Mach-O Linking Errors…please help
Manu
AuthorHi..can anyone please help me.. build fails to compile after adding parse application id ands client id in didFinishLaunchingWithOptions: method:
Manu
Author4 Apple Mach-O Linking Error pops up..please help
rrTenz
AuthorI am getting the exact same errors 🙁
Kartik Subramanian
Author@rrTenz – when you download the latest Parse iOS SDK, there is a framework called “Bolts.framework” in the SDK bundle. Drag the Bolts framework into the Frameworks folder as well.
So, you need to drag in both the Parse.framework AND the Bolts.framework from the Parse SDK into the frameworks folder.
I found the answer on stackoverflow.
http://stackoverflow.com/questions/25493282/error-when-connecting-ios-app-to-parse
rrTenz
AuthorI figured out a workaround. I went to https://parse.com/apps, created a new app, and downloaded it. I then copied the 3 included frameworks into my recipe project: Bolts.framework, Parse.framework, and ParseFacebookUtils.framework.
Manu
Authorcool thanks….i added these extra lib… and it worked for me…http://stackoverflow.com/questions/22509290/apple-mach-o-linker-error-parse
saad
AuthorPlease
How do I make name table view in Arabic
Miljan Vukićević
AuthorHi there! This App is fantastic startup!!!! Now i have a dumb, newbie question for the developer! Is there something easy to do about sorting these recopies… I tried step-by-step on implementing this code in and everything works, but the recepies in app are sorted from oldest to newest, is there any way to change that, so the sorting will be from newest to oldest (newest on top)? Devs pls help i know this is easy but it is very much bugging me xD Thx
kanika anand
AuthorHi, Thanks for the explanation in this article. While trying to implement Parse into my application, I get the following error : “Cannot find interface declaration for ‘PFQueryTableViewController’ …..”
Csn some one help on this? I have added all the frameworks in Frameworks folder and linked the libraries as per instructions by parse.
swapnil
AuthorWhenever i am subclassing my customviewcell with PFQueryTableViewController in swift and xcode 6.1 i keep geeting errors use of undeclared PFQueryTableViewController ? how to fix it
damalfa
AuthorJust discovered you simply need to #import in addition to the normal Parse.h class.
Dillz
AuthorPlease do a swift version of this? Not a fast one, one in the programming language swift. (sorry, bad pun—I had too)
🙂
Richard
AuthorHallo, i have 2 issues.
My Errors in Xcode
1. /RecipeDetailViewController.h:14:38: Unknown type name ‘PFImageView’; did you mean ‘UIImageView’?
2. /RecipeDetailViewController.m:38:22: Property ‘file’ not found on object of type ‘UIImageView *’
can anybody help me with this?
I have adde the Framework Bolds and Parse in the newest Version.
Thx
Richard
OL
Authordid you figure it out?
Richard
AuthorNo, unfortunately not. Have a different Template used, but in Swift.
OL
AuthorI figured it out! You’ll have to import ParseUI in your project aswell as Parse and Bold. Then import it into the viewcontroller. It should work! The parse imageview is declared in the ParseUI rather than the previous Parse framework.
php training
AuthorNice post thanks for sharing ..
vanylapep
AuthorIf I decide to create a Parse class “Ingredient” (that holds a unique set of ingredients) and have the Recipe class contains an array item from “Ingredient” (instead of an array of strings), is that possible? If yes, how do I populate the “Ingredient” class on Parse Data Browser and create a relation between the Repice and the ingredients?
antonio081014
AuthorDidn’t checkout all the comments yet, but to import the whole recipe to Parse Recipe class, developer not only upload the json file could be downloaded here, but also manually update each picture in that class by uploading them one by one.
Jojo
AuthorHow can you convert your data to a JSON Object from an excel file ? Thank you
JM
AuthorGreat tutorial, thank you very much, has been very useful. Is there an equal turorial with Firebase?