How do I unit test an object delegate?

2009-02-08 Thread Sean DeNigris
I'm unit testing a cocoa app in xcode by injecting a test bundle into the executable, so the unit tests get run at the end of every build. Example: @interface AppController : NSObject { ... IBOutlet NSButton* startButton; NSSpeechSynthesizer* speechSynthesizer; } @impl

Re: Should I retain a variable returned from this accessor?

2008-08-12 Thread Sean DeNigris
Hi, how do I handle memory management for todoUid below? Do I have to retain or autorelease it? [...snip...] // Get uid to return NSString* todoUid = [newTodo uid]; [...snip...] return todoUid; } you could do: NSString* todoUid = [[[newTodo uid] retain] autorelease]; Y

Re: Should I retain a variable returned from this accessor?

2008-08-11 Thread Sean DeNigris
On Mon, Aug 11, 2008 at 3:12 PM, Sean DeNigris <[EMAIL PROTECTED]> wrote: Hi, how do I handle memory management for todoUid below? Do I have to retain or autorelease it? [...snip...] // Get uid to return NSString* todoUid = [newTodo uid]; [...snip...] [newTodo r

Should I retain a variable returned from this accessor?

2008-08-11 Thread Sean DeNigris
Hi, how do I handle memory management for todoUid below? Do I have to retain or autorelease it? I'm using Scripting Bridge to communicate with iCal. Also, this is a sub-routine and todoUid will only be used in the method that calls it. - (NSString*) saveToiCalTodo: (NSString*) theSummary

NSSpeechSynthesizer delegate method not called in OCUint

2008-07-25 Thread Sean DeNigris
Hi, I'm using OCUnit injected into my project executable in xCode to test a class that contains an NSSynthesizer. The following didFinishSpeaking method gets called when I run the app normally, but not in the test. - (id)init { ... speechSynthesizer = [NSSpeechSynthesizer new];