0
私はiPhoneのスレッドで作業しています。誰もがiPhoneのスレッドに関する違い
[NSThread detachNewThreadSelector:@selector(loadButtonInfo:) toTarget:self withObject:buttonInfo];
と
[self performSelectorOnMainThread:@selector(loadButtonInfo:) withObject:buttonInfo waitUntilDone:NO];
Caleb:performSelectorOnMainThreadについては、今私が描いているのは、メインスレッド、peforSelectorOnMainThreadがあり、新しいブランチを作成していますが、まだメインスレッドにアタッチされています....あなたの説明の最後の部分が混乱しています。*** performSelectorOnMainThread ***(他の場所から)データを取得するために使用されました。その後、メインスレッドにデータを表示または更新しますか? – tonytran
話す「分岐」はありません。そのメソッドを呼び出した後のある時点で、メインスレッドは指定されたメッセージを受信者に送信します。あなたの例では、メインスレッドは '[self loadButtonInfo:buttonInfo]'を実行します。あなたは[ドキュメント](http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/nsobject_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObject/)を読んだのですか? performSelector:onThread:withObject:waitUntilDone :):-performSelectorOnMainThread:...?説明はかなり明白です。 – Caleb
私はちょうどドキュメンテーションに行きました。ありがとうございました。 * performSelectorOnMainThread *をいつ使うべきか、* NSThread detachNewThreadSelector *をいつ使うべきか、私はまだ疑問に思っています。 – tonytran