• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
iOS: Using AppDelegate as an app-wide singleton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

iOS: Using AppDelegate as an app-wide singleton


  • Subject: iOS: Using AppDelegate as an app-wide singleton
  • From: Carl Hoefs <email@hidden>
  • Date: Tue, 01 Dec 2015 13:58:17 -0700

I was about to implement my own singleton class to act as an app-wide context repository, but then I thought: wouldn't it be simpler just to use the appDelegate for that purpose? It's a singleton already and available to all classes via [[UIApplication sharedApplication] delegate]. All I need to do is add my @properties to it and I'm done.
Are there any drawbacks to this?
-Carl


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: iOS: Using AppDelegate as an app-wide singleton
      • From: Quincey Morris <email@hidden>
    • Re: iOS: Using AppDelegate as an app-wide singleton
      • From: Roland King <email@hidden>
    • Re: iOS: Using AppDelegate as an app-wide singleton
      • From: Alex Zavatone <email@hidden>
  • Prev by Date: Re: TableviewSelectionDidChange(_:) not called
  • Next by Date: Re: iOS: Using AppDelegate as an app-wide singleton
  • Previous by thread: Re: TableviewSelectionDidChange(_:) not called
  • Next by thread: Re: iOS: Using AppDelegate as an app-wide singleton
  • Index(es):
    • Date
    • Thread