Daniel You are trying to create a singleton object in cocoa and there is a good documentation on this at: http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/chapter_3_section_10.html
-Shripada > > Thanks! Exactly what I was looking for. > > Daniel > > > Jonathan Hess wrote: > > Han Daniel - > > > > You can use a global variable just like you would in C: > > > > static Foo *bar = nil; > > > > @implementation Foo > > + (id)bar { > > if (!bar) { > > bar = [[Foo alloc] init]; > > } > > return bar; > > } > > @end > > > > > > Thats the simple single threaded case. Things get much more > > interesting if you want to be able to call 'bar' from multiple threads. > > > > Compiled in Mail - > > Jon Hess ----------------------------------------------- Robosoft Technologies - Come home to Technology Disclaimer: This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. Emails to and from our network may be logged and monitored. This email and its attachments are scanned for virus by our scanners and are believed to be safe. However, no warranty is given that this email is free of malicious content or virus. _______________________________________________ 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]