【发布时间】:2015-07-06 09:00:36
【问题描述】:
如何查看预处理的 Objective-C 代码,其中 @property 和 @synthesize 等 Objective-C 指令已被预处理?
我在 Stackoverflow 中搜索过这个主题,有一些关于如何查看预处理代码的提示,例如 Xcode Preprocessor Output。但是,“预处理代码”不涉及预处理的 Objective-C 指令。例如,在“预处理代码”中,像 @property 或 @synthesize 这样的 Objective-C 指令没有被预处理。
以下面的代码为例,
// ========= Person.h =========
@interface Person: NSObject
{
}
-(void) Print;
@property int age;
@end
// ========= Person.m =========
@implementation Person
-(void) Print
{
NSLog(@"Print_Age:%d", _age);
}
@end
我希望看到的是这样的:
// ========= Person.h =========
@interface Person: NSObject
{
int _age;
}
-(void) Print;
-(int) age;
-(void) setAge:(int) age;
@end
// ========= Person.m =========
@implementation Person
-(void) Print
{
NSLog(@"Print_Age:%d", _age);
}
-(int) age {
return _age;
}
-(void) setAge:(int) age {
_age = age;
}
@end
我怎样才能看到它?
【问题讨论】:
-
我不明白你的问题是什么......
标签: objective-c