Objective-C beginner..for fluent c/c++ programmer
Thursday, 18. June 2009, 03:39:21
1. Objective-C doesn't have value types, so there is nothing similar to C++'s: Fraction frac; frac.print();. You always deal with objects as pointers in Objective-C. for example:
2. Dynamic types in Objective-C
-(BOOL) isKindOfClass: classObjis object a descendent or member of classObj
-(BOOL) isMemberOfClass: classObjis object a member of classObj
-(BOOL) respondsToSelector: selectordoes the object have a method named specifiec by the selector
+(BOOL) instancesRespondToSelector: selectordoes an object created by this class have the ability to respond to the specified selector
-(id) performSelector: selectorinvoke the specified selector on the object
3. Every object inherited from NSObject has a class method that returns a class object. This is very similar to Java's getClass() method. This class object is used in the methods above.
MyClass *myObj = [[MyClass alloc] init]; ....// do something [myObj release];
2. Dynamic types in Objective-C
-(BOOL) isKindOfClass: classObjis object a descendent or member of classObj
-(BOOL) isMemberOfClass: classObjis object a member of classObj
-(BOOL) respondsToSelector: selectordoes the object have a method named specifiec by the selector
+(BOOL) instancesRespondToSelector: selectordoes an object created by this class have the ability to respond to the specified selector
-(id) performSelector: selectorinvoke the specified selector on the object
3. Every object inherited from NSObject has a class method that returns a class object. This is very similar to Java's getClass() method. This class object is used in the methods above.









How to use Quote function: