Search code examples
iphonethree20launcheritems

Three20 Launcher adding items help? - iPhone SDK


I am using the three20 launcher to get a homescreen feel in my app. I just implemented the basic launcher. I have two things that I want to accomplish.

First off, I would like the user to push a UIButton or whatever in a DIFFERENT view controller that the TTViewController and an item be added in the launcher, how would I do this?

Secondly I would like to know how you could do a view where the user could add all the information to add their own item in the launcher? This isn't as necessary as the first thing.

I would really like to know some of this and deepen my knowledge in the three20 launcher.


Solution

  • Just setup a way for your view controller to talk to the launcher, either by delegation, notifications or whatever you want, then add the item like this:

    TTLauncherItem *item = [[TTLauncherItem alloc] initWithTitle:@"title"
                                                           image:@"http://imageURL"
                                                             URL:@"http://URL"
                                                       canDelete:YES];  
    [_launcherView addItem:item animated:YES];
    [item release];