Permalink
Browse files

fix #415: URGENT added a missing insert step to the iOS tutorial

  • Loading branch information...
1 parent 23f1210 commit 8b5d6e25ff539343b372543570f2cde38939e184 @ggailey777 ggailey777 committed Oct 16, 2012
Showing with 14 additions and 1 deletion.
  1. +14 −1 DevCenter/Mobile/Tutorials/mobile-services-get-started-with-data-ios.md
@@ -201,7 +201,20 @@ Now that your mobile service is ready, you can update the app to store items in
completion();
}];
-13. Locate the **completeItem** method, and replace the body of the method with the following code:
+13. Locate the **addItem** method, and replace the body of the method with the following code:
+
+ // Insert the item into the TodoItem table and add to the items array on completion
+ [self.table insert:item completion:^(NSDictionary *result, NSError *error) {
+ NSUInteger index = [items count];
+ [(NSMutableArray *)items insertObject:item atIndex:index];
+
+ // Let the caller know that we finished
+ completion(index);
+ }];
+
+ This code send an insert request to the mobile service.
+
+14. Locate the **completeItem** method, and replace the body of the method with the following code:
// Update the item in the TodoItem table and remove from the items array on completion
[self.table update:mutable completion:^(NSDictionary *item, NSError *error) {

0 comments on commit 8b5d6e2

Please sign in to comment.