About performSelector usage, why not the expected results

First of all, post code:
TestClass.h

#import <Foundation/Foundation.h>

@interface TestClass : NSObject

-(void) outputHelloWorld;
-(void) outputHelloWorldInSeconds;


@end


#import "TestClass.h"

@implementation TestClass

-(void) outputHelloWorld
{
NSLog(@"HelloWord, boy");
}

-(void) outputHelloWorldInSeconds
{

[self performSelector:@selector(outputHelloWorld) withObject:nil afterDelay:1];
NSLog(@"outputHelloWorldInSeconds########");
sleep(3);
NSLog(@"outputHelloWorldInSeconds--------");
}
@end


#import <Foundation/Foundation.h>
#import "TestClass.h"



int main (int argc, const char * argv[])
{

@autoreleasepool
{



TestClass *testObject = [[TestClass alloc] init];
// [testObject outputHelloWord];
[testObject outputHelloWorldInSeconds];

// [testObject release];

}
return 0;
}

Why is [self performSelector:@selector (outputHelloWorld) withObject:nil afterDelay:1]; if there is no execution to, not the expected results?
The final output console is:
sharedlibrary apply-load-rules all
[Switching to process 650 thread 0x0]
2013-05-22 04:39:20.191 helloworld[650:707] outputHelloWorldInSeconds########
2013-05-22 04:39:23.195 helloworld[650:707] outputHelloWorldInSeconds--------
Program ended with exit code: 0

Started by Willie at February 01, 2016 - 2:09 AM

Also did not perform the function, main function has been run over and return -> this is the consequence of the program before the exit can not run into you want to run the function.

Posted by Steward at February 08, 2016 - 2:53 AM

In other words, is the function you want to run, run time in the program's life cycle.

Posted by Steward at February 13, 2016 - 3:41 AM



To recover the above said, to study under the. Not what I said above it.

Posted by Steward at December 17, 2016 - 10:41 PM

That is what happened, please master pointing.

Posted by Willie at December 30, 2016 - 11:39 PM

Use the wizard to create a UI project, for example Single View Application based programs, and then do it in ViewController.m, you can see the expected results.

Posted by Steward at January 03, 2017 - 11:57 PM

The main function to come up out of the
Running is not there

Posted by Lionel at January 06, 2017 - 12:50 AM

In the main () function so write

do {
@autoreleasepool {
@try {
[[NSRunLoop currentRunLoop] run];
}
@catch (NSException *exception) {
DTLogError(__FUNCTION__, @"%@", exception);
}
}
} while (YES);

Posted by natascha at January 15, 2017 - 1:22 AM