ios - How is loading from a remote database typically managed? (conceptually) -
i'm making app, , each view loads differently remote database, each view going have own query. best way manage database access in app?
my possible solution:
- i'm wondering if idea create separate nsobject file functions data controller stored , loaded database. theoretically, have bunch of functions take data database , store arrays. way, of database access code in 1 file, call these functions in files needed.
is standard approach? there better / more trivial / more robust approach? i'm looking best way keep code clean, clear, , easy update in future.
thanks suggestions!
i've done using separate class downloading, not store data. class defines delegate protocol sending data caller. create instance of class in controller needs download something, , have set delegate of download class. have 1 method in class pass in url, , in call methods (i used nsurlconnection), call delegate method passes raw data (or error object) each class can manipulate data in own way.
Comments
Post a Comment