I am running a strange behavior while using NSOpeation, I call the function (-createTagView) which creates a UIButton And then adds it to a scene, for some reason it is not adding them, if I call the function from outside NSOperation, then everything works fine.
Any thoughts? Thank you.
How do I create NSOperation (within a ViewController object)
& gt; NSInvocationOperation * operation = [[NSInvocationOperation alloc] initWithTarget: auto selector: @selector (createTagView :) object: data]; & Gt; [OperationQuality: Operation]; & Gt; [Operation Release]; And it ([Visual] UIButton called function:
- (minus) Bnaotagdrishy: (NSMutableArray *) data {NSInteger T_id = (NSInteger ) [data Objektatindaks: 0]; NSString * t_name = (NSString *) [data Objektatindaks: 1]; NSString * t_rawname = (NSString *) [data Objektaetiindaks: 2]; tag * t = [[tag light] initWithId: ( NSInteger) t_id name: t_name rawname: t_rawname]; [self.view addSubview: [view]]; [T release];}
uses a different thread to run NSOperation, you must call [addSubview:] main Thread is a way [object execution Cynkrtaonmaiththred: Sathobjekt: Prticshauneted Dona] - can add Upwu you use it.
Comments
Post a Comment