[Tip]no rule to process file “blabla” of type sourcecode.javascript for architecture i386 on xcode4

Leave a comment

On Xcode3

Go to Targets, click the arrow, and drag the unprocessed file from the “compile sources” folder to the “Copy Bundle Resources”

then do a “clean all targets” from the main menu and try to build again.


Since the Target node is gone in the project tree in XCode 4, you have to do the following

1. click on the project node (the blue one with the Xcode icon)

2. click on the tab labeled ‘Build Phases’

3. open the panel labeled ‘Copy Bundle Resources’

4. click the ‘+’ button at the lower left hand corner of the panel

5. add the .js file


[Recommendation]Things you need to know about iOS5

Leave a comment

I would like to share an awesome post about the introduction of iOS5 for developers. Please check it out before coding on it.


[Tip]error: cast to ‘id’ of a non-Objective-C to an Objective-C pointer is disallowed with Automatic Reference Counting


This error will appear when you compile your project with Xcode 4.2. Because of the new mechanism named ARC(Automatic Reference Counting). You could check out the document here: Programming With ARC Release Notes .

It could happen in this way: 

CALayer *imageLayer = [CALayer layer];

imageLayer.contents = (id) image.CGImage;

It is pretty easy to fix this problem,

just change “id” to “objc_unretainedObject“.

Hopefully this could help you out a little bit. Enjoy coding 🙂

No architectures to compile for (ARCHS=i386, VALID_ARCHS=) error when compiling old projects with Xcode 4


When i compile an old project, i got this kind of error. In case someone else was also hindered by this, check out the screenshots below.

Change the settings under “Target”:

Tab “Architectures”:

Change Tab “Valid Architectures” from this:

to this (just add “Any iOS Simulator SDK : i386”):

Good luck!

Add new theme to Xcode 4

Leave a comment

original post

This is pretty simple.

open terminal, and run mkdir -p ~/Library/Developer/Xcode/UserData/FontAndColorThemes

and download theme file which has the extension .dvtcolortheme.

Move those files to the above folder.

Then just restart your xcode4, you should see it under Preferences -> Fonts & Colors.

Here are the themes files you could use:

  1. Blackboard ported from TextMate to Xcode 4 by @CocoaSamurai
  2. EGO and EGOv2 by Enormego.
  3. Stevenf‘s dark theme.
  4. Spacedust by Michael Hallendal.
  5. Twilight ported from TextMate to Xcode 3/4 by @slant.
  6. Morrowind ported from TextMate to Xcode 3/4 by Nate Stedman.

In addition, here is a python script and a ruby version to convert themes from Xcode 3 to Xcode 4 by mrevilme(Instructions).

[Update]How to make Cocos2d 1.0 work with Xcode 4

Leave a comment

Xcode 4 template was offically released. Xcode 4 template

1.run the command in terminal (before running this, please make sure you install git first “git client“).

git clone git://github.com/cocos2d/cocos2d-iphone.git


2. run these comamnds in terminal one by one

$ cd cocos2d-iphone

$ git checkout develop

$ git pull

$ ./install-templates.sh -f -u


3.Then you should see the template “cocos2d” under iOS.


any other problems about his, please refer here.

Useful tools to create Sprite Sheets

Leave a comment

Hey Guys,

I’d like to introduce two useful tools to creat Sprite Sheet. And both tools can be run on MAC and PC.

The first one is called SWFSheet (http://bit.ly/hrwXZH). As you can see from the name, it load the SWF file and you could save it into a single Sprite Sheet file or multiple files with common formats supported(jpg, png…). That is, you could create your animation with tools which could export the file as SWF, then use this tool to get your sprite sheet. In addition, it support animation preview which you will see in your game.


The other one is called Sprite Sheet Maker (http://bit.ly/hU52x3), with it you could load multiple graphic files and arrange them in sequence you want and then save into a sprite sheet.png file. But the limitation of it is currently it just supports importing png files.

Please enjoy!

Older Entries