Saturday, 21 November 2015

How to Use Perfom Selector Ios/Iphone

dispatch_async(dispatch_get_main_queue(), ^{
    [self doSomething:1 b:2 c:3 d:4 e:5];
});



[ invocationObject performSelectorOnMainThread: @selector( invoke )

   withObject: nil, waitUntilDone: NO ];



- (void)threadMain:(id)data {
    NSAutoreleasePool *pool = [NSAutoreleasePool new];

    NSRunLoop *runloop = [NSRunLoop currentRunLoop];
    [runloop addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode];

    while (isAlive) { // '
        [runloop runMode:NSDefaultRunLoopMode beforeDate:

[NSDate distantFuture]];
    }

    [pool release];
}