luoyahu 发表于 2013-2-1 11:50:34

深入理解Objective-c中@class的含义

在Objective-c中,当一个类需要引用另一个类,即建立复合关系的时候,需要在类的头文件中建立被引用类的指针。 如:
Car.h
<div class="dean_ch">#import  
@interface Car:NSObject
{
    Tire *tires[4];
    Engine *engine;
}
页: [1]
查看完整版本: 深入理解Objective-c中@class的含义