문제

in the header file, an ivar structure has three members:-

name, type and offset.

I guess name is for storing the name of the variable.

Offset is for storing distance in bytes from the start of the structure.

Please tell me if I am right about these two ? can anyone explain me What is type for ? Is it the datatype or the scope telling whether it is public ,private or protected.

도움이 되었습니까?

해결책

It's a C string containing the instance variable's type encoding. See Type Encodings in your local copy of Objective-C Runtime Programming Guide.

You should not access Ivar fields directly, though, because Ivar is an opaque type. It's better to use ivar_getTypeEncoding() for that.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top