From: Wolfgang T. <wol...@gm...> - 2005-07-22 02:57:47
|
> To make it more interesting, it uses the > "performSelectorWithObject" method on itself. When I do this, my > application crashes. I found the problem. performSelectorWithObject calls a method that takes an object parameter _and returns an object_. You need to declare: $(declareSelector "dummy:" [t| forall a. NSObject a -> IO (NSObject ())|]) and return nil from the method. When performSelectorWithObject calls a method without a return value, it passes on whatever (garbage) value it finds in the machine register R3 that would have been used for the return value. When HOC tries to convert that garbage value back to a Haskell object, it crashes. I'll try to add some additional sanity checks there so that we can at least have better error messages. Cheers, Wolfgang |