What is the meaning of using combination of detachNewThreadSelector:toTarget:withObject and [NSThread Start]?

"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!

Up vote 0 down vote favorite share g+ share fb share tw.

I am using below code where in method startThread if I am using detachNewThreadSelector method, it blocks my UI but when I use to make object of NSThread and call start method and in that I called run method it is not blocking my UI. What I am not getting is detachNewThreadSelector will run in background so it should not block my UI. Then why so in my case?

And what is with start method and NSThread object? Will it run in background or main thread? I have search so many articles and StackOverFlow questions but not get in which senario actually these Threads workout -(void)startThread { NSAutoreleasePool *pool = NSAutoreleasePool alloc init; //NSThread *myThread = NSThread alloc initWithTarget:self selector:@selector(run:) object:nil; //myThread start; NSThread detachNewThreadSelector:@selector(run:) toTarget:self withObject:nil; pool release; } -(void)run:(id)param { NSAutoreleasePool *pool = NSAutoreleasePool alloc init; while (threadProgressView.

Progress Progress = actual + 0.025; } objective-c ios multithreading core-foundation link|improve this question edited Dec 29 '11 at 6:26 asked Dec 29 '11 at 6:17Roshni1147 76% accept rate.

– 0x8badf00d Dec 29 '11 at 6:24 I am updating label value according to progressbar progess and showing progressbar progressing – Roshni Dec 29 '11 at 6:26 always update UI on main thread. – 0x8badf00d Dec 29 '11 at 6:27 still I am not getting what should be the exact flow? What will be the effect if I omit startThread method and on any button click I call run method and in run method I call self performSelectorOnMainThread:@selector(updateProgressBar) withObject:nil waitUntilDone:YES; – Roshni Dec 29 '11 at 6:29 Updating the UI means calling updateProgressBar method, on main theread blocking my other UI elements and also not showing actual update of progressview.

It just shows 0 and directly to 1 – Roshni Dec 29 '11 at 6:31.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions