开发者

what is best approach of accessing data around all classes and handling it in iphone programming?

I developed an application for iphone, and made all my setters and getter, and handled sqlite3 database (select, insert, delete, update) in AppDelegate.m

I made AppDelegate Object and used all around my application, I felt that my application started to give strange errors, and heaviness, crash.

then I made another class as DataManagement, then I used it and rotate objects, now there is no error, nothing like crash,,,,

I want to know from you s开发者_如何学运维eniours that what is best way to handle getters and setters and database in iphone programming?

any other good way, so that application became now too much heavy at all,,,,


Reading about the Model-View-Controller pattern is a good starting point when learning about application design.
Apple provides a really good document in it's "Cocoa Core Competencies" series: http://developer.apple.com/library/ios/#documentation/general/conceptual/DevPedia-CocoaCore/MVC.html

A general MVC description can be found in Wikipedia:
http://en.wikipedia.org/wiki/Model–view–controller


I'm sorry for being a bit harsh here, but it appears like you've not yet understood the basic concept of object oriented programming, if initially you tried to implement a whole application within your application delegate.

I don't think that telling you how to create accessors or how to use Core Data (I believe this is what you meant) will help you unless you've spend some time reading through some of the basics (although accessors are a part of the basic stuff).

As a start, I'd like to recommend reading this Guide about the Objective-C language and going through some basic tutorials and example projects.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜