Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

qwerty2k

macrumors regular
Original poster
Dec 27, 2007
157
5
Right, so im new to Mac programming (including objective-c), im creating a program to track my poker stats form pokerstars, ive got the text parsing from the hand histories working fairly well so far. However i want to store all the data in a database for faster access/manipulation/storage, anyone recommend/point me in the direction of a database system (postgresql, mysql etc) that i can use to create a database and connected locally via my program and use.

thanks in advanced,

Scott
 

iShater

macrumors 604
Aug 13, 2002
7,027
470
Chicagoland
I personally use mySQL on my system. CocoaMySQL (not sure of the name) as the GUI client to configure the tables.

I however use JDBC, so no idea about obj-c.
 

ChrisA

macrumors G5
Jan 5, 2006
12,918
2,170
Redondo Beach, California
Right, so im new to Mac programming (including objective-c), im creating a program to track my poker stats form pokerstars, ive got the text parsing from the hand histories working fairly well so far. However i want to store all the data in a database

I think what you want is Apple's "Core Data". It's made for exactly the purpose you need. You can have Core Data put your data in a SQLite database

A multi-user client/server RDBMS like Postgresqlor even mySQL is overkill and not as fast.

Here are some pointers
http://en.wikipedia.org/wiki/Core_Data
http://developer.apple.com/macosx/coredata.html
 

qwerty2k

macrumors regular
Original poster
Dec 27, 2007
157
5
I think what you want is Apple's "Core Data". It's made for exactly the purpose you need. You can have Core Data put your data in a SQLite database

A multi-user client/server RDBMS like Postgresqlor even mySQL is overkill and not as fast.

Here are some pointers
http://en.wikipedia.org/wiki/Core_Data
http://developer.apple.com/macosx/coredata.html

Had a look at core data, from what i can see, all the documentation shows how to make the app through the data modeling portion of xcode....which is fine, but i can't seem to find any documentation on how to actually communicate with the coredata objects i have created via the xcode gui app, for example i have modelled how my data will look, but i want to in my main.m load data from an external .txt file, parse it and then insert bits of it into the coredata database.
 

mongrol

macrumors regular
Jul 16, 2007
232
0
Core data is not for those new to Cocoa programming. It can take a while to get your head around as it involves other technologies as well (Bindings for one). The programming guide though, has all the info needed to use it.

http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/cdProgrammingGuide.html

Basically, you "fetch" data objects from the managedObjectContext (that connects to the store) which returns an array of NSManagedObjects. You then operate on them as if its an array of NSDictionary objects.
 

qwerty2k

macrumors regular
Original poster
Dec 27, 2007
157
5
i do appologise in advanced for being 'thick', i have read over the links you provided however they don't seem to offer a solution from what i can gleam for what i want to do (which seems 'simple' in principle).

I want to model all my data in the model editor within xCode, i then want in my main.m to be able to access the core data store and add 'records' to the core data store via code, for example: [coredata add: playerName, profit]; and then to be able to retrieve the data again, now i know its done with setValueKey and valueKey, however im not sure how to initially connect to my datastore, lookup the player onject and then query that object for the specific piece of information.
 

mongrol

macrumors regular
Jul 16, 2007
232
0
If you're going to make a GUI then you're not going to put anything in main.m. If you're making a command line utility then you'll want to read this tutorial. It tells you all you need to connect to a store, pull objects and modify them using code. You'll still need to reference the main docs though. I know what you want seems simple but to do it using Core Data you need to read and understand the ManagedObject model stuff. I'm sure there's a way of doing standard SQLite stuff but I don't know it. I'm a developing n00b myself.

http://developer.apple.com/document...rial/00_Introduction/chapter_1_section_1.html
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.