Objective-C categories: Can I add a property for a method not in my category?

后端 未结 3 1661
暖寄归人
暖寄归人 2020-12-15 16:23

I want to use a category to make a method on the original class available as a property as well.

Class A:

@interface ClassA
- (NSString*)foo;
@end
         


        
3条回答
  •  半阙折子戏
    2020-12-15 17:03

    If something's declared in your category's interface, its definition belongs in your category's implementation.

提交回复
热议问题