Reputation: 8493
I am using a TTThumbsViewController
to display a gallery. Users can upload photos to a server and when the upload is complete I post a notification which I receive further up the navigation stack at the TTThumbViewController
where I want to reload the gallery so that when the user navigates back the gallery includes their newly added photo.
I call the following in my TTThumbsViewController
subclass when I receive the notification:
[self invalidateModel];
[self reload];
This results in a message of "Loading" with a spinner but it stays stuck there. Hoping someone can nudge me in the right direction. Thank you!
Other things I've tried:
[self invalidateModel];
or
[self invalidateModel];
[self reload];
[self updateView];
or
[self invalidateModel];
[self reloadIfNeeded];
I've reviewed this SO question and tried the approach:
refresh TTThumbsViewController on a buttonClick in Three20
Upvotes: 1
Views: 676
Reputation: 510
Use the Following code
- (void)createModel {
[self setPhotoSourceToView];
}
NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setPhotoSourceToView) name:NOTIF_UPDATES object:nil];
- (void)setPhotoSourceToView {
if (!doPhotoSource) {
//call to datasource
XXXPhotoSource=[[XXXThumbnailPhotoSource alloc]initWithURL:urlForDo ];
}
self.photoSource = XXXPhotoSource;
}
}
This works fine
Upvotes: 1