Re: IB not recognising custom view
Re: IB not recognising custom view
- Subject: Re: IB not recognising custom view
- From: Fritz Anderson <email@hidden>
- Date: Wed, 15 Oct 2008 19:14:10 -0500
On 15 Oct 2008, at 7:04 PM, DKJ wrote:
I created MyView as a subclass of NSView. I then compiled it into a
static library. I referenced both libMyView.a and MyView.h in a
project. In IB I put a custom view into the main window for that
project, and set its class to MyView.
There's no problem building. But when I run it, I get this error:
Unknown class 'MyView' in nib file, using '(null)' instead.
What's wrong here?
It's not a problem with Interface Builder -- it's letting you set the
class, and it's encoding it. The problem is that your application
doesn't recognize the class when it comes in from the NIB.
1. Are you sure libMyView is in the "Link Binary with Libraries" build
phase for your target?
2. If so, try adding -ObjC to the "Other Linker Flags" build setting.
Objective-C classes and methods don't get statically linked, and the
linker "intelligently" strips them out when linking from a static
library. Remember to set this for all configurations of the target
(set the Configuration: popup to All Configurations).
— F
--
Fritz Anderson -- Xcode 3 Unleashed: Now in its second printing -- <http://x3u.manoverboard.org/
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden