Alex Rivera | Logout

Is the 'isa' variable in objective-C equal to 'instanceof' in Java

Asked 2011-11-28T09:52:57.173
10

Simple question: is it fair to say that the 'isa' instance variable in Objective-C provides the same functionality as the 'instanceof' operator in Java?

Edit
Report

1 Answer

3

No. instanceof is more like the isKindOfClass: method in Objective-C because it also evaluates to true for subclasses while the isa pointer only points to a single class.

answered 2011-11-28T10:13:01.767

Your Answer