NSOpeationを使用すると、奇妙な動作が発生します。UIButtonを作成してビューに追加する関数(-createTagView)を呼び出しています。何らかの理由でそれらを追加していません。NSOperationの外部から関数を呼び出すと、すべてが正常に機能します。
何か案は?ありがとう。
これは、NSOperationを(ViewControllerオブジェクト内で)作成する方法です。
> NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(createTagView:) object:data];
> [operationQueue addOperation:operation];
> [operation release];
そしてこれは呼ばれる関数です([タグビュー]はUIButtonです):
-(void) createTagView:(NSMutableArray *) data
{
NSInteger t_id = (NSInteger)[data objectAtIndex:0];
NSString *t_name = (NSString *)[data objectAtIndex:1];
NSString *t_rawname = (NSString *)[data objectAtIndex:2];
Tag *t = [[Tag alloc] initWithId:(NSInteger)t_id name:t_name rawname:t_rawname];
[self.view addSubview:[t view]];
[t release];
}