mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 20:31:13 +08:00
Expanded comments and cleaned up more TODO's. Just a couple of bug fixes left in RestKit and styling work on this app!
This commit is contained in:
@@ -62,7 +62,6 @@
|
||||
_bodyTextEditor.text = _post.body;
|
||||
|
||||
// Ensure we are authenticated
|
||||
NSLog(@"All the users are: %@", [DBUser allObjects]);
|
||||
[self presentLoginViewControllerIfNecessary];
|
||||
}
|
||||
|
||||
@@ -77,8 +76,7 @@
|
||||
if (_newAttachment) {
|
||||
// has new attachment. show it. allow update.
|
||||
[items addObject:[TTTableImageItem itemWithText:@"Tap to Replace Image" imageURL:@"" defaultImage:_newAttachment URL:@"db://updateAttachment"]];
|
||||
} else if (![[_post attachmentPath] isWhitespaceAndNewlines]) {
|
||||
// TODO: Create model method to determine if there is an attachment
|
||||
} else if ([_post hasAttachment]) {
|
||||
// Has existing attachment. allow replace
|
||||
NSString* url = _post.attachmentPath;
|
||||
[items addObject:[TTTableImageItem itemWithText:@"Tap to Replace Image" imageURL:url defaultImage:nil URL:@"db://updateAttachment"]];
|
||||
@@ -153,11 +151,9 @@
|
||||
#pragma mark RKObjectLoaderDelegate methods
|
||||
|
||||
- (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects:(NSArray*)objects {
|
||||
NSLog(@"Loaded Objects: %@", objects);
|
||||
NSLog(@"Status Code: %d", objectLoader.response.statusCode);
|
||||
// Post notification telling view controllers to reload.
|
||||
// TODO: Generalize this notification
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kObjectCreatedUpdatedOrDestroyedNotificationName object:objects];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:DBContentObjectDidChangeNotification object:[objects lastObject]];
|
||||
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#import "DBResourceListTableViewController.h"
|
||||
#import "DBManagedObjectCache.h"
|
||||
#import "DBUser.h"
|
||||
#import "DBContentObject.h"
|
||||
|
||||
@implementation UINavigationBar (CustomImage)
|
||||
|
||||
@@ -62,7 +63,7 @@
|
||||
// or the object graph is manipulated
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(invalidateModel) name:DBUserDidLoginNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(invalidateModel) name:DBUserDidLogoutNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(invalidateModel) name:kObjectCreatedUpdatedOrDestroyedNotificationName object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(invalidateModel) name:DBContentObjectDidChangeNotification object:nil];
|
||||
}
|
||||
|
||||
- (void)viewDidUnload {
|
||||
|
||||
@@ -92,12 +92,9 @@
|
||||
#pragma mark RKObjectLoaderDelegate methods
|
||||
|
||||
- (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects:(NSArray*)objects {
|
||||
NSLog(@"Loaded Objects: %@", objects);
|
||||
NSLog(@"Status Code: %d", objectLoader.response.statusCode);
|
||||
// Post notification telling view controllers to reload.
|
||||
// TODO: Generalize this notification
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kObjectCreatedUpdatedOrDestroyedNotificationName object:objects];
|
||||
// dismiss.
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:DBContentObjectDidChangeNotification object:[objects lastObject]];
|
||||
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user