Re: iOS: Using AppDelegate as an app-wide singleton
Re: iOS: Using AppDelegate as an app-wide singleton
- Subject: Re: iOS: Using AppDelegate as an app-wide singleton
- From: Alex Zavatone <email@hidden>
- Date: Tue, 01 Dec 2015 16:32:17 -0500
I'm more of a fan of special case singletons, or else you essentially create one big global al over again.
Also, the AppDelegate class has certain responsibilities. For organizational purposes, I feel most comfortable in creating a singleton for the purpose of the task at hand.
On Dec 1, 2015, at 3:58 PM, Carl Hoefs wrote:
> 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
_______________________________________________
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