• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ObjC static member variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ObjC static member variable


  • Subject: Re: ObjC static member variable
  • From: Michael Vannorsdel <email@hidden>
  • Date: Thu, 10 Apr 2008 13:39:16 -0600

You'll need to move the declaration outside the interface. You can stick it in the .m file for that class like you can with C/C++.


On Apr 10, 2008, at 1:29 PM, vance wrote:

Does ObjC supports Static Member Variable, and if so, how do you set it?

The getter function gets a compile time error. In C++ we do MyObject::staticObject to return the static member variable but I am not sure how is that done in ObjC

Ex:

@interface MyObject : NSObject {
	static BaseObject *staticObject;
}

- (BaseObject *)staticObject
{
	return staticObject;
}

_______________________________________________

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


References: 
 >ObjC static member variable (From: vance <email@hidden>)

  • Prev by Date: Re: ObjC static member variable
  • Next by Date: Re: Tight loop processing
  • Previous by thread: Re: ObjC static member variable
  • Next by thread: NSArrayController and managedObjectContext Problem
  • Index(es):
    • Date
    • Thread