remove pointless warning now that editor is disabled during save

This commit is contained in:
Sami Samhuri 2015-05-03 17:29:48 -07:00
parent 2f92db3d73
commit 41f939ef97
3 changed files with 10 additions and 8 deletions

View file

@ -74,9 +74,6 @@
#pragma mark - Managing the detail item
- (void)configureWithPost:(Post *)post {
if (self.modifiedPost && ![self.modifiedPost isEqualToPost:self.post]) {
NSLog(@"WARNING: clobbering unsaved changes to %@", self.modifiedPost);
}
if (![post isEqual:self.post]) {
self.post = post;
self.modifiedPost = post;

View file

@ -29,6 +29,7 @@
- (instancetype)copyWithBody:(NSString *)body;
- (instancetype)copyWithTitle:(NSString *)title;
- (instancetype)copyWithURL:(NSURL *)url;
- (instancetype)copyWithNew:(BOOL)isNew;
- (BOOL)isEqualToPost:(Post *)other;
@end

View file

@ -63,18 +63,22 @@
}
- (instancetype)copyWithBody:(NSString *)body {
return [self copyWithTitle:self.title body:body url:self.url];
return [self copyWithTitle:self.title body:body url:self.url new:self.new];
}
- (instancetype)copyWithTitle:(NSString *)title {
return [self copyWithTitle:title body:self.body url:self.url];
return [self copyWithTitle:title body:self.body url:self.url new:self.new];
}
- (instancetype)copyWithURL:(NSURL *)url {
return [self copyWithTitle:self.title body:self.body url:url];
return [self copyWithTitle:self.title body:self.body url:url new:self.new];
}
- (instancetype)copyWithTitle:(NSString *)title body:(NSString *)body url:(NSURL *)url {
- (instancetype)copyWithNew:(BOOL)isNew {
return [self copyWithTitle:self.title body:self.body url:self.url new:isNew];
}
- (instancetype)copyWithTitle:(NSString *)title body:(NSString *)body url:(NSURL *)url new:(BOOL)isNew {
return [[Post alloc] initWithDictionary:@{
@"objectID" : self.objectID ?: [NSNull null],
@"slug" : self.slug ?: [NSNull null],
@ -85,7 +89,7 @@
@"path" : self.path ?: [NSNull null],
@"url" : url ?: [NSNull null],
@"draft" : @(self.draft),
@"new" : @(self.new),
@"new" : @(isNew),
} error:nil];
}