Note that there are some explanatory texts on larger screens.

plurals
  1. POProblem of Three20: How to refresh TTLauncherItem /change the image
    text
    copied!<p>After adding TTLauncherItem into TTLauncherView, I want to change the image for the added TTLauncherItem。</p> <p>But when I changed the value of image, it was not working. There is no change on the view.</p> <p>How can I refresh image of TTLauncherItem immediately?</p> <p>Thanks advanced~~~~</p> <p>the init method is,</p> <pre><code> for (int i = 0; i &lt; pages; i++) { NSMutableArray* pageArray = [NSMutableArray array]; for (int j = 0; j&lt;pageCount &amp;&amp; (j+i*pageCount)&lt;[titleArray count]; j++) { [pageArray addObject:[[[TTLauncherItem alloc] initWithTitle:[titleArray objectAtIndex:(j+i*pageCount)] image:@"bundle://Icon.png" URL:@"tt://setUp" canDelete:NO] autorelease]]; } [pagesArray addObject:pageArray]; } _launcherView.pages = [NSArray arrayWithArray:pagesArray]; [self.view addSubview:_launcherView]; </code></pre> <p>/////////The following lines change.</p> <pre><code>TTLauncherItem *testItem = [[pagesArray objectAtIndex:0] objectAtIndex:0]; testItem.image = @"bundle://defaultMusic2.png"; </code></pre> <p>/////////////</p> <p>but if I move that to another methods such as my ImageDidLoad, then get the TTLauncherItem object, change the image of this, it does not work at all... or this:</p> <pre><code>- (void)launcherView:(TTLauncherView*)launcher didSelectItem:(TTLauncherItem*)item { TTLauncherItem *testItem = [[_launcherView.pages objectAtIndex:0] objectAtIndex:4]; testItem.image = @"bundle://defaultMusic2.png"; </code></pre> <p>}</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload