Hello,
First time working with protocols and it is not working but no errors either...
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.
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!
BlockPopViewController.h
#import "DirectionViewController.h"
@class BoardViewController;
@protocol BVCProtocol
- (void)testing;
@end
@interface BlockPopViewController : UIViewController <BVCProtocol> {}
-(void)testing;
@end
BlockPopViewController.m
@implementation BlockPopViewController
-(void)testing{
NSLog(@"Testing in delegate BlockPopViewController");
}
@end
BoardViewController.h
@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 <BVCProtocol> blockPopViewController;
@end
BoardViewController.m
#import "BlockPopViewController.h"
#import "BoardViewController.h"
@implementation BoardViewController
@synthesize blockPopViewController;
-(void)touchesEnded:(NSSet*)touches withEvent:(UIEvent *)event{
NSLog(@"INSIDE TOUCHESENDED");
[[self blockPopViewController] testing];
}