I have a modal view controller which is used for entering data in my iPhone开发者_Go百科 app. I am trying to be efficient by using the same view controller every time there is data to be added, so this one view controller can get called from various different parent views.
Whichever parent view calls the "addingViewController" gets set as its delegate, so I assume before I pop the modal view I need to do a "self.delegate = nil", to make sure that I don't accidentally end up with 2 delegates at the same time.
Am I right that I need to do a "self.delegate = nil"? Which is the appropriate method to do this in - is it viewWillDisappear?
Thanks.
I think when the new delegate is assigned, it knocks out the old delegate, like any other assignment would. So you probably don't have to worry about setting the delegate to nil first.
精彩评论