Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 在UIViewController中修改ViewDid的行为_Ios_Objective C_Uiviewcontroller_Categories - Fatal编程技术网

Ios 在UIViewController中修改ViewDid的行为

Ios 在UIViewController中修改ViewDid的行为,ios,objective-c,uiviewcontroller,categories,Ios,Objective C,Uiviewcontroller,Categories,我有应用程序(苹果样本的UICatalog)。我将它与一个名为Lookback的框架一起使用,该框架用于屏幕录制 我的接口定义如下: @interface AAPLSteppperViewController : UITableViewController + (NSString*)lookbackIdentifier { return @"Profile Editor"; } 因此,它是UITableViewController的一个子类。并实施了以下方法: @interface

我有应用程序(苹果样本的UICatalog)。我将它与一个名为Lookback的框架一起使用,该框架用于屏幕录制

我的接口定义如下:

@interface AAPLSteppperViewController : UITableViewController
+ (NSString*)lookbackIdentifier {
    return @"Profile Editor";
}
因此,它是UITableViewController的一个子类。并实施了以下方法:

@interface AAPLSteppperViewController : UITableViewController
+ (NSString*)lookbackIdentifier {
    return @"Profile Editor";
}
我想调查lookbackIdentifier是如何被调用的,并看到类似的情况:

问题是:如何引入这样的行为,因为UITableViewController是一个系统类,我无法在堆栈中看到编号为1和2的调用的源

当我调查框架文档时,他们建议总是这样实现

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    ...
}
对我来说,这看起来像是UIViewController内部的一个变化——但如何实现这样的变化呢

我想这将包括一些使用UIViewController的游戏,但是-如何?我无法想象如何在没有子类的情况下重写它的单个方法

我只能访问我的AAPLStepperViewController


如果有人能把我推到正确的方向,我将不胜感激,因为@dan指出了这一点——swizzling是正确的答案。我试着在那里按指示行事,这给了我想要的行为


感谢您的帮助:)

我不认为我真的理解您的问题,但您可以覆盖单个方法,而无需像计划一样使用方法swizzlingSounds进行子类化。我想实现例如UIViewController在ViewDid中显示调用其他内容。