Search code examples
objective-csubviewselfsupersuperview

self.view / super.view


what's the difference between

[self.view addSubview:view1];

and

[super.view addSubview:view1];

Thank You!!

Franhu


Solution

  • Unless you've overridden the -view method, there is no practical difference. From a semantic difference, though, saying super.view is an express attempt to avoid invoking a method named -view defined in the current class. Unless you want to express that meaning, you should stay away from the super.whatever construct.