Why don't we use * while we create the object of NSRange
Can anybody tell me that Why 开发者_高级运维don't we use * with NSRange object.Whenever i use * with NSRange it gives error why it's giving error?
Because NSRange
is a struct, not a class. Structs are value types, and therefore you do not use pointers with them like you do with class instances (*
is the pointer dereferencing operator).
This is the structure of NSRange :
typedef struct _NSRange {
NSUInteger location;
NSUInteger length;
} NSRange;
Now tell me do you think we required any pointer ? why we required the pointer ? If you can give the answer than that is your solution.
精彩评论