Wednesday 15 January 2014

iphone - Protocol method does not get invoked, shows delegate 'nil' -


I am working on an iPad app and I'm having problems with the rep ... protocol method not applicable is done . I'm not sure what I'm missing, this is my code.

  @protocol pickerLabelProtocol & lt; NSObject & gt; - (zero) Selected PickerData: (UILBL *) Sender; @end @Interface Show PictureView: UIViewController @property (nonatomic, strong) id & lt; PickerLabelProtocol & gt; Representative; @end @implementation showPickerVC - (zero) viewview size: (BOOL) animated {[super visual shape: animated]; // I used breakpoint, is 'representative' always zero for some reason? [Self. Selected selected postcardia: Self. Mannebabel]; } ---------------------- Controller: UIViewController & lt; PickerLabelProtocol & gt; @protty (non-dynamic, strong) show picture + show picture; @end @implementation someViewController - (Zero) selectedPickerData: (UILabel *) this {// protocol method} - (zero) viewDidLoad {[super viewDidLoad]; Self.showPicker = [[ShowPickerVC alloc] init]; Self. Show picture. Delegate = Self; }  itemprop = "text"> 

I can not make any mistake with my code, but I suggest you to do the following:

It is clear that when you add a showPickerVC object, this is rep self

like this Like,

  showPickerVC * obj = [[ShowPakVVC Elok] Init]; Obj.delegate = self; /// Your Protocol Rep. [Self-current model view controller: Animated OJJ: Yes];   

Also add code as the following

  @implementation showPickerVC - (zero) viewWillDisappear: (bool) animated {[super viewWillDisappear: animated] ; If ([Respond to Self Delegate Tsegel: @Selector (Selected Pickcardia :)) {[Self-reliant: Selected Pickcardia: Self. Mannebabel]; }} For more information about   



No comments:

Post a Comment