Re: Application Design

2011-06-01 Thread Dan Hopwood
Thanks Steve. For completeness - what's the proper way to perform the cleanup? Should another static method be created that releases the singleton instance when the app is closed? i.e. + (void)releaseSharedInterface { [sharedInstance release]; sharedInsance = nil; } D On 1 June

Re: Application Design

2011-06-01 Thread Steve Christensen
Why do you need to do any explicit cleanup on app termination? App memory disappears (poof!) so it's not like you're leaking anything. Is your class holding onto some state that must be written out to disk, for example? On Jun 1, 2011, at 3:54 AM, Dan Hopwood wrote: Thanks Steve. For

Re: Application Design

2011-06-01 Thread Andrew Thompson
I'll caution you as written that singleton is not be thread safe. Often you don't care, because you only have one thread or because creating 2 webservice clients may not be a problem for you. On Jun 1, 2011, at 3:54 AM, Dan Hopwood d...@biasdevelopment.com wrote: Thanks Steve. For

Re: Application Design

2011-06-01 Thread Steve Christensen
Yep, that's true. I was going for the simple case since, unless you specifically plan to reference the singleton from multiple threads, you don't need to do anything more fancy. On Jun 1, 2011, at 5:05 PM, Andrew Thompson wrote: I'll caution you as written that singleton is not be thread

Re: Application Design

2011-05-31 Thread Dan Hopwood
Thanks for all your answers, they make complete sense. I have one more related question. I have developed a custom, stateful WebServiceInterface object, which manages all connection requests made to an XML-RPC server. Being stateful, I initialise this object when the app launches and at the

Re: Application Design

2011-05-31 Thread Steve Christensen
How about providing a singleton class method? Then you just include WebServiceInterface.h where needed. No need to have a global variable. @implementation WebServiceInterface ... + (WebServiceInterface*) sharedInterface { static WebServiceInterface* sharedInstance = nil; if

Re: Application Design

2011-05-28 Thread Dan Hopwood
Thanks for your response Steve. I have considered using the nsnotification service but what if you need to not only let another object know when an event has occurred but you also need to send that object some data? For example a user selects an option in a table - the selection must be conveyed

Re: Application Design

2011-05-28 Thread Conrad Shultz
On May 28, 2011, at 6:11, Dan Hopwood d...@biasdevelopment.com wrote: Thanks for your response Steve. I have considered using the nsnotification service but what if you need to not only let another object know when an event has occurred but you also need to send that object some data? For

Re: Application Design

2011-05-27 Thread Steve Christensen
A view controller controls a specific view hierarchy so it shouldn't be reaching explicitly out to other view controllers to tell them to do something. Depending on your specific situation, interested objects could register for notifications when certain things change in the world, then one

Re: Application Design Question

2009-09-04 Thread Jens Alfke
On Sep 4, 2009, at 4:55 PM, Marek Kozubal wrote: Another question related to this is what API set provides the fastest disk IO under Mac OS X? On the windows side I used FILE_FLAG_NO_BUFFERING and FILE_FLAG_WRITE_THROUGH flags with the ReadFile/WriteFile API. The fastest will be the