Domanda

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.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top