self.flipsidenavigationbar=aNavigationBar;
why here is needed self? (otherwise it crashes)
[flipsidenavigationbar pushnavigationietm........];
why here self is not needed?
note that flipsidenavigationbar is an iVar declared as property and synthesized.
thank you
Alex
is
flipsidenavigationbardeclared as a “retain” property type? My guess as to what’s happening is this.The dot-syntax method as you’ve written it is equivalent to
and this method call is probably retaining the
aNavigationBarobject when you set it. When you callyou are not retaining it, it’s likely being released before you want it to be and causing your crash.
You can read more about dot syntax in Obj-C, it’ll probably help you with problems like this in the future.
The other two posters said it better, but it’s very important to remember that these two lines:
Have the potential to be completely unrelated. Dot syntax is only shorthand for a method call, and you have the potential to make that method call do anything you want. It’s important that, instead of having a rule for dealing with properties like you mention in your comment
you should understand exactly what is going on, so you know what the effects of your dot-syntax usage are. It’s confusing, I know, but it’s really not hard and everyone picks it up pretty quickly. Good luck!