Questions tagged [dispatch]

Dynamic dispatch (also known as dynamic binding) is the process of mapping a message to a specific sequence of code (method) at runtime. This is done to support the cases where the appropriate method cannot be determined at compile-time (i.e. statically).

Dynamic dispatch is only used for code invocation and not for other binding processes (such as for global variables) and the name is normally only used to describe a language feature where a runtime decision is required to determine which code to invoke.

This Object-Oriented feature allows substituting a particular implementation using the same interface, and therefore it enables polymorphism.

http://en.wikipedia.org/wiki/Dynamic_dispatch

974 questions
0
votes
1 answer

Can't dispatch custom event from one class to another in Flash AS3

This is my custom event class: package{ import flash.events.Event; public class PetEvent extends Event{ public static const ON_CRASH:String = "onCrash"; public function PetEvent(type:String, bubbles:Boolean=true,…
0
votes
1 answer

Dispatch Touch Events to Different Window (like PopUpWindow or Dialog Window)

I have one doubt related to Touch Event Dispatch. Usually Activity is associated with one Window, so if i use code like somewhat below , events are dispatched properly to corresponding view at those…
0
votes
0 answers

Macruby can not load dispatch gem in application

I want to use Dispatch gem in MacRuby to use concurrency in my app. But I got into a tricky problem with this. I tried to install Dispatch gem via 'gem install dispatch', via 'macgem install dispatch', via sudo both previous variants. But if I try…
DarkDeny
  • 1,750
  • 2
  • 21
  • 31
0
votes
1 answer

How to suspend async task in iPhone?

I'm using async task for fetching images from Web on my main view controller. When user click on any cell on my table view I would like to suspend the Async tasks and go to another view.How Can I do this? Also I need to continue the tasks when user…
Harikrishnan
  • 9,688
  • 11
  • 84
  • 127
0
votes
2 answers

Is there a way to infer the type of an object?

This may be a stupid question, I suspect I know the answer (no) because I seem to be hitting a wall here. Given I have a collection of objects derived from certain class: class BaseClass; class DerivedA: public BaseClass; class DerivedB: public…
uorbe001
  • 187
  • 3
  • 10
0
votes
2 answers

iOS: table view created before xml parsing complete

OK I'm hoping I'm missing something basic here - I am not very expert at this. It should be self-explanatory without example code: I parse a web-hosted xml file consisting of a list of titles to be displayed in a tableView and associated URLs to…
0
votes
2 answers

Selecting the right strategy based on two object types

I'm not sure how to name this problem, so I'm going to try to explain as good as I can. I want to be able to switch strategies depending on the types of two different objects. To make this work, I am thinking of flagging the objects with an enum…
uorbe001
  • 187
  • 3
  • 10
0
votes
1 answer

zend 2 widgetized contents

i am trying to create a widgetized contents.. basically i want to have blocks in my layout that gets populated from different module/controller/actions ... i tried using $this->action in view but it seems that action has been removed in ZF2 (or not…
Exlord
  • 5,009
  • 4
  • 31
  • 51
0
votes
1 answer

How can I stop the Dispatch Queue

I am using Dispatch Queue for loading the images but I don't know how to stop the queue if I don't want it to load all the images at some point. - (void) loadImageInBackgroundArr1:(NSMutableArray *)urlAndTagReference { myQueue1 =…
0
votes
1 answer

Automating an Application using COM

I am building an automation interface for an existing application. After implementing a DLL server and an EXE server (mainly for getting familiar with the basics of COM) I am now at the point where I generate a type library from an IDL file and can,…
Dabbler
  • 9,733
  • 5
  • 41
  • 64
0
votes
1 answer

Struts 1.3: when is better to use DispatchActions than Action?

In what cases is better to use DispatchActions than Action?
Sefran2
  • 3,578
  • 13
  • 71
  • 106
0
votes
2 answers

How can I wait for result from geocodeAddressString iPhone

I know its something to do with locks or dispatch groups, but I just cant seem to code it... I need to know if the address was a valid address before leaving the method. Currently the thread just overruns and returns TRUE. I've tried locks,…
Aardvark
  • 608
  • 5
  • 15
0
votes
0 answers

Memory management in dispatch

I try to make thumbs on my iPad app of all the view in the background using the following code: NSString *path = [self.page previewPathForOrientation:currentOrientation]; dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ …
cboe
  • 469
  • 1
  • 9
  • 25
0
votes
1 answer

NSArrayM was mutated while being enumerated

App crashes with error: *** Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <__NSArrayM: 0x21481c10> was mutated while being enumerated.' This happen only if I move over mapview when my annotations is…
Pavel Kaljunen
  • 1,291
  • 2
  • 26
  • 53
0
votes
1 answer

cocoa: dispatch design pattern

-(void) test{ for(Person *person in persons){ __block CGPoint point; dispatch_async(dispatch_get_main_queue(), ^{ point = [self.myview personToPoint:person]; }); usePoint(point); // take a long time to…
NOrder
  • 2,483
  • 5
  • 26
  • 44