Is this normal: "[delegate respondsToSelector:didFailSelector]" Where is @selector? #290

Closed
Ricardo1980 opened this Issue Nov 20, 2011 · 4 comments

Comments

Projects
None yet
3 participants
@Ricardo1980

Hello!

I don't know if this is an error.
Is it normal not having @selector in these lines?

  • (void)reportFailure
    {
    if (delegate && [delegate respondsToSelector:didFailSelector]) {
    [delegate performSelector:didFailSelector withObject:self];
    }

From ASIHTTPRequest.m.

Same question for:

/* ALWAYS CALLED ON MAIN THREAD! */

  • (void)reportFinished
    {
    if (delegate && [delegate respondsToSelector:didFinishSelector]) {
    [delegate performSelector:didFinishSelector withObject:self];
    }

Thanks.

@yllan

This comment has been minimized.

Show comment Hide comment
@yllan

yllan Nov 21, 2011

Contributor

It's normal.

Contributor

yllan commented Nov 21, 2011

It's normal.

@Ricardo1980

This comment has been minimized.

Show comment Hide comment
@Ricardo1980

Ricardo1980 Nov 21, 2011

Can you explain me why? Why selector is not used? Thanks.

El 21/11/2011, a las 03:07, Yung-Luen Lan reply@reply.github.com escribió:

It's normal.


Reply to this email directly or view it on GitHub:
#290 (comment)

Can you explain me why? Why selector is not used? Thanks.

El 21/11/2011, a las 03:07, Yung-Luen Lan reply@reply.github.com escribió:

It's normal.


Reply to this email directly or view it on GitHub:
#290 (comment)

@yllan

This comment has been minimized.

Show comment Hide comment
@yllan

yllan Nov 21, 2011

Contributor

didFinishSelector here is an ivar. Its default value is @selector(requestFailed:).

[self setDidFailSelector:@selector(requestFailed:)];

Contributor

yllan commented Nov 21, 2011

didFinishSelector here is an ivar. Its default value is @selector(requestFailed:).

[self setDidFailSelector:@selector(requestFailed:)];

@jogu

This comment has been minimized.

Show comment Hide comment
@jogu

jogu Jan 13, 2012

Collaborator

Yes, it's normal - the delegate call back code is a bit involved - if you look at a discussion on the mailing list ~18 months ago you can see some explanations of how/why it works like this.

Collaborator

jogu commented Jan 13, 2012

Yes, it's normal - the delegate call back code is a bit involved - if you look at a discussion on the mailing list ~18 months ago you can see some explanations of how/why it works like this.

@jogu jogu closed this Jan 13, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment