views:

40

answers:

2

Good Morning Users,

i have implemented the follwing deleagate Method:

- (void)openFlowView:(AFOpenFlowView *)openFlowView doubleTapOnIndex:(int)index itemView:(AFItemView *)itemView{
    NSLog(@"Der Touch geht!!!!!");
}

And there the method should be prompted and called:

- (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];
        }
    else {

But it never goes into the second if, does anybody know why that is so??

Greetings and thank you all for helping beforehand

A: 

Did you include your method declaration in your header file?

Joseph Tura
yes i have included the method in my header :)
Marco
+1  A: 

Is the "self.viewDelegate" class is the class you have add the delegate method ?

Benoît
Sorry i don't know what you mean, the class i have added the delegate method is the AFOpenFlowView.m
Marco
I think what Benoît is asking is whether a) the method openFlowView: etc. is declared in the class of your viewDelegate. Another possible problem could be that viewDelegate is nil if you have not yet set it at the time you are checking with respondsToSelector
Joseph Tura
You have these two methods in the same class (AFOpenFlowView) ?
Benoît
@Joseph yes i think viewDelegate is nil because on Debugger it only shows 0x0, how could i solve this problem?
Marco
e.g. self.viewDelegate = THE OBJECT THAT IMPLEMENTS YOUR DELEGATE METHOD.
Joseph Tura
Marco : if your delegate method is in the same class, you just need to call method to self, not self.viewDelegate.
Benoît
hmmm...it is very heavy to understand because i am new in objective C sorry!!
Marco
Joseph: how do you mean "the object that implements your delegate Method" sorry people
Marco
i have the problem self.viewDelegate is 0x0, how could i solve this?
Marco
Post more code, maybe that will help clear things up.
Joseph Tura