Building and running my app project with OHAttributedLabel as sub-project works great. But archiving my app failed with the error says OHAttributedLabel.h can't be found.
Is there any other options to set except User Search Path - mentioned in renewed README -?
I saw this issue too, I'm searching for a way to fix the configuration for it to work in all cases.
Meanwhile, you can replace the User Header Search Path in your application's build settings to the relative path where the OHAttributedLabel's headers are located on your disk (probably something similar to ../OHAttributedLabel for example if the project is next to your application's project)
Fixing #90 and Build Paths in project so that inclusion of headers wo…
…rks in all cases.
Note: now headers should be #imported using <OHAttributedLabel/header.h> in the application project to work (this is quite more clean anyway)
Just commited a fix that should make include path more logical and work in all situations.
Note that since this fix, the headers needs to be imported using angle brackets and framework-style, as in #import <OHAttributedLabel/OHAttributedLabel.h>, instead of #import "OHAttributedLabel.h", and then there seems to be no need to set the "User Header Search Path" in your application project anymore.
Let me know if it better work for you (once you changed your #imports to angle brackets style) in all configurations so I can close the issue.
Updated README instructions for the new include path fix (#90)
To me, it works well for both building and archiving.
I did unset "User Header Search Path" also.
It is still happening for me, with the latest version.
I added the source folder to the user header search paths and imported the files as normal file import instead of framework to solve it...
Thanks for the feedback @AnoxySoftware !
Can you please help me understand why this does not work for you by giving me some detail?
Thanks for any information.
I hope I can fix the settings so that my project will be as portable as possible in everyone's possible configurations (as I use the same system / configuration settings for all my other libraries to ease their integration as much as possible for the user)!
I'm using Xcode 4.5.1 on OSX 10.7.5
Well, the foders settings are a bit different. So my project's folder is DocumentsDir\Project\Project\Classes
However my xcodeproj is located in: DocumentsDir\Project\project.xcodeproj
OHAttributed label was cloned from git and located in DocumentsDir\OHAttributedLabel
So the xcodeproj, are siblings, but the classes I'm referring to the library not.
There are not custom settings or overriders.
Thanks I will investigate based on this.
But my question regarding projects being siblings was related to the project integration in Xcode, not in the Finder
The preferred way in Xcode 4 is using a workspace that includes all the projects as sibling projects (2nd case). If you included OHAttributedLabel as a subproject (as in case 1) I guess that this may explain the differences in configuration.
I actually placed the OHAttributedLabel as a subproject inside the "Frameworks" folder in xCode.
Ok so that probably explains the difference.
Just to confirm the origin of the problem, could you try by adding it as a sibling project in your workspace instead of a subproject of your app project, as recommended in the README, an tell me if this works with this configuration?
Thanks for the feedback.
Same probleme here. I'm using OHAttributedLabel with RestKit, SDWebImage & GPUImage.
My header search paths are:
I adde OHAttributed in the following way:
When running in simulator or on device all works fine. When trying to archiving I'm getting the error message "'OHAttributedLabel/OHAttributedLabel.h' file not found"
What to do?
Sibling project in workspace: http://srv1.s4lmedia.de/12/1011/774tc606k07.png
Both doesn't work when trying to archive.
Can you help please?
Thanks a lot..
Maybe this helps you: when I edit my schemes and set the build configuration for "Archive" to "Debug" it works.
I can't find a solution for this... :(
So the conclusion, as explained by @AnoxySoftware is that :
@TimE90 : did you actually try to add the path to the headers in your HEADER_SEARCH_PATH or your USER_HEADER_SEARCH_PATH setting of your app (as suggested above, as explained by @AnoxySoftware and I you probably did for the other libraries/projects your are including in your app)? This would normally solve the issue as explained.
It is quite strange that it works when you change the configuration to Debug in Archive scheme but does not work in Release Archive. I tried this configuration both on my personal Mac and the ones at work and it worked even for Release Archive when adding the project as a sibling in the workspace. Anyway, same questions as for @AnoxySoftware (version, custom build directories settings, etc) to help me understand the differences in our configurations.
Also, where did the OHAttributedLabel headers gets installed when you archive your product? It should be in one subdirectory of the "ArchiveIntermediates" DerivedData's directory
Are you sure you have kept the "SKIP_INSTALL" setting to NO for the lib in Release config, so that the headers are "installed" / copied in the ArchiveIntermediates subdirectory and that the archived app can refer to them using the correct relative path?
Anyway, whatever the answers and your configuration anyway all this how-to in the README was aimed to avoid you to add the relative path of the headers to your USER_HEADER_SEARCH_PATH. But if the compiler have trouble finding the headers anyway, simply adding their path in the USER_HEADER_SEARCH_PATH as you usually do when adding an external lib should solve this compilation issue of your app.
No.. I don't get it to work..
I added as a sibling project. I added relative path to "HEADER_SEARCH_PATH" and to "USER_HEADER_SEARCH_PATH". The "SKIP_INSTALL" is set to "NO" (Debug & Release).
I can't explain this behavior. Do you have Skype? Maybe I can do a screen share and you can look what's wrong?
Best Regards & thanks a lot!
If I use the "Release" config it builds just fine.
But when using the "AdHoc Config" (duplicated from Release) I'll get the error..
I'm getting this warning and i've got the project as sibling in my workspace
Same Error as TimE90. Archived in Release no problem, Archived in a Release duplicate (Distribution) didn't work.
Compile for debug it's working too.
Yes this is because the header files are searched in the folder corresponding to the configuration the project was built with. If your application uses a "Distrib" configuration, the project will try to find the headers in "Distrib-iphoneos" whereas the OHAttributedLabel project has only "Release" and "Debug" configurations :
And thus they will be built in two different subfolders and the application files won't find the OHAttributedLabel headers automagically.
So in case you have a special configuration other than Debug or Release, you will have to specify the path to the version (Debug or Release) of OHAttributedLabel you need to search, for each configuration of your Application:
Note: don't forget the quotes around the above settings.
These values are used by Xcode by default if your configuration names are the same (that's why you don't need to add these values if your configuration names in your application project matches the ones in OHAttributedLabel project namely Debug and Release), but you need to specify them if you use different configuration names.
README: more details about header paths / #90
I did all that and it still does not work. I ended up using an older version I found :(.
What solution did you try what error did you get? Can't help w/o more info…
Did you try setting the header search path to the source path directly as one usually do when linking with external library?
I did set header and library path and included the project in the work space (not as subproject), and linked both frameworks. I tried some different combinations after that, but I could not make it work, never finds the <../..>.
I meant: did you set the header path to point to the original headers (instead of the path to where they are installed/copied after compilation) ?
Try setting your Header Search Path to the (relative) path to the folder where you have the OHAttributedLabel source code (and where the original header files are), instead of setting it to the path where they are installed after compilation.
Header Search Path
I already had that because it was in a folder together with other frameworks I use
Of course when you use that kind of Header Search Path, you try #import using quotes #import "OHAttributedLabel.h" and not square braces, right?
To be clear:
Removing Installation & Install Path ; back to importing quoted heade…
…rs (and not square brackets headers).
This has the disadvantage of forcing the user to add the path to the "Header Search Paths" in his own project's Build Settings, but is more classic and will avoid issues described in #90
If you have different build configurations in your application, for example in my project I have Debug, Release, Enterprise. Add same Configuration to OHAttributedLabel project. That fix my issue