简体   繁体   中英

How to store/retrieve data in OS X applications?

I am starting to develop my first Mac OS X application using Xcode. My background is LAMP, so I typically store everything in a MySQL database. What's the correspondent in OS X?

My application will simply allow the user to enter new data, and then to retrieve it based on filters.

I am not looking for specific code, but for some pointers as to how storing data into databases work in OS X. I have found very little resource on this subject.

SQLite is used in many situations where a database server isn't required. Apple uses it for things like their Mail app. You can use some of the built-ins of Xcode (like sqlite.h) or a command-line shim of some kind. Other variants of SQL will require a separate download.

Core Data uses an object model which may be more convenient in a storage sense, though it has a moderate footprint and learning curve, and it's not cross-platform. Which may be important for the data migration that's common with database work.

If you're just starting with desktop programming from a LAMP background, you could look into "wrapper" apps that let you package LAMP software on the desktop with a native GUI. Might be easier than going Objective-C from scratch since it's one of the more obtuse languages out there. Xojo is also nice if you're used to VisualBasic and need to do cross-platform work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM