Defining a Structure and Accessing Structure Members

suggest change

The format of the struct statement is this:

struct [structure tag]
{
   member definition;
   member definition;
   ...
   member definition;
} [one or more structure variables];

Example: declare the ThreeFloats structure:

typedef struct {
 float x, y, z;
} ThreeFloats;
@interface MyClass
- (void)setThreeFloats:(ThreeFloats)threeFloats;
- (ThreeFloats)threeFloats;
@end

Sending an instance of MyClass the message valueForKey: with the parameter @“threeFloats” will invoke the MyClass method threeFloats and return the result wrapped in an NSValue.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Structs:
*Defining a Structure and Accessing Structure Members

Table Of Contents