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:
Blake Watters
2011-01-20 21:15:40 -05:00
parent ebd23559bb
commit 35df41ec25
10 changed files with 44 additions and 27 deletions

View File

@@ -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];
}

View File

@@ -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 {

View File

@@ -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];
}