3
是什麼以下代碼NSthread和NStimer和NSNotifcation之間的區別?
1)
[NSThread detachNewThreadSelector:@selector(myFunction) toTarget:self withObject:thename];
2)
[NSTimer scheduledTimerWithTimeInterval:1.0
target:self
selector:@selector(myFunction:)
userInfo:nil
repeats:NO];
3)
[self performSelector:@selector(myFunction) withObject:nil afterDelay:myDelay];
4)
之間的差210
你說performSelectorInBackground更好,因爲從NSObject.but detachNewThreadSelector(NSThread.h),它也是從NSObject.the doc派生的(http://stackoverflow.com/questions/6539460/what-is-the-difference- between-nsthread-detachnewthreadselectortotargetwithob/6883442#6883442)表示兩者都是相同的,然後區別只是autorelease池。 performSelectorInBackground是自動創建pool.but detach .. not.am我是嗎?有沒有任何理由,你最喜歡的背景method.please指導我。 – 2011-07-30 14:11:22