• 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
Class variable?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Class variable?


  • Subject: Class variable?
  • From: Randall Meadows <email@hidden>
  • Date: Fri, 6 Feb 2004 15:52:48 -0500

[Man, I hope this isn't a stoopit question...]

Is there a way in Cocoa to define a class variable that is shared among all instances of that class, analogous to a +method? How?

What I want to do is basically create a class that doles out instances of a Carbon structure, and include retain/release capability using reference counting. I was thinking of keeping a NSDictionary of the structures I create, using the address as the key, and another NSDictionary for the counts, similarly keyed.

Am I re-inventing the wheel? Am I just too ignorant about Cocoa to know how to do this with a simple NSObject subclass?


[PS-What are the feelings about cross-posting to cocoa-dev and macosx-dev? I'm new to both, so I don't have a feel for any "turf war" that might be going on...]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: Class variable?
      • From: Glen Low <email@hidden>
    • Re: Class variable?
      • From: John Randolph <email@hidden>
    • Re: Class variable?
      • From: "Erik D. Holley" <email@hidden>
  • Prev by Date: Re: Always send shouldChangeTextInRange:... ?
  • Next by Date: Re: Are we still supposed to register Creator code (bundle signature) for OS X app?
  • Previous by thread: Re: Always send shouldChangeTextInRange:... ?
  • Next by thread: Re: Class variable?
  • Index(es):
    • Date
    • Thread