6/12/2009

performSelectorOnMainThread

For some reason, I had the code below when I can just do [self addToBattleTextView:aString].
This was causing the thread to redraw the battle text in an arbitrary order. I don't need multiple threads for my game, bad idea for me to use it! It might have been ok if I had the waitUntilDone:YES, but I'm still novice to use multiple threads. Plus there's no good reason for me to use multiple threads at this point.

下記のコードを使っていたため戦闘メッセージがぐちゃぐちゃになってた。複数のスレッド使わなくていいのになんでこんなことになってたのか。。2時間ぐらい悩んでたyo、うぉにぃちゃん。大体スレッドの使い方把握してないし。

[self performSelectorOnMainThread:@selector(addToBattleTextView:) withObject:aString waitUntilDone:NO];

No comments:

Post a Comment