Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rahul29tech

macrumors member
Original poster
Dec 22, 2011
41
0
picker.delegate = self;
plz explain me this line of code,,,,,is it necessary to allocate self to delegate what this code actually doing ,whats its necessity ,,,,
 
A bit more context possible ? where did you saw that line ?

Let's assume in this context ...

https://developer.apple.com/library..._Protocol/Reference/UIPickerViewDelegate.html

The protocol just define the methods and is not a class definition whch can be used to initiate an instance. The protocol need to be referenced and implemented by a delegation class (could be a view controller).

Set the delegate is required so that the instance which implement the protocol (like "callback" methods) for the picker actually can be addressed.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.