Design Pattern
Subject : Design Pattern
From: Kevin Bracey <email@hidden >
Date: Thu, 29 Mar 2007 21:20:16 +1200
Delivered-to: email@hidden
Delivered-to: email@hidden
Hi All,
I'm wanting to implement a global singular object and I'm wondering
if this is the best way to do it? I haven't used the + thing and I'm
not sure if this has any benefit over just calling [[NSApp delegate]
sharedStatus] directly.
+( UWApplicationStatus *)sharedStatus;
{
if( [[NSApp delegate] sharedStatus] == nil )
{
UWApplicationStatus *holdMe;
holdMe = [[UWApplicationStatus alloc] init];
[[NSApp delegate] setSharedStatus:holdMe];
}
return [[NSApp delegate] sharedStatus];
}
Cheers
Kevin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.