objective c - performSelector in NSOperation subclass -
I could not find an answer anywhere on the net, so any help would be appreciated.
I am trying to create a system from which I can get the results of an NSOperation task, which I think can not be done by solid sub-classes such as NSNWonction.
I have an NSOperation subclass ( TheEngine ) that is abstract according to the conference and should be expanded to implement TheEngine contains the following initial functions, whose work only is to note the See my The entire process happens in this way: Enhances the expansion of aViewController TheEngine - Says < The Task and adding it to the Operation Queue. Everything starts running as expected without any errors or exceptions. But when the execution Here's the full code: Any help appreciated! After the Your You should probably run this on the main thread or with -man , to execute the code To include the code for
the selector and
theObject . It also registers a KV supervisor for the property
isFinished :
- (id) initWithCallbackSelector: (SEL) Thelector inObject: (id) theObject
in ValatForKeyPath: ofObject: change: context: function I would like to call the callback function like this:
NSLog (@ " To ensure some debug text, this function is being called ", zero); [Object executor: object with selector: after some data: 1];
sees ValleForKeyPath: ofObject: change: context: Callback is not actually said I am new to Obj-C, so I'm not completely sure that this kind of threading My understanding is correct.
- (id) initWithCallbackSelector: Object in the selector (s): theObject {if ([self init]) {self selector} OBject = theObject; Self.selectorToCallFhenished = theSelector; [Self add-onserver: Self PayPal for: @ "Failed" option: NSKeyValueObservingOptionNew Reference: NULL]; Self return; } Return zero; } - (zero) observeValueForKeyPath: (NSString *) mainpath ofObject: (id) theObject change: (NSDictionary *) theChange reference: (zero *) theContext {if ([main path isEqualToString: @ "isFinished"]) {NSLog (@ " Activity has ended with:% @ ", change); NSLog (@ "Target Object:% @", Self Selection Parent Object); NSLog (@ "Target Selector:% @", NSStringFromSelector (self.selectorToCallWhenFinished)); // [Self Performance Selector: Mainstream: Self. When finished with the selector, object: self. Rated Data Waiting Time: No]; [Self. Picture Object Exporter Selector: @SelectorTokel (Object) with the object: Self. Later data data: 0]; }}
nooparation is likely to run on the background background. That thread goes away, or if the thread fails to pump your race loop, then your call to
performSelector: withObject: afterDelay: will not be active. You commented on the call at
CosactorOnMineThread: ... . It worked
performSelector running this: withObject: (
without afterDelay: ).
performSelector: withObject :. does not require a run loop
Comments
Post a Comment