本帖最后由 FFFF001 于 2016-8-10 11:10 编辑
代码如下:
--------------------.h部分---------------------------
#import <Foundation/Foundation.h>
typedef struct { char *name; int age; } Info;
@interface Person : NSObject
{ Info _info; }
- (void)setInfo:(Info)info; - (Info)info;
@end
--------------------.m部分---------------------------
#import "Person.h"
@implementation Person
- (void)setInfo:(Info)info { _info = info; } - (Info)info { return _info; }
@end
|