开发者

Cocoa Data Abstraction Xcode 4

What is the best way to abstract out data access within a Mac/iPhone application using sqlite and Xcode 4?

I am traditionally a .NET/SQL Server developer so set about creating 开发者_运维问答what was familiar to myself which was to:

  • Created a xCode Workspace and added in two projects.
  • The first project was my Mac OS X Cocoa Application.
  • The second was a Cocoa Library which will hold all the common data access logic (a bit like a Data Access Layer).

However I cannot seem to find best practice on this issue as a lot of the examples on the web have all the data access logic within classes in the app. I would like to separate my data access code so that it abstracts awy my data access in my Mac application and has the ability to be used by other projects in the workspace if required.

Many thanks.


I think you're looking for Core Data. It's built into OS X and iOS and handles pretty much all of your data management, from automatic undo support to building a SQLite model of your data and saving it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜