Nick
Nick

Reputation: 8493

Three20 - Attempt to Refresh TTThumbsViewController stays stuck on "Loading..."

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

Answers (2)

Tim
Tim

Reputation: 343

I just did this and it worked fine for me.

[self reload];

Upvotes: 0

Rahul Chavan
Rahul Chavan

Reputation: 510

Use the Following code

creating model

- (void)createModel {


    [self setPhotoSourceToView];

}

Setting the NSNotification

NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setPhotoSourceToView) name:NOTIF_UPDATES object:nil]; 

setPhotoSourceToView Function

- (void)setPhotoSourceToView {
       if (!doPhotoSource) {
                //call to datasource
                XXXPhotoSource=[[XXXThumbnailPhotoSource alloc]initWithURL:urlForDo ];

                }
            self.photoSource = XXXPhotoSource;

        }
}

This works fine

Upvotes: 1

Related Questions