After adding TTLauncherItem into TTLauncherView, I want to change the image for the added TTLauncherItem。
But when I changed the value of image, it was not working. There is no change on the view.
How can I refresh image of TTLauncherItem immediately?
Thanks advanced~~~~
the init method is,
for (int i = 0; i < pages; i++) {
NSMutableArray* pageArray = [NSMutableArray array];
for (int j = 0; j<pageCount && (j+i*pageCount)<[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];
/////////The following lines change.
TTLauncherItem *testItem = [[pagesArray objectAtIndex:0] objectAtIndex:0];
testItem.image = @"bundle://defaultMusic2.png";
/////////////
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:
- (void)launcherView:(TTLauncherView*)launcher didSelectItem:(TTLauncherItem*)item {
TTLauncherItem *testItem = [[_launcherView.pages objectAtIndex:0] objectAtIndex:4];
testItem.image = @"bundle://defaultMusic2.png";
}
just work it out.
save the pages firstly, and then make your amending, then restore back.
Good Luck!