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

Application Design

2011-05-27 Thread Dan Hopwood
Hi all, I have been writing iPhone applications for a while now, with not too many problems but I feel like I haven't fully grasped how an application should be structured in terms of storing application objects. e.g. up to now, I've created a header file, declared all the main objects e.g. app

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

Application Design Question

2009-09-04 Thread Marek Kozubal
Hello everyone. I have a DVR (digital video recorder) program I wrote in Windows that I want to re-write on the Mac. And I wanted to get some ideas about how best to use Cocoa objects to make this program work as I'm still relatively new to Cocoa programming. The application has 2 modes,

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

Re: Questions on An NSOpenGL Application Design

2008-09-30 Thread Matt Long
Carmen, I don't know anything about reading pixels back from VRAM and this CPU analysis you refer to. Why do you need to do that again? You might want to look into using Core Animation for what you are trying to do. For that matter, you could very easily create a simple Quartz

Questions on An NSOpenGL Application Design

2008-09-29 Thread Carmen Cerino Jr.
When my application starts up, the user is presented with a settings window. It contains a view that will be attached to a web camera, and some widgets to control various filter settings. Once the settings are tweaked to the user's desire, the window will be closed, but the camera will