0

Possible Duplicate:
When to use self on class properties?

Can someone tell me when to use the self. prefix and when it is unnecessary?

I have a UINavigationController set up in MainWindow.xib and an IBOutlet known as navController linked to it. In my didFinishLaunchingWithOptions method I have linked navController to my window like this:

self.window.rootViewController = navController;

In some tutorials I have seen, the above line is written as such:

self.window.rootViewController = self.navController;

Is there a difference? When does one need to prefix something with self.?

Many thanks.

Community
  • 1
  • 1
achiral
  • 591
  • 2
  • 10
  • 24
  • There's also a good half-dozen questions in the Related sidebar that will answer yours. – jscs Sep 14 '11 at 03:40
  • There are many threads on SO useful in this regard. Go through them. Please read [THIS](http://stackoverflow.com/questions/2385980/objective-c-when-to-use-self) post – Bourne Sep 14 '11 at 03:40

0 Answers0