Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instructions for using the library in a project in Xcode #13

Closed
jobrienski opened this issue Jun 18, 2012 · 22 comments
Closed

Instructions for using the library in a project in Xcode #13

jobrienski opened this issue Jun 18, 2012 · 22 comments
Assignees
Milestone

Comments

@jobrienski
Copy link

I'm sort of a newbie to Xcode, but it's not obvious how to include this library in your project. Some other libraries I have been able to drag and drop into the Frameworks section. This one seems like you have to install it as a subproject. When I followed these instructions, however, I got errors: http://yannickloriot.com/2011/04/how-to-install-zxing-in-xcode-4/. Some instructions in the README.md would be great.
Thanks.

@scutdavy
Copy link

@jwilling
Copy link
Contributor

jwilling commented Jul 9, 2012

Is this for an iOS project, or is this for a Mac project?

@jobrienski
Copy link
Author

iOS

@jwilling
Copy link
Contributor

jwilling commented Jan 4, 2013

What exactly is the procedure for using RAC in a new iOS project? I'm switching over from the CocoaPods version, and I set up my header search paths to recursively include the ReactiveCocoaFramework folder, as well as linking to the static library. It does complain about EXTKeyPathCoding not being found, for some reason. Is there a special method for including the libextobjc folder inside of the RAC project?

@jspahrsummers
Copy link
Member

@jwilling That should've been fixed by #252. Are you on master?

@jwilling
Copy link
Contributor

jwilling commented Jan 4, 2013

@jspahrsummers Yes I'm on master with the latest version, which includes that commit. I will attempt to pull again.

@jspahrsummers
Copy link
Member

Just to double-check, is RAC actually set up as a dependency of your target?

@jwilling
Copy link
Contributor

jwilling commented Jan 4, 2013

By dependency, do you mean added as a subproject? If so, then yes.

@jspahrsummers
Copy link
Member

No, the RAC iOS target needs to be a dependency of your application target, so that the library copies headers when the project is built. You can set that up under your target's Build Phases.

@jwilling
Copy link
Contributor

jwilling commented Jan 4, 2013

Aha, now we're getting somewhere. It looks like that was the culprit. Is that for an iOS-only thing?

@jspahrsummers
Copy link
Member

That's how any dependent projects should be added (OS X or iOS), because otherwise Xcode doesn't know to rebuild them when they change. Or, in this case, if the build process has side effects that your parent project needs, they wouldn't be triggered without that dependency.

@jwilling
Copy link
Contributor

jwilling commented Jan 4, 2013

RAC does not appear to be set up correctly when building for iOS devices. It builds (and works) fine for the simulator. This appears to be caused by the "Build Active Architecture Only" switch being turned on for Debug under the iOS target. I can make a PR for this if ya'll would like.

@jspahrsummers
Copy link
Member

(Discussion moved to #255.)

@schell
Copy link

schell commented Feb 8, 2013

After altering the project to build for all architectures (which is the only way I was able to get my project running with RC) I'm now having a very similar problem, though only when attempting an archive build for distribution. Simulator and device builds both run great but when I try to archive I get a linker error: fatal error: 'ReactiveCocoa/ReactiveCocoa.h' file not found.
I'm not including the ReactiveCocoa/ReactiveCocoaFramework folder (or any others) in my search headers. When I do I get a different error: fatal error: 'ReactiveCocoa/EXTKeyPathCoding.h' file not found
I am using the NSNotificationCenter+RACSupport extension which I have added to my project by reference, though I'm not sure if that makes matters more complicated.

@Coneko
Copy link
Member

Coneko commented Feb 8, 2013

Check the top answer to this question:
http://stackoverflow.com/questions/5543854/xcode-4-cant-locate-public-header-files-from-static-library-dependancy

Archive builds put the headers in another directory compared to all other types of build, so you have to add $(BUILD_ROOT)/../IntermediateBuildFilesPath/UninstalledProducts to your header search path.

@schell
Copy link

schell commented Feb 8, 2013

Thanks, that helped, I added "$BUILD_ROOT/../IntermediateBuildFilesPath/UninstalledProducts/include" to my User Header Search Paths and set Always Search User Paths to YES.

Xcode can be pretty wacky sometimes.

@jspahrsummers
Copy link
Member

@Coneko Great answer. Would you mind PRing that into the README instructions? 💚

@nickcheng
Copy link

@schell Have you tried today's new Xcode 5 GM? It seems that the same problem happened again here. When I try to archive, I get fatal error: 'ReactiveCocoa/ReactiveCocoa.h' file not found again.

@sh-rp
Copy link

sh-rp commented Sep 15, 2013

Same Problem here, see #793. Maybe this is some kind of Migration issue? Starting a clean project worked for me..

@nickcheng
Copy link

I've solved this problem. In my case, clean project didn't work.

In Xcode 5 GM, standard architecture includes both 32-bit and 64-bit. If your app would support iOS version prior to 6.0, you'll get a warning when you compile project under standard architecture. That's why I got the error above.

I changed architecture to $(ARCHS_STANDARD_32_BIT) solved this.

Ref: CocoaPods/CocoaPods#1352

@sh-rp
Copy link

sh-rp commented Sep 15, 2013

Thanks for pointing this out Nick. I set the standard architecture of my main project to $(ARCHS_STANDARD_32_BIT), but that didn't help in my case. Still looking into it. It does make sense though that it has to do with the 64 bit architecture.

@hanpagnarith
Copy link

zz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants