test if a pointer is pointing to a valid object or not?
test if a pointer is pointing to a valid object or not?
- Subject: test if a pointer is pointing to a valid object or not?
- From: Ben Dougall <email@hidden>
- Date: Tue, 28 Oct 2003 16:05:27 +0000
is there anyway to test if a pointer, that isn't NULL, is pointing to a
valid object or not? when you have a valid pointer to an object, that
pointer points to the isa of that instance. that isa points to the
class that it's an instance of. so i tried:
if( [object isKindOfClass:[NSObject class]] )
but that crashed when it wasn't a valid object. is there anyway to
safely test for a valid object?
thanks, ben
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.