Skip to content

What is the usage of after delay time here. #7

Description

@hvaghela116

Hi,

I would like to know in detail what is the use of the following function. Anybody could you please explain in detail because I am facing timeout issue while try to connecting with wifi network.

[self performSelector:@selector(endTime) withObject:nil afterDelay:2];

is it necessary to call above function and what will be the effect if we would not use this function.
Please explain in detail.

Thanks in advance.

  • (void)go {
    if ([NSThread isMainThread]) {
    [self.simplePing start];
    //[self performSelector:@selector(endTime) withObject:nil afterDelay:2]; // This timeout is what retains the ping helper
    } else {
    dispatch_sync(dispatch_get_main_queue(), ^{
    NSLog(@"Moving ping to main thread");
    [self.simplePing start];
    // [self performSelector:@selector(endTime) withObject:nil afterDelay:2];
    });
    }

}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions