Note that there are some explanatory texts on larger screens.

plurals
  1. POMy protocol method is not triggered, and no errors while trying
    text
    copied!<p>First time working with protocols and it is not working but no errors either...</p> <p>I have defined and implemented a protocoll in a delegate (BlockPopViewController). Then I try to access it from a UIViewController (BoardViewController) whose view has been added to the delegate as a subview.</p> <p>The result is that my request to the protocol's method is not creating any errors, but the method is not triggered either. Would be most appreciated if someone has an idea. Thanks in advance!</p> <p>BlockPopViewController.h</p> <pre><code>#import "DirectionViewController.h" @class BoardViewController; @protocol BVCProtocol - (void)testing; @end @interface BlockPopViewController : UIViewController &lt;BVCProtocol&gt; {} -(void)testing; @end </code></pre> <p>BlockPopViewController.m</p> <pre><code>@implementation BlockPopViewController -(void)testing{ NSLog(@"Testing in delegate BlockPopViewController"); } @end </code></pre> <p>BoardViewController.h</p> <pre><code>@class BoardView; //This I cannot import, I think this should be ok instead. Probably cyclic import... @class Bric; //This I cannot import, I think this should be ok instead. Probably cyclic import... @protocol BVCProtocol; @interface BoardViewController : UIViewController { } @property(nonatomic, assign) id &lt;BVCProtocol&gt; blockPopViewController; @end </code></pre> <p>BoardViewController.m</p> <pre><code>#import "BlockPopViewController.h" #import "BoardViewController.h" @implementation BoardViewController @synthesize blockPopViewController; -(void)touchesEnded:(NSSet*)touches withEvent:(UIEvent *)event{ NSLog(@"INSIDE TOUCHESENDED"); [[self blockPopViewController] testing]; } </code></pre>
 

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