Make Better Things

I like to make better things.

Remove NSLog from whole xcode project

This is very good optimization if you remove all your NSLog statement from project. But its hard to find every NSLog and remove it if you have a big project. Well here are two tips -

1) Use ifndef to replace NSLog with blank. Here is an example -

#ifndef __OPTIMIZE__
#define NSLog(...) NSLog(__VA_ARGS__)
#define NSLog(...) {}

2) User regular expression in Find and replace to remove NSLogs

a) Press command + shift + f to open find and replace in whole project.
b) Search for


and replace it with blank

How to “add existing frameworks” in Xcode 4?

Are you not getting how to add existing frameworks in xcode 4?
Well here is the right way of doing it -

1. In the project navigator, select your project
2. Select your target
3. Select the ‘Build Phases’ tab
4. Open ‘Link Binaries With Libraries’ expander
5. Click the ‘+’ button
6. Select your framework
7. (optional) Drag and drop the added framework to the ‘Frameworks’ group