View Full Version : picker.delegate = self;

Feb 18, 2012, 04:46 AM
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 ,,,,

Feb 18, 2012, 05:07 AM
A bit more context possible ? where did you saw that line ?

Let's assume in this context ...


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.