Had the same problem. The TTPhotoSource needs to send modelDidFinishLoad: to its delegates when it has finished loading... otherwise, TTPhotoViewController assumes it's not ready yet.
That's not all, however. Especially when loading local images, your photo source will probably finish loading before the TTPhotoViewController is registered as a delegate. So, you need to check for delegates added to your TTPhotoSource and send them a modelDidFinishLoad: message if you're done loading when they're added.
And that's easier said than done if you inherit from TTModel, because there's no way to register with an NSMutableArray to find out when it's changed.
So... add the following code to your TTPhotoViewController subclass...
// superDelegates KVO Mutator Methods
- (NSMutableArray*)delegates {
return [self mutableArrayValueForKey:@"superDelegates"];
}
- (void)insertObject:(id)object inSuperDelegatesAtIndex:(NSUInteger)index {
[super.delegates insertObject:object atIndex:index];
if ([self isLoaded]) {
if ([object respondsToSelector:@selector(modelDidFinishLoad:)]) {
[object performSelector:@selector(modelDidFinishLoad:) withObject:self];
}
}
}
- (void)removeObjectFromSuperDelegatesAtIndex:(NSUInteger)index {
[super.delegates removeObjectAtIndex:index];
}
- (NSArray*) superDelegates {
return super.delegates;
}
This creates a "virtual" property named superDelegates, which is merely an NSArray, not an NSMutableArray. The insertObject:inSuperDelegatesAtIndex: and removeObjectFromSuperDelegatesAtIndex: methods, because their names include the name of the "superDelegates" property, allow the Key-Value Coding function (which you automatically have because it's an informal protocol) mutableArrayValueForKey: to synthesize a proxy object conforming to NSMutableArray, which allows edits to the superDelegates property by translating mutation operations into calls to the insertObject:inSuperDelegatesAtIndex: and removeObjectFromSuperDelegatesAtIndex: methods.
Then, all you have to do is override the "delegates" method to return such a generated proxy, and poof, all array changes run through you, allowing you to send off the proper load notification when the TTPhotoViewController attaches itself.