Question

i am using a TTTableViewController (three20 framework) for displaying user profile data (username, user image, etc.).

The tableview datasource is set up as follows:

_profileImageItem = [TTTableImageItem itemWithText:@"Change Profile Image" imageURL:DEFAULT_PROFILE_IMG URL:@"tt://photoThumbs"];
self.dataSource = [TTSectionedDataSource dataSourceWithObjects:
        @"Profile Image",
        _profileImageItem,  
        @"Profile Name",
        _profileName,
        ...,
        ...];

When the user tabs the _profileImageItem, a UIImagePicker view is presented where the user can select a new image. After that i scale the image down and write it to the apps document folder.

My problem now is: How can i update the image URL in the datasource? Currently it still points to DEFAULT_PROFILE_IMG. Even when i update the _profileImageItem member using:

[_profileImageItem setImageURL:@"new URL here"];

the old image is shown. I have tried refreshing the view - same problem.

Any help is much appreciated.

Was it helpful?

Solution

Ok i made a stupid mistake.

TTURLCache was enabled and i updated only the image, not the path (i.e. i have overwritten the profile image). As the path is used as a key in the TTURLCache, the cache returned the cached image ;)

[[TTURLCache sharedCache] setDisableImageCache:YES];

solves the issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top