Is there a pattern for creating an object with global scope?
Is there a pattern for creating an object with global scope?
- Subject: Is there a pattern for creating an object with global scope?
- From: YT <email@hidden>
- Date: Fri, 12 Apr 2013 18:30:17 -0700
Perhaps my approach is wrong. Looking for advise.
So I'd like to define a Class called Preference.
In main.m I'd like to create an object called myPreferences before the code line
return NSApplicationMain(argc, (const char**)); is run;
I assume the object myPreferences will persist the life of the program.
So how can I make the ID of myPreferences known to all objects in the program?
Is this even possible?
OK! So I'm trying to create an object with global scope so all other objects can get and put data in it.
AND OK! Its true I'm not yet a mature Objective-C programmer. Ya know one that doesn't know what I can't do.
YT
_______________________________________________
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