On May 8, 2010, at 7:12 AM, gandreas <gandr...@me.com> wrote:
A subtle but important point is that after init's self=[super init] is the only time you normally could have self being NULL (the only other time I can think of is when you do some form of IMP caching and explicitly call the method with nil as the first parameter, but this is pretty rare). So this means it is the only place where accessing an ivar directly can cause a null dereference (unlike C++ where this can be null in any case where static typing allows bypassing vtable dispatching, requiring extra care and paranoia).
For speed or correctness, we do TONS of pointer-identity dictionary or other data structure stuff. Not much IMP caching, but often methods will call C functions that take a "self" argument (so that they can call themselves recursively without going through method dispatch each time).
Now that we have blocks, I expect we'll be using a lot less of this, but with our current codebase it pays to be safe.
--Kyle Sluder
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com