Re: 'Pseudo' Singleton in Objective C

2013-03-15 Thread Oliver Fuchs
Hi, Firstly, I'm assuming the more information button is the only location which triggers displaying/redisplaying. if thats the case I would just store the instance of your class in a property and make sure it will be created only once. You can accomplish this by simply overwriting the

Re: 'Pseudo' Singleton in Objective C

2013-03-15 Thread Pax
Thank you to everyone whose helped me with this problem. I now have the solution I needed, and (as usual) I've learned a whole lot that will be useful in the future. As always, this is an incredibly useful resource! On 15 Mar 2013, at 02:16, Seth Willits sli...@araelium.com wrote: On Mar

'Pseudo' Singleton in Objective C

2013-03-14 Thread Pax
I don't really know how to describe what I'm trying to do except as a 'Pseudo' Singleton. I have a class with an NSWindow, which displays information. It is run by selecting an NSMenuItem called 'More Information…' My issue is that I only want one instance of the Information class to be

Re: 'Pseudo' Singleton in Objective C

2013-03-14 Thread Jens Alfke
On Mar 14, 2013, at 11:22 AM, Pax 45rpmli...@googlemail.com wrote: My issue is that I only want one instance of the Information class to be loaded at a given time (and therefore only one information window on screen at a given time). If the information window is already loaded and it is

Re: 'Pseudo' Singleton in Objective C

2013-03-14 Thread Alex Zavatone
Matt Galloway's example is the one to run with IMO. http://www.galloway.me.uk/tutorials/singleton-classes/ You're pretty close though. Matt's examples and explanation should put you in the right direction. Any reason why you're not using ARC? ___

Re: 'Pseudo' Singleton in Objective C

2013-03-14 Thread Seth Willits
On Mar 14, 2013, at 11:22 AM, Pax wrote: I don't really know how to describe what I'm trying to do except as a 'Pseudo' Singleton. I have a class with an NSWindow, which displays information. It is run by selecting an NSMenuItem called 'More Information…' My issue is that I only want