Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

* | |

  Show Posts
Pages: [1]
1  PureMVC Manifold / Bug Report / [ FEATURE REQUEST] observers cast to Observer instead of IObserver on: September 06, 2008, 02:02:55
Unless I am missing something, I should be able to implement the IObserver interface in my own code, and use my own classes in View.registerObserver / View.removeObserver, and in my simple case, my implementing class uses itself as the notifyContext.

However, even though View.registerObserver takes a param of type IObserver, the implentation in View.removeObserver casts the elements of the associated 'observers' array to Observer instead of IObserver, which in my case yields a class cast exception:

line 145 of View.as:

:
if ( Observer(observers[i]).compareNotifyContext( notifyContext ) == true ) {

I am assuming this is an oversight - or is there some reason I should not be implementing IObserver in my own classes?

Thanks - unlike most of the Flex API, it's almost a pleasure to find a bug in PMVC as it's such a rare occurance  ;)

Greg
Pages: [1]