NSView/NSResponder returns YES
NSView/NSResponder returns YES
- Subject: NSView/NSResponder returns YES
- From: Leanne Attard <email@hidden>
- Date: Wed, 12 Jan 2011 06:14:16 -0800 (PST)
Hi all,
I am having a problem with NSView/NSResponder class. I need to override the NSView method acceptsFirstResponder method as from the documentation i have read the NSResponder method returns NO by default. However with the code i am using below i am getting a YES already without overriding. Just to brief you i am creating a java application which creates a JFrame and then i am taking the native part of AWT from it which is an NSView instance so i suppose it can be considered as NSResponder and so i expect a NO.
NSView* nsview = (dsi_mac->cocoaViewRef);
if ([nsview acceptsFirstResponder]==YES)
printf("****Accepted first responder****\n");
and the output is
****Accepted first responder****
Another question is that i need to subclass the NSView and then create an instance of this new subclass from the NSView i have from the the AWT, how can i do is? Casting of NSView* to MyNSView* is not working, which i suppose it is because i am just casting the pointer and not the object pointed to.
Any hints what is going on please?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden