¡@

Home 

2014/10/15 ¤U¤È 10:11:49

iphone Programming Glossary: mythread

iPhone: how to use performSelector:onThread:withObject:waitUntilDone: method?

http://stackoverflow.com/questions/2584394/iphone-how-to-use-performselectoronthreadwithobjectwaituntildone-method

waitUntilDone method with a thread that I' instantiated for this. My code @interface MyObject NSObject NSThread _myThread @property nonatomic retain NSThread myThread @end @implementation MyObject @synthesize myThread _myThread NSThread myThread.. I' instantiated for this. My code @interface MyObject NSObject NSThread _myThread @property nonatomic retain NSThread myThread @end @implementation MyObject @synthesize myThread _myThread NSThread myThread if _myThread nil NSThread myThreadTemp NSThread.. NSObject NSThread _myThread @property nonatomic retain NSThread myThread @end @implementation MyObject @synthesize myThread _myThread NSThread myThread if _myThread nil NSThread myThreadTemp NSThread alloc init myThreadTemp start self. myThread..

Fork() on iPhone

http://stackoverflow.com/questions/3619252/fork-on-iphone

standard input. Pseudocode I don't have the code available but you get the idea int fd 2 pipe fd create_posix_thread myThread fd char buffer 1024 read fd 0 buffer 1024 printf s buffer Hello World void myThread int fd dup2 fd 1 STANDARD_OUTPUT printf.. fd 2 pipe fd create_posix_thread myThread fd char buffer 1024 read fd 0 buffer 1024 printf s buffer Hello World void myThread int fd dup2 fd 1 STANDARD_OUTPUT printf Hello World The strategy is very handy if you want to use a third party library..

Can I use a background thread to parse data?

http://stackoverflow.com/questions/6965265/can-i-use-a-background-thread-to-parse-data

get you started void dataDoneLoading id obj NSMutableArray array NSMutableArray obj update your UI NSLog @ done void myThread id obj NSAutoreleasePool pool NSAutoreleasePool alloc init NSMutableArray array NSMutableArray alloc init autorelease build..