iphone - 如何覆盖@synthesized getter?

如何覆盖一个属性合成的getter?

最佳答案

只需手动实现方法即可,例如:

- (BOOL)myBoolProperty
{
    // do something else
    ...
    return myBoolProperty;
}

然后编译器将不会生成 getter 方法。

https://stackoverflow.com/questions/5047399/

相关文章:

ios - 通过 iOS 创建和导出动画 gif?

objective-c - @interface 和 @protocol 解释?

iphone - 实现 copyWithZone : 时的最佳实践

iphone - 你需要在 GCD 的一个 block 中创建一个 NSAutoreleasePoo

objective-c - 整数总是初始化为0吗?

ios - 如何关闭 Storyboard 弹出框

iphone - iOS 7 UIRefreshControl tintColor 不适用于 beg

ios - 如何从 UIPickerView 获取选定的值

objective-c - iOS 8 iPhone 上的 UIPopoverPresentatio

ios - 是否可以调试 "Terminated due to memory error"?