Re: Compile Error: undeclared (first use in this function) --> While Init'ing an Object
Re: Compile Error: undeclared (first use in this function) --> While Init'ing an Object
- Subject: Re: Compile Error: undeclared (first use in this function) --> While Init'ing an Object
- From: Chris Tracewell <email@hidden>
- Date: Tue, 22 Jun 2010 14:27:58 -0700
On Jun 22, 2010, at 2:11 PM, Kyle Sluder wrote:
> On Tue, Jun 22, 2010 at 2:03 PM, Chris Tracewell <email@hidden> wrote:
>> I have my own custom framework. The framework builds fine but when I link to it in one of my projects one class is causing a compile error of...
>>
>> 'MyClass' undeclared (first use in this function)
>>
>> This occurs when I am trying to init MyClass inside a view controller's .m file in one of it's methods like so...
>>
>> MyClass *theClass = [MyClass new];
>
> Did you remember to #import the header file that declares MyClass's interface?
>
> --Kyle Sluder
>
I did - I import one main header for the framework the imports all of the framework header files. I checked it in the linking project, it is there in the Copy phase of my target and it does import have the #import "MyClass.h" line plus I can see MyClass.h is in the Copy phase of the linking projects target as well.
However, your suggestion prompted me to try importing just <MyFramework/MyClass.h> in the view controller class that is getting the error and it couldn't find it. Then I tried the same with other classes in the framework and it was fine. It's like it's there, I can see it, but it is not finding it. As I stated in the first post I have checked several times to make sure MyClass is set to public in the framework.
Thanks
--Chris_______________________________________________
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