问题
in my app i got a TTLauncher Object with some TTLauncherItems in it. Now i want to add some Items dynamically inside my App by pressing a button.
Is there a simple way to do that or do i have to create my own methods? In the original facebook application there is already something like that implemented. (You can add your Friends to the Launcher)
If not, what would be the best thing to do something like that? Store all "extra items" in a plist oder even in a database and query them, each time TTLauncher object is initialized?
Thanks for help :)
回答1:
so i finally used a simple plist to store my items. every time my items get new arranged or an item gets added, i update my plist with this new data. when the view gets initialised, i building all this items out of my plist.
a better way would be to store it in a database i think, but for me, a plist is enough.
回答2:
I have ran out in the same issue as I told you earlier: so
- You store your additional icons in a table.
on LoadView()
you try to use a dynamic array like this:
_launcherView.pages = [NSArray arrayWithObjects: dynamicArr1];
Where your dynamic Array is filled like this:
caching of images of each icon here:
http://groups.google.com/group/three20/msg/66ec114401af3b06
[dynamicArr1 insertObject:[[[TTLauncherItem alloc] initWithTitle:name
image:name
URL:url canDelete:YES] autorelease] atIndex:i];
Let me know if that's what you were looking for.
来源:https://stackoverflow.com/questions/2681361/dynamically-add-items-to-ttlauncher