Parmanoir

Where in build phases is that file ?

I'm adding a new .js file to my project. It's an ObjC app, loading a .js file at runtime. I duplicate an existing .js file from the Finder then add it to resources. And … it doesn't get copied in my compiled app. Why ? It's in the wrong build phase.

Image:Xcode Build Phases.png

Moving it from Compile Sources to Copy Bundle Resources will make XCode treat that new file as a pure resource and copy it instead of trying to compile it. Simple, once you know where to look : in Files view, looking at two inspectors on both files won't show a difference, even if those files don't share the same build phase. Which will make you search for … a … looooong time if you seldom use build phases. I guess that's a new chapter in UI : the uninspecting inspector.

Does XCode have a thorough log, showing what it did to compile an app ? (Like a list of compiled files, resources and buid phases they went through)

Dmitry Chestnykh
2008 07 25

Yep. Build > Build Results > click on the tiny button with check mark.

Patrick Geiller
2008 07 25

Ah, yes. Thank you !

So … XCode warns about no rule to process file when the .js is in the wrong build phase. It uses CpResource to copy the .js if it's in the right build phase (Copy Bundle Resources).


Follow me on Twitter
Planet Cocoa
Cocoa.fr

2009 04 15Debugging with Activity Monitor
2009 03 25How Core Image Color Tracking works
2009 03 154Custom NSThemeFrame
2009 03 10Which framework is running ?
2009 03 074CoreUI can paint pretty big
2009 02 18Localization with functions
2009 01 30Did you forget to nest alloc and init?
2009 01 16JSCocoa on the iPhone
2009 01 11Mixing WebView and JavascriptCore
2009 01 09Badge overflow
2009 01 09Find your Garbage Collection leaks with Instruments
2008 12 19384 percent dynamic
2008 12 15Class pairs and super
2008 12 113Redirecting NSLog to a file
2008 12 10Whoops ! super is not runtime
2008 12 09Don't overload release or retainCount in JSCocoa
2008 12 05Sidestepping JavascriptCore's JSEvaluateScript
2008 12 031Multiple processes rendering to one window
2008 12 02When does autorelease release ?
2008 12 02Process Sandboxes : an easy path to security ?
Image:rss.png
Image:rss.png

Powered by MediaWiki

Hi ! I'm learning Cocoa to (hopefully !) become an indie developer.

I've written software all my professional life, in C++, PHP, Javascript. I've designed websites and web interfaces. My last venture went into flames as clients were happy but didn't like paying very much.

I've had little luck in the B2B world, I'm hoping for a better future writing Mac applications.