Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.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/2/google-app-engine/4.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
Objective c 在这种情况下,自表示哪个类…..DGcontroller类是DMcontroller类_Objective C - Fatal编程技术网

Objective c 在这种情况下,自表示哪个类…..DGcontroller类是DMcontroller类

Objective c 在这种情况下,自表示哪个类…..DGcontroller类是DMcontroller类,objective-c,Objective C,@DMC控制器的实现 -voidpresentsecondviewcontroller { DGcontroller*secondvg=[[DGcontroller alloc]init] [secondvg setDelegate:self]; //上面的自我代表着哪个阶级 [self-presentViewController:secondvg动画:是完成:无]; //以上自我代表到哪一类 }如果您在DMcontroller实现中的实例方法中,那么这就是self对象的类。有两个self….那

@DMC控制器的实现

-voidpresentsecondviewcontroller {

DGcontroller*secondvg=[[DGcontroller alloc]init]

[secondvg setDelegate:self]; //上面的自我代表着哪个阶级

[self-presentViewController:secondvg动画:是完成:无]; //以上自我代表到哪一类


}

如果您在DMcontroller实现中的实例方法中,那么这就是self对象的类。有两个self….那么哪个表示哪个类….?self是一个保存指向对象指针的符号;除非你改变它,否则它不会改变。尝试NSLog@self是%@,自我;这意味着这里setDelegate:self-representation到DGcontroller类,下面self-representation到当前类,在这种情况下,DMcontroller-classNo,当你在一个方法实现中时,只有一个self,除非你做了一些奇怪的改变。