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

Flex Event.ID3 dispatches twice

Why does this code mySound.addEventListener(Event.ID3, myID3Handler); cause the myID3Handler to run twice ?! I also notice that values provided to the handler are not the same, actually the second being the correct one. Thanks
kla.us
  • 1
  • 1
0
votes
1 answer

Nothing happens after calling [table reloadData] when called with dispatch_async

- (void) setRooms:(NSArray *)newRooms { NSLog(@"Main thread(cp3)... %d", [rooms count]); rooms = newRooms; [table reloadData]; NSLog(@"Main thread(cp4)... %d", [rooms count]); } - (void)…
0
votes
2 answers

infinite loop inside the getmessage (DispatchMessage(& msg ); is not working)

I am creating a button application using resource editor. After creating button I try to do like this- m_hwndPreview = CreateDialogParam( g_hInst,MAKEINTRESOURCE(IDD_MAINDIALOG), m_hwndParent,(DLGPROC)DialogProc, (LPARAM)this); if…
Sss
  • 1,519
  • 8
  • 37
  • 67
0
votes
1 answer

Polymorphic dispatch using boost::shared_ptr

I'm trying to call overloaded functions based on the derived type of a pointer in a vector. I have a base class, Fruit, and create a vector of shared_ptr. I then push shared pointers of decendents into the vector. So far, so good (the issue…
Thomas Matthews
  • 56,849
  • 17
  • 98
  • 154
0
votes
1 answer

Polymorphism in AspectJ

I am trying to decide which is the better way to dispatch on a type in AspectJ. Suppose I am performing a computation on a tree with three kinds of nodes. I could then write a simple Java method: private void computation(TreeNode node) { if…
Jørgen Fogh
  • 7,516
  • 2
  • 36
  • 46
0
votes
1 answer

UILabels animation called by delegate/protocols structure

I want to use a little animation for my labels. If I try to call this animation from a IBAction button or ViewDidLoad and all work correctly. - (void)animateLabelShowText:(NSString*)newText characterDelay:(NSTimeInterval)delay { …
Alessandro Ornano
  • 34,887
  • 11
  • 106
  • 133
0
votes
1 answer

WPF MessageBox returns keyboard focus to wrong control

Update: Discusion revealed that the problem is only arising, when you have the custom control text box hosted within a wpf application that is again hosted via elementhost within a winforms application. I have a WPF-CustomControl inherting from…
user1182735
  • 764
  • 9
  • 21
0
votes
1 answer

Received memory warning: Why does my app crash with many simple animations?

I have in my application many animations (like a 70, 10 in 7 viewcontrollers) with the same type of voids and functions, and when I run on my device or in the simulator, the application crashes. How can I improve these animations using threads or…
0
votes
2 answers

Why does magento catch wrong event from admin section?

I have set up a default 'no modifications' copy of magento on a local machine to replicate the results on our production machine. When I try to catch the event 'adminhtml_customer_save_after' in a module, it always returns / stops on…
CarComp
  • 1,929
  • 1
  • 21
  • 47
0
votes
4 answers

Polymorphism - Simple

Just confused on how to following answer is correct. class Cat { public void isClawedBy(Cat c){ System.out.println("Clawed by a cat"); } } class Kitten extends Cat{ public void isClawedBy(Kitten c){ …
user2469515
  • 373
  • 3
  • 12
0
votes
2 answers

Class Loading in Phalcon for plugins

When adding a dispacher in the services.php it doesnt seem to have access to the autoloader to include class's. Example: /config/services.php $di->set('dispatcher', function() use ($di) { require __DIR__.'/../../app/plugins/security.php'; …
0
votes
1 answer

Flash AS3 Event Function with Arguments

I need to make a event function that has parameters you pass in, that would look something like this. public function foo(e:Event, args) { trace(args[0]); } addEventListener("fooEvent", foo); dispatchEvent(new…
0
votes
3 answers

dispatch_sync block my UI, I cant click any button

I have 2 blocks with dispatch_sync, when the first block ends I show the window for the user and starts run the second block. But I'm not getting click any button on the screen until the second block ends.. Look the code: [HUD…
0
votes
3 answers

iOS Delay even when using dispatch

I have a wallpaper app that has a paged scrollview on the main view. each page of the scrollview displays 9 images. When the view is scrolled I'm loading the next 10 pages of images and set the previous 10 pages uiimages that I've loaded to nil to…
Mona
  • 5,939
  • 3
  • 28
  • 33
0
votes
1 answer

AS3 How to dispatch timer event to another class?

I am trying to dispatch event every second from Mytimer class and catch the event from Main class. I've declared variable "sus" as integer = 10. I have nothing so far, no output, nothing. Some help please! This is Mytimer.as private function…
irnik
  • 139
  • 1
  • 2
  • 13