Added NSAssert statements to try and prevent accidental configuration of a Three20 model with an object loader that has already been sent.

This commit is contained in:
Blake Watters
2011-06-09 14:17:50 -04:00
parent 69ded29245
commit bc355d69fd

View File

@@ -58,7 +58,8 @@ static NSString* const kDefaultLoadedTimeKey = @"RKRequestTTModelDefaultLoadedTi
- (id)initWithObjectLoader:(RKObjectLoader*)objectLoader {
self = [self init];
if (self) {
// TODO: When allowing mutation of object loader, be sure to update...
NSAssert(_objectLoader.isLoading == NO, @"Cannot use an object loader that is being sent");
NSAssert(_objectLoader.isLoaded == NO, @"Cannot use an object loader that is already loaded");
_objectLoader = [objectLoader retain];
_objectLoader.delegate = self;
}