iphonethree20ttlauncherview

Three20 - add items to launcherView after viewDidLoad


I am getting a list of image URLs and corresponding names at run time in my app. I would like to add these images to a TTLauncherView object that I have.

Cannot add these in loadView. I am making a call to the method for getting my data in a separate thread. Once the thread completes, I add the TTLauncherItem objects to an array and set the "pages" variable of the LauncherView.

But for some reason, the view is not updated and I don't see anything on it.

Can someone please let me know how to refresh the launcherview after adding items to it in methods other than loadView?

Thanks.


Solution

  • I use the following snippet to add an item to the launcherView after load.

    TTLauncherItem *item = [[TTLauncherItem alloc] initWithTitle:@"NEW ITEM NAME"
                                                           image:@"NEW_ITEM_IMAGE_URL"
                                                             URL:@"NEW_ITEM_ACTION_URL"
                                                       canDelete:YES];
    [_launcherView endEditing];
    //add the item after ending editing to show the close x.
    [_launcherView addItem:item animated:YES];