typedef enum {
SexMan,
SexWomen
}Sex;// - 性别;
typedef enum {
ColorBlack,
ColorRed,
ColorGreen,
} Color;// -性别
typedef struct {
int year;
int month;
int day;
}Date;// - 生日
#import <Foundation/Foundation.h>
@interface Student :NSObject{
@public
double _weight;
Sex _sex;
Date _birthday;
Color _favColor;
}
// 下面的属性过期了 希望使用新的方法时候 可以在后边写上下面的代码 NS_DEPRECATED_IOS(2_0, 3_0, "建议使用心得属性")
@property (nonatomic, assign)id<MyScrollerViewDelegate>myDelegate NS_DEPRECATED_IOS(2_0, 3_0, "建议使用心得属性");
Student * stu = [Studentnew];
stu ->_weight =50;
stu ->_sex =SexMan;
Date birthday= {1991 ,12 ,8};
stu ->_birthday = birthday;