我的两个线程中有两组值,例如,在我的第一个线程中我有奇数,在第二个线程中我有偶数,但我想打印像 1,2,3,4 这样的值.....如何交替打印线程值???
NSThread* myThread = [[NSThread alloc] initWithTarget:self selector:@selector(myThreadMainMethod:) object:nil];
[myThread setThreadPriority:1];
NSThread* myThread2 = [[NSThread alloc] initWithTarget:self selector:@selector(myThreadMainMethod2:) object:nil];
[myThread2 setThreadPriority:1];
[myThread start]; // Actually create the thread
[myThread2 start]; // Actually create the thread
谢谢。