Discuss Loading in Objects from database at the iPhone Developer Exchange - Hackint0sh.org; I have a bunch of object I need to load in as my program opens ...
-
Loading in Objects from database
I have a bunch of object I need to load in as my program opens and am currently using the method from the sqlitebooks example. But it doesn't seem to expand very gracefully as I have needed to add more object types.
I guess I’m trying to work out where this initalising code should go?
Connect to database, extract list of keys for each XX object, loop through keys and tell XX class to create new instance of XX object for each key, add object into my objectarray
(repeated for 4 different object types)
Should I be using a class method in for each of the object types? ‘+ (NSArray *)loadAndCreateObjects’ or something?
Like myBookArray = [Book loadAndCreateObjects];
Or do I need another class to do the work - ‘ObjectCreator’?
ObjectCreator *objectCreator = [[ObjectCreator alloc] init];
[objectCreator loadObjects];
Hope that makes sense?
-
Similar Threads
-
By hackint0sh in forum Latest Headlines
Replies: 0
Last Post: 10-29-2009, 06:10 PM
-
By hackint0sh in forum Latest Headlines
Replies: 0
Last Post: 06-29-2009, 02:00 AM
-
By hackint0sh in forum Latest Headlines
Replies: 0
Last Post: 03-13-2009, 10:00 PM
-
By Scubaa in forum iPhone Developer Exchange
Replies: 1
Last Post: 08-08-2008, 11:47 AM
-
By x98car in forum General
Replies: 3
Last Post: 04-30-2008, 02:05 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks