처음 시도하는 동안 그것이 작동하지 않고 오류가 ...내 프로토콜 방법은 트리거되지 및 오류 프로토콜 작업
내가 정의되지 및 대리인 (BlockPopViewController)에 protocoll을 구현 한 하나되지 않습니다. 그런 다음 UIViewController (BoardViewController)에서보기에 대리자에 하위보기로 추가 된 뷰에 액세스하려고합니다.
결과적으로 프로토콜의 메소드에 대한 요청이 오류를 생성하지 않지만 메소드가 트리거되지 않습니다. 누군가가 아이디어를 가지고 있다면 가장 높이 평가 될 것입니다. 미리 감사드립니다!
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];
}
NSLog (@ "% @", [self blockPopViewController])를'[[self blockPopViewController] testing]'바로 위에 놓으면 출력은 어떻게됩니까? –