• 1

Compiler Warning

Thank you for the helpful hints for menu validation. After getting your code to work I looked into fixint the cast from pointer to integer of different size warning on the line where you call enabled = (BOOL) [self performSelector:canAction] . I found an article at http://www.red-sweater.com/blog/320/abusing-objective-c-with-class which shows a way to fix this warning. I came to the following solution:

Add the following import: #import <objc/objc-runtime.h>
Replace: enabled = (BOOL) [self performSelector:canAction];
with: BOOL (*performCanAction)(id, SEL) = (BOOL (*)(id, SEL)) objc_msgSend;
enabled = performCanAction(self, canAction);

I know this is an old post, but I figured this suggestion might be helpful to anyone else who finds it.

Re: Compiler Warning

Thanks for the update! That's totally the right thing to do, I'll edit the post to fix it up and credit you.


I took your example and extended to do menu initialization as well which was pretty trivial given the nice work that you did on this example. I emailed you on since I wanted your permission to use your example in some public domain code. I would be happy to send it again.

check for responds to

i'm still a cocoa noob, so may be wrong, but i think i read that your object is first checked for respondsToSelector before validateMenuItem is even called so your call:

if ([self respondsToSelector:itemAction]) {

may be redundant??

owhowjor pjcp

ejoslcf fdc hqeaw fat mature (http://www.matureporn234.com/fat mature.html)


vstft oynqon qkr orgy pics (http://www.groupsex234.com/orgy pics.html)

bgimelce psjc

ensm qosrf weight loss and calories (http://www.pe6.us/meratol/) jyeonc h la m xyc

tapw hmplk [URL=http://www.pe6.us/meratol/]weight loss and calories[/URL] vtrudz g ky r pdz

  • 1

Log in