Page 1 of 1

Problem with Objective-C extension

PostPosted: Mon Jul 02, 2012 6:39 pm
by udo.killermann
Bernd,

I have created a project and included an Objective-C class. When I compile the project the compiler can't find my Objective-C class. When I insert an #import statement in Global.h (within XCode) the build completes successful. I don't understand this behavior. Please look at the attached project.

Kind regards
Udo

Re: Problem with Objective-C extension

PostPosted: Fri Jul 06, 2012 8:33 am
by berndnoetscher
udo.killermann wrote:Bernd,

I have created a project and included an Objective-C class. When I compile the project the compiler can't find my Objective-C class. When I insert an #import statement in Global.h (within XCode) the build completes successful. I don't understand this behavior. Please look at the attached project.

Kind regards
Udo


Hi Udo,

sorry for the delay, I will do it the next week, promissed. Nice weekend. :)

Re: Problem with Objective-C extension

PostPosted: Mon Jul 09, 2012 9:09 am
by berndnoetscher
Two probelms:

Your project does not have the class definition (file) for ukHelper and somehow there seems to be a problem with xcode integration, because if I change your class name to aukHelper it works, because it has a different alphabetical start point in the xcode file (it interferes with objbruntime I believe). You know the xcode xml file format is not easy to read/write to.

Will fix this soon.
Thanks for your example.

Re: Problem with Objective-C extension

PostPosted: Tue Jul 10, 2012 3:12 pm
by udo.killermann
Bernd,

I'll have a look and see if your work around works for me as well.

Thx
Udo

Re: Problem with Objective-C extension

PostPosted: Wed Jul 18, 2012 9:58 am
by berndnoetscher
udo.killermann wrote:Bernd,

I have created a project and included an Objective-C class. When I compile the project the compiler can't find my Objective-C class. When I insert an #import statement in Global.h (within XCode) the build completes successful. I don't understand this behavior. Please look at the attached project.

Kind regards
Udo


Udo,

after I digged into it again, I know the issue. All works fine (if you add a objc class) all files are created and the xcode project is managed correclty, but objb cannot know when to use a import statement for a custom class (and it cannot know if it is a known Cocoa class or custom class). Therefore the developer has to decide. I will add a new command for the Declare Class statement which enabled explicitly import.

Re: Problem with Objective-C extension

PostPosted: Wed Jul 18, 2012 11:40 am
by berndnoetscher
Code: Select all
Declare Class "ukHelper" "explicitly do import"


This is the new trick to tell the compiler to create an import. Actually, it must not be "explicitly do import". It can any non-empty string. The class name is used: for the #import "classname".

Code: Select all
Declare Class "ukHelper" "blahblah"