Re: NSArray as a class variable
Re: NSArray as a class variable
- Subject: Re: NSArray as a class variable
- From: "Stephen J. Butler" <email@hidden>
- Date: Sat, 26 Dec 2009 01:15:55 -0600
On Fri, Dec 25, 2009 at 10:52 PM, Michael Craig <email@hidden> wrote:
> #import <Cocoa/Cocoa.h>
>
> static NSArray *suitArray;
I doubt you really mean this. When you put this in your header file,
every file that includes "Card.h" has its own, separate copy of
suitArray. If you want to export a shared global into every file, then
Card.h should have:
extern NSArray *suitArray;
and Card.m:
NSArray *suitArray;
If you only want one copy, only visible from your implementation file,
then put this in Card.m:
static NSArray *suitArray;
_______________________________________________
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