Audited all code in the app and produced extensive TODO list. Fixed build problems when on the Release profile.

This commit is contained in:
Blake Watters
2011-01-17 22:03:31 -05:00
parent c9c0a82475
commit a538bbca2f
22 changed files with 309 additions and 111 deletions

View File

@@ -20,10 +20,11 @@
}
- (void)dealloc {
[_topic release];
TT_RELEASE_SAFELY(_topic);
[super dealloc];
}
// TODO: Move this into the model...
- (BOOL)isNewRecord {
return [[_topic topicID] intValue] == 0;
}
@@ -67,6 +68,8 @@
self.dataSource = [TTListDataSource dataSourceWithItems:items];
}
#pragma mark Actions
- (void)createButtonWasPressed:(id)sender {
_topic.name = _topicNameField.text;
[[RKObjectManager sharedManager] postObject:_topic delegate:self];
@@ -81,16 +84,20 @@
[[RKObjectManager sharedManager] deleteObject:_topic delegate:self];
}
#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.
[self.navigationController popViewControllerAnimated:YES];
}
- (void)objectLoader:(RKObjectLoader*)objectLoader didFailWithError:(NSError*)error {
// TODO: TTAlert or create a DBErrorAlert helper?
[[[[UIAlertView alloc] initWithTitle:@"Error" message:[error localizedDescription] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] autorelease] show];
}