cocoa - Best way to share a resource inside an iPhone Application -


i kinda new objective-c , iphone development , have question. i'm creating app retrieved data internet using json-rpc. i've created json-rpc client performs requests , passes down results using delegate.

however need use client quite few times in application, have been thinking. best way share client resource? understanding (from i've read far @ least) have following options:

  1. instantiate seperate client on each of controllers need access remote data
  2. pass instantiated client down on each new controller instance
  3. add client appdelegate
  4. create singleton of client , use that
  5. use global variable

1,2 options seem waste of resources. i've been reading 3,5 not best way go. leaves 4. don't think can use singleton delegates. should switch nsnotification?

is there other way go about?

from understand, trying want connect server on internet multiple times download data? if should use nsurlconnection class , create nsurlconnection object each time request json data , implement delegate methods. nsurlconnection class in apple documentations further information.

cheers.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -