【发布时间】:2014-04-06 15:25:07
【问题描述】:
好吧,我很困惑。我有一个 Employee 类,我为其声明了几个属性,当然,这些属性可以合成并正常工作。但是在实现类中,我像这样扩展类:
@interface Employee ()
@property (nonatomic) unsigned int employeeId;
@end
我认为这可以让我在 main.m 中执行以下操作:
Employee emp = [[Employee alloc] init];
//use some other property accessor methods...
[emp setEmployeeId:123456];
//do some other stuff...
但编译器在使用setEmployeeId 时会出现以下错误"No visible interface for 'Employee' declares the selector 'setEmployeeId.'
谁能告诉我为什么我不能像使用其他属性一样使用扩展程序?谢谢你的帮助!!!
【问题讨论】:
标签: objective-c