Why bother with this type checking only to have it fail silently
anyway? Much better would be to simply add this to the header:
// cond must return a BOOL and take a single id argument
If you insist on a runtime check then you should throw an exception or
something similar if the method signature does not match. Simply
taking a wrong signature as NO is going to create annoying and
difficult-to-find errors.
I should also note that your call to objc_msgSend is faulty. BOOL is
one byte, but int is four and id is also four. By using a function
declared to return id and casting its return value to int, you risk
picking up junk in the return value and getting false positives.
Instead, call it like this:
Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden