NSInternalInconsistencyException
My Cocoa Distributed Objects code was getting some very odd crashes:*** Uncaught exception: <NSInternalInconsistencyException> can't determine size of @:@
In an effort to improve efficiency, my server exposes methods that return pointers to the raw C structs it works with. The client collates some of these, then passes them back to the server to use them in a method call.
The safer way uses an NSObject wrapper around those pointers. This doesn't cause the crash.
It seems obvious now, but the problem was the Distributed Objects system. Returning a pointer causes it to either make a proxy or serialise the subject of the pointer, as the pointer isn't useful outside the server's address space. With the C object, it spazzed out.
In my case, where I'm not wanting to use the pointer in the client, this behaviour is very annoying! Casting to an int on both ends is fine, but non-portable. All I want is to pass a pointer by value!
So, my choices: find a way to pass pointers without Objective-C pissing about with them; use int; or stick to my inefficient object-passing approach.
*sigh*
Posted at 2004-09-12 12:10:43 by Richard • Link to NSInternalInconsi…
Comments, trackbacks.
