[Mysql-cocoa-users] SMySQL-Xcode example?
Brought to you by:
sergecohen
From: John M. <joh...@ad...> - 2005-02-23 22:49:59
|
I didn't get any responses from the previous post, so I'll assume that I was asking too much. Alternatively, could someone be so kind as to point me to an XCode example project that uses the SMySQL Framework to bridge a MySQL table and a visual representation of that table? I just need to get an idea of how the methods of the framework are utilized in .h and .m files. Thanks, John Previous Post: I am trying to integrate some Obj-C into my XCode app, which is currently exclusively written in Applescript. I use a MySQL database to supply the app with data for outlines and tables. With applescript I use the following to return a matrix of database entries: set theData to do shell script "/usr/local/mysql/bin/mysql -h localhost -u theUser -pthePassword -D 'theDatabase' -N -e \"SELECT columnOne, columnTwo, columnThree FROM theTable WHERE columnFour = '"&aVariable&"'\"" I then use applescript's text item delimiters to convert the matrix into a list of lists. Could someone give me an idea where to start, using the SMySQL framework, in issuing the same query in Obj-C? Some questions: 1. I am not sure I understand which header file(s) I need to #import at the top of my populateOutline.m file, if any? 2. Do I need to be using methods in the "MCPConnection.m" file to first connect to the database, or is that taken care of some other way? If "yes", then do I call that/those method(s) each time I issue a query? 3. How do I know if the matrix I am returning is an NSDictionary or NSArray...and how do choose the proper method out of the plethora in "MPCFastQueries.m" and "MPCResult.m" that will return the same list of lists as in the applescript example? I know there is a lot I am asking here, but if I could get guidance on these issues then I will be able to use deductive reasoning to solve the rest of my issues in the future... Thanks! -John Mistler |