当我尝试将 int 定义为 Objective C 中的属性时,出现错误(不是对象类型)。我尝试过使用 NSInteger 和 int 但都不起作用。
代码: int座位;
@property(非原子,保留)int席位;
最佳答案
您不能保留 int 或 NSInteger,因为它们是原始类型 - 不是对象。请改用以下内容:
@property (nonatomic, assign) int seats;
关于objective-c - Objective C 定义属性的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1038990/