I think you probably want to use the singleton design pattern rather than that global variable.

Devon.

Nathaniel Gottlieb-Graham wrote:
I am trying to implement a global variable that's an NSMutableDictionary. Up until now I've achieved this by making globalVariables.h and .m files to hold globals that are imported by all my classes. globalVariables defines externs, and I already have two extern NSStrings set up and working. But as soon as I try to create an extern variable here that's *not* and NSString, the compiler errors with "Initializer element is not constant". What does this mean?

Why do externs seem to have to be NSStrings? Also, is this even the right way to go about having a read/write global NSMutableDictionary? If not, how would I do this?

Thanks!
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/dferns%40devonferns.com

This email sent to [EMAIL PROTECTED]
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to