I'm trying to set up cedar and having difficulty getting it to work. I'm trying to follow the instructions on github.
I'm using xcode 4.2.
The first step I'm not sure about is this:
"Create a Cocoa Touch "Application" target for your tests in your project. Name this target UISpecs, or something similar."
a) I'm not sure if I'm able to use ARC for my main application when testing with cedar. b) I'm pretty sure I'm not able to use ARC for building cedar itself, and I don't think I'd want to. c) I'm not sure I'm able to use ARC for the tests project that will house my specs. d) I'm not sure which application template I should use to create the application to house the specs.
I created a new main application using ARC and the single window application template. I created a new application to house my specs without ARC, using the empty application template.
When I open the plist.info file for the test application that houses my specs, I don't see an option for "Main nib file base name". So I am ignoring this step.
Now I come to the step:
"Add the Cedar-iOS static framework to your project, and link your UISpecs target with it."
So I went to the specs application build target and added the ~/Library/Developer/Xcode/DerivedData/Cedar-borwneaogydgaodbtmfyaccykqxn/Build/Products/Debug-iphoneos/libCedar-StaticLib.a file to the project under the "link binaries with libraries" tab under the "build phases" tab.
Then I added -ObjC, -lstdc++ and -all_load to the Other Linker Flags build setting for the UISpecs target.
Next, under the application that houses the specs, I created a new file called TestSpec.m and added this code to it, in an attempt to get a failing spec:
#import <Cedar/SpecHelper.h>
SPEC_BEGIN(FooSpec)
describe(@"Foo", ^{
it(@"should do something", ^{
expect(0).to(equal(1));
});
});
SPEC_END
When I tried to run the specs project in the simulator, I got some errors about alloc and autorelease not being supported when using ARC. I suppose this means my main application cannot use ARC while my spec application does not. I deleted my spec application and tried again, this time using ARC.
I removed the autorelease pool and release code from the main.m code to comply with ARC.
I now get two build errors:
1) in main.m: file://localhost/Users/nelsond/workspace/BIM360UIArchitecture/BIM360UIPrototype/BIM360Issues-IOS/BIM360Issues-IOS-Specs-ARC/main.m: error: Lexical or Preprocessor Issue: 'Cedar-iOS/Cedar-iOS.h' file not found 2) in TestSpec.m: file://localhost/Users/nelsond/workspace/BIM360UIArchitecture/BIM360UIPrototype/BIM360Issues-IOS/BIM360Issues-IOS-Specs-ARC/TestSpec.m: error: Lexical or Preprocessor Issue: 'Cedar/SpecHelper.h' file not found
I'm pretty stumped on what to debug next.
Here is some points that I encountered when integrating Cedar in my iOS application.
"Cedar-iOS static framework" seems to refer the following folder: ~/Library/Developer/Xcode/DerivedData/Cedar-borwneaogydgaodbtmfyaccykqxn/Build/Products/Debug-iphoneuniversal/Cedar-iOS.framework . Not the one with .a extension.
I was able to enable ARC without any issues since the static framework already compiled without ARC.