Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS delegate Does not get called
    primarykey
    data
    text
    <p>I'm having strange problem, trying to call my delegate - it never gets called. As i understand ,delegate never gets set. i'm using ARC.</p> <p>CueCreateDelegate.h</p> <pre><code>#import &lt;Foundation/Foundation.h&gt; @class CueCreateDelegate; @protocol CueCreDelegate &lt;NSObject&gt; - (void)CueCreatedCall; @end @interface CueCreateDelegate : NSObject @property (nonatomic, assign) id &lt;CueCreDelegate&gt; delegate; -(void)CueCreated; - (void) setdelegate:(id&lt;CueCreDelegate&gt;) delegates; //for testing @end </code></pre> <p>CueCreateDelegate.m CueCreated is called from another class and it prints the bad news...</p> <pre><code>#import "CueCreateDelegate.h" @implementation CueCreateDelegate @synthesize delegate ; - (void) setdelegate:(id&lt;CueCreDelegate&gt;) delegates{ delegate = delegates; } -(void)CueCreated{ if ([delegate respondsToSelector:@selector(CueCreatedCall)]) { [delegate CueCreatedCall]; } else{ NSLog(@"Delegate method not getting called...%@",delegate); } } @end </code></pre> <p>MatrixViewController.h</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; #import "CueCreateDelegate.h" @interface MatrixViewController : UIViewController&lt;UIGestureRecognizerDelegate,CueCreDelegate&gt;{ CueCreateDelegate *cueCre; } </code></pre> <p>MatrixViewController.m CueCreatedCall is never called..</p> <pre><code>-(void)CueCreatedCall{ NSLog(@"lsakdlakjdlks"); } - (void)viewDidLoad { cueCre = [[CueCreateDelegate alloc] init]; // [cueCre setdelegate:self]; [cueCre setDelegate:self]; NSLog(@"%@",[cueCre delegate]); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload