Class not recognised in xCode

32 views
Skip to first unread message

Arjen Schipmolder

unread,
Mar 2, 2016, 7:36:16 AM3/2/16
to objec...@googlegroups.com
Hi,

I’m trying to add a new Cup object (https://github.com/aparajita/Cup/wiki) to one of my classes in Xcode. I have built the framework and added it to my project and I also imported <Cup/Cup.j> in the class where I want to use the framework, but for some reason xCode doesn’t recognise the Cup class as a valid class when I set the object’s class.
As a result I also don’t have access to the outlets etc.

Does anybody know if this is something with the latest Xcode (I’m using 7.2.1)? or maybe 
xCodeCapp (I’m using version 4.0)?

Thanks
Arjen

Martin Carlberg

unread,
Mar 2, 2016, 8:59:11 AM3/2/16
to objec...@googlegroups.com
Hi,

For Xcode to find outlets it has to find the corresponding .h file that usually is created by XcodeCapp. I don’t think that has changed much over the different versions.

Can you find the .h files in your project?

- Martin


-- 
You received this message because you are subscribed to the Google Groups "Cappuccino & Objective-J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to objectivej+...@googlegroups.com.
To post to this group, send email to objec...@googlegroups.com.
Visit this group at https://groups.google.com/group/objectivej.
For more options, visit https://groups.google.com/d/optout.

Arjen Schipmolder

unread,
Mar 2, 2016, 9:15:41 AM3/2/16
to objec...@googlegroups.com, Martin Carlberg
Hi Martin,

Hmm, no I can’t find any but I haven’t noticed them before either though.
Where would you expect these to be stored?

I have also tried a reset of the project in xCodeCapp to have it regenerate any files it needs but that doesn’t seem to have made any difference.

Arjen

Martin Carlberg

unread,
Mar 2, 2016, 9:29:53 AM3/2/16
to objec...@googlegroups.com
They usually are in the .XcodeSupport directory in your project.

- Martin

Arjen Schipmolder

unread,
Mar 2, 2016, 9:36:48 AM3/2/16
to objec...@googlegroups.com, Martin Carlberg
Now that I did not know, very useful indeed.

Ok, I have the headers and implementation files for my own classes, but not for the external frameworks.
Would they be embedded in the framework after it’s been built?

Thanks
Arjen

Martin Carlberg

unread,
Mar 2, 2016, 2:49:58 PM3/2/16
to objec...@googlegroups.com
Ok, you need the Cup frameworks .h files….

It is a little more complicated  :-)

This is what I do and I’m sure someone else might have a simpler way….

1. Rename the framework to Cup.framework (you will understand why at step 5)
2. Create a link named ’Cup’ in the Framework folder that points to ’Cup.framework’ ('ln -s Cup.framework Cup’)
3. Open ’Cup.framework’ in XcodeCapp so it will create the .h files in the Cup framework.
4. Create a link named Headers in the Cup.framework folder that points to ’.XcodeSupport’ ('ln -s .XcodeSupport Headers’)
5. Open you project in Xcode and add ’Cup.framework’ to your project. The name must end with ’.framework’ for this to work. That is why the rename above.
6. Xcode will now find the .h files in the framework you have added and you can bind all the outlets.

If you don’t change the files in the Cup framework you can just do step 3 and copy the .h files manually from the Cup framework to your project. Make sure they are added to the project.

- Martin

Arjen Schipmolder

unread,
Mar 2, 2016, 2:54:17 PM3/2/16
to objec...@googlegroups.com, Martin Carlberg
I would never have thought of it myself, but it works brilliantly.
Thanks a lot!

Arjen

Reply all
Reply to author
Forward
0 new messages