Re: High Scores local to iPhone app

2009-05-05 Thread Bill Bumgarner

On May 5, 2009, at 11:18 AM, Eric E. Dolecki wrote:
I am looking to save and read name/score pairs and started looking  
at SQLite
to do this. I'm checking the Books sample application and there  
seems to be
tons of code in there to basically provide the solution. Is there a  
better

option than SQLite to do this in Obj-C (iPhone)?


How many pairs do you plan on storing?

If the answer is less than several hundred, just stick 'em in a  
property list or plain old text file and write it to the filesystem.


b.bum

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: High Scores local to iPhone app

2009-05-05 Thread Eric E. Dolecki
Probably only 10... however I understand that a plist can't store complex
data... how would this work for pairs? Normally I'd only be able to store
just a list of scores, not paired with names, correct?

On Tue, May 5, 2009 at 2:23 PM, Bill Bumgarner b...@mac.com wrote:

 On May 5, 2009, at 11:18 AM, Eric E. Dolecki wrote:

 I am looking to save and read name/score pairs and started looking at
 SQLite
 to do this. I'm checking the Books sample application and there seems to
 be
 tons of code in there to basically provide the solution. Is there a better
 option than SQLite to do this in Obj-C (iPhone)?


 How many pairs do you plan on storing?

 If the answer is less than several hundred, just stick 'em in a property
 list or plain old text file and write it to the filesystem.

 b.bum




-- 
http://ericd.net
Interactive design and development
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: High Scores local to iPhone app

2009-05-05 Thread Randall Meadows

On May 5, 2009, at 12:50 PM, Eric E. Dolecki wrote:

Probably only 10... however I understand that a plist can't store  
complex
data... how would this work for pairs? Normally I'd only be able to  
store

just a list of scores, not paired with names, correct?


Wrong.  A plist can contain an NSDictionary, which would contain your  
names and scores as key/value pairs.  It even has a -writeToFile:...  
method.  Easy peasy.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: High Scores local to iPhone app

2009-05-05 Thread J. Roman

You could store it as an array of dictionaries or arrays, for example.

On 5-May-09, at 2:50 PM, Eric E. Dolecki wrote:

Probably only 10... however I understand that a plist can't store  
complex
data... how would this work for pairs? Normally I'd only be able to  
store

just a list of scores, not paired with names, correct?

On Tue, May 5, 2009 at 2:23 PM, Bill Bumgarner b...@mac.com wrote:


On May 5, 2009, at 11:18 AM, Eric E. Dolecki wrote:

I am looking to save and read name/score pairs and started looking  
at

SQLite
to do this. I'm checking the Books sample application and there  
seems to

be
tons of code in there to basically provide the solution. Is there  
a better

option than SQLite to do this in Obj-C (iPhone)?



How many pairs do you plan on storing?

If the answer is less than several hundred, just stick 'em in a  
property

list or plain old text file and write it to the filesystem.

b.bum





--
http://ericd.net
Interactive design and development
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/jroman%40melroman.net

This email sent to jro...@melroman.net


--
Anonymous

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: High Scores local to iPhone app

2009-05-05 Thread Peter Blazejewicz

hi Eric,

On May 5, 2009, at 8:23 PM, Bill Bumgarner wrote:


On May 5, 2009, at 11:18 AM, Eric E. Dolecki wrote:
I am looking to save and read name/score pairs and started looking  
at SQLite
to do this. I'm checking the Books sample application and there  
seems to be
tons of code in there to basically provide the solution. Is there a  
better

option than SQLite to do this in Obj-C (iPhone)?


How many pairs do you plan on storing?

If the answer is less than several hundred, just stick 'em in a  
property list or plain old text file and write it to the filesystem.


b.bum

this will work (plist file - also mentioned in other advice as  
dictionaries/arrays) as storing from ActionScript to SharedObject  
(without serialization, key/values are OK). Bill advice is fine and  
easy to implement. For future implementation you could look into SDK  
3.0 and CoreData concepts - as I assume you're targeting iPhone SDK as  
well,


regards,
Peter Blazejewicz
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: High Scores local to iPhone app

2009-05-05 Thread Bill Bumgarner

On May 5, 2009, at 11:50 AM, Eric E. Dolecki wrote:
Probably only 10... however I understand that a plist can't store  
complex data... how would this work for pairs? Normally I'd only be  
able to store just a list of scores, not paired with names, correct?


A property list is composed of a relatively arbitrary collection of  
NSArray, NSString, NSDate, NSNumber, and NSString instances arranged  
pretty much however you like.So, name/score pairs are trivial to  
represent.   Of course, if you use names as key, you can only have one  
score per name unless you, say, hang an array off the dictionary as a  
value.


Or you could create a simple class that holds your name/score tables  
however it wants to


@interface MyScoreTable : NSObject NSCoding
{
NSMutableArray *names;
NSMutableArray *scores;
}
...
@end

And then implement the NSCoding methods to read/write archived  
versions of the names/scores.


Or you could just shove 'em all in a string:

Bob\t100\n
Fred\t120\n
Bob\t90\n
Joe\t220\n
bbum\t142\n

And then parse that w/a bit of componentsSeparatedByString:  
hackery.   Not exactly efficient, but for only 10 items, it really  
matters not.


b.bum
(Who is terribly good at games, as you can see from my masterful score  
above)

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com