문제

In the following code the self.viewDelegate is 0x0 and I don't know how to solve this problem. Should I have to go to the interface Builder?

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    UITouch *touch = [[event allTouches] anyObject]; 
    if ([touch tapCount] == 2) {
        if ([self.viewDelegate respondsToSelector:@selector(openFlowView:doubleTapOnIndex:itemView:)])
            [self.viewDelegate openFlowView:self doubleTapOnIndex:selectedCoverView.number itemView:selectedCoverView];
        }
도움이 되었습니까?

해결책

viewDelegate is not defined.
Usually, in Apple class, view delegate is just call delegate. You should have taken this code from somewhere. You have to defined viewDelegate in your code (not IB)

self.viewDelegate=xxxx;

xxxx must be your delegate. Delegate could be self !

See Apple doc for delegate explanation

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top