Re: Checking for NULL (was Re: Can't get setDelegate to work...)

2009-03-05 Thread Steven Noyes
On Mar 4, 2009, at 7:54 PM, Mark D. Gerl wrote: Precisely.. code-in-email. I do handle all else cases, and wrap it all up inside exceptions. Kind of habit by now. What I was kind of fishing for in the nil/NULL checking - was - to recognize that it seems Cocoa programmers are trending

Re: Checking for NULL (was Re: Can't get setDelegate to work...)

2009-03-05 Thread Roland King
On Mar 5, 2009, at 9:32 PM, Steven Noyes wrote: On Mar 4, 2009, at 7:54 PM, Mark D. Gerl wrote: Precisely.. code-in-email. I do handle all else cases, and wrap it all up inside exceptions. Kind of habit by now. What I was kind of fishing for in the nil/NULL checking - was - to

Re: Checking for NULL (was Re: Can't get setDelegate to work...)

2009-03-05 Thread Clark Cox
On Thu, Mar 5, 2009 at 5:32 AM, Steven Noyes stevenno...@mac.com wrote: On Mar 4, 2009, at 7:54 PM, Mark D. Gerl wrote: Precisely.. code-in-email.  I do handle all else cases, and wrap it all up inside exceptions.  Kind of habit by now. What I was kind of fishing for in the nil/NULL

Checking for NULL (was Re: Can't get setDelegate to work...)

2009-03-04 Thread Mark D. Gerl
On Mar 4, 2009, at 12:11 AM, Michael Ash wrote: On Tue, Mar 3, 2009 at 4:30 PM, Quincey Morris quinceymor...@earthlink.net wrote: On Mar 3, 2009, at 12:50, Nick Zitzmann wrote: It doesn't seem to be documented, but I think it will return nil only if (1) there was not enough contiguous RAM

Re: Checking for NULL (was Re: Can't get setDelegate to work...)

2009-03-04 Thread Shawn Erickson
On Wed, Mar 4, 2009 at 12:57 PM, Mark D. Gerl mg...@mmdesigngrp.com wrote: In any case, and perhaps based purely on habit, I find it difficult to even write:        NSStatusItem statusItem = [[[NSStatusBar systemStatusBar]                statusItemWithLength:NSVariableStatusItemLength]

RE: Checking for NULL (was Re: Can't get setDelegate to work...)

2009-03-04 Thread Jeff Laing
Mark D. Gerl asked: There's something that's just uncomfortable about dereferencing pointers without first checking for validity. Is it just me? I don't think its just you, though most Cocoa types eventually give up and go with the simpler 'just trust it, it works' approach. Personally, I

Re: Checking for NULL (was Re: Can't get setDelegate to work...)

2009-03-04 Thread Stuart Malin
On Mar 4, 2009, at 12:15 PM, cocoa-dev-requ...@lists.apple.com wrote: In any case, and perhaps based purely on habit, I find it difficult to even write: NSStatusItem statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength] retain];

Re: Checking for NULL (was Re: Can't get setDelegate to work...)

2009-03-04 Thread Clark Cox
On Wed, Mar 4, 2009 at 2:40 PM, Stuart Malin stu...@zhameesha.com wrote: On Mar 4, 2009, at 12:15 PM, cocoa-dev-requ...@lists.apple.com wrote: In any case, and perhaps based purely on habit, I find it difficult to even write:        NSStatusItem statusItem = [[[NSStatusBar systemStatusBar]

Re: Checking for NULL (was Re: Can't get setDelegate to work...)

2009-03-04 Thread Greg Parker
On Mar 4, 2009, at 2:40 PM, Stuart Malin wrote: On Mar 4, 2009, at 12:15 PM, cocoa-dev-requ...@lists.apple.com wrote: In any case, and perhaps based purely on habit, I find it difficult to even write: NSStatusItem statusItem = [[[NSStatusBar systemStatusBar]

Re: Checking for NULL (was Re: Can't get setDelegate to work...)

2009-03-04 Thread Mark D. Gerl
On Mar 4, 2009, at 5:12 PM, Jeff Laing wrote: (For the record, when I add an IBOutlet to a class definition, I add the corresponding assertion that its non-nil to the awakeFromNib method because I *know* that I forget to connect those things up, and have wasted days chasing unexpected 'nil'