pau*_*ler 8 objective-c objective-c-category
我有一个类型的类结构UIViewControllerSubclass : UIViewController,其中UIViewControllerSubclass的唯一功能是#import UIViewController+Category.h.我在一个类别中添加方法的原因是我也可以制作UITableViewControllerSubclass : UITableViewController,这#import UIViewController+Category.h也是.众所周知,不要重复自己.
现在假设UIViewController + Category.h具有以下结构:
@interface UIViewController(Category)
- (void) method1;
- (void) method2;
@end
Run Code Online (Sandbox Code Playgroud)
如何安全是它来创建UIViewControllerSubclassSubclass : UIViewControllerSubclass,这将覆盖method1?我认为这会因为Objective-C的消息传递而起作用,但出于某种原因,我的直觉告诉我,我做错了.
| 归档时间: |
|
| 查看次数: |
2395 次 |
| 最近记录: |