1

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 seniours 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,,,,

Chatar Veer Suthar
  • 15,541
  • 26
  • 90
  • 154
  • Dont duplicate questions man ..http://stackoverflow.com/questions/5155437/is-it-good-practice-to-use-appdelegate-for-data-manipulation-and-handling/5155525#5155525 – ipraba Mar 02 '11 at 14:08
  • @BuildSucceeded, sorry, but now I changed my logic of handling, so I shared and asked it again,,,, – Chatar Veer Suthar Mar 02 '11 at 14:12

2 Answers2

1

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

Thomas Zoechling
  • 34,177
  • 3
  • 81
  • 112
1

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.

Toastor
  • 8,980
  • 4
  • 50
  • 82