Category Archives: Objective-C

How to Fix ‘Warning : Multiple Build Commands For Output File' ?

By | June 14, 2011

Hi, The following warning, ‘Multiple Build Commands For Output File’ occurs when you try to delete resource files by ‘delete reference’ other than the correct method of‘move to trash’ while deleting files from ‘Resources’ folder of your project. Therefore the Copy Bundle Resources still holds the references of the same file you have deleted and… Read More »

How to Fix ‘Warning : Multiple Build Commands For Output File’ ?

By | June 14, 2011

Hi, The following warning, ‘Multiple Build Commands For Output File’ occurs when you try to delete resource files by ‘delete reference’ other than the correct method of‘move to trash’ while deleting files from ‘Resources’ folder of your project. Therefore the Copy Bundle Resources still holds the references of the same file you have deleted and… Read More »

How to Fix ‘Warning : Multiple Build Commands For Output File’ ?

By | June 14, 2011

Hi, The following warning, ‘Multiple Build Commands For Output File’ occurs when you try to delete resource files by ‘delete reference’ other than the correct method of‘move to trash’ while deleting files from ‘Resources’ folder of your project. Therefore the Copy Bundle Resources still holds the references of the same file you have deleted and… Read More »

How to detect shake in iPhone ? An example

By | April 13, 2011

Hi, Sometimes you may want to detect shake gesture in iPhone using your programs. But how can you detect shake gesture in iPhone? Shake gesture in iPhone can be detected by using the accelerometer. The following lines of code can be used for detecting the shake gesture in iPhone. You can use these lines of… Read More »

How to remove box2D body from world ?

By | April 10, 2011

Hi, If you are a game developer and you are using box2D for real world simulations, you would probably need a particular body to be removed from the box2D world! But how can you remove box2D body from world ? See the following sample code which does the same. – (void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {… Read More »

How to empty an NSMutableArray ?

By | April 6, 2011

Hi, Sometimes you may need to empty an NSMutableArray which is already initialized with some objects. You don’t need to release it and again alloc it for future use! You can simply empty an NSMutableArray using the following line of code. [yourArray removeAllObjects]; Here ‘yourArray’ is your NSMutableArray. 🙂

Cocos2D Sprite Sheet Animation

By | March 29, 2011

Hi, Suppose you have a sprite sheet of the desired animation you want. But how will you use that sprite sheet animation in your program using cocos2D? That’s simple. See the following code first. Note : But how to make a sprite sheet? That topic can be found here. Making of sprite sheets from individual… Read More »

Email id verification using Objective C

By | March 29, 2011

Hi, In order to verify an email address you have entered is valid or not using Objective C, use the following code. – (BOOL) checkYourMail: (NSString *) myEmail{ NSString *checkMail= @”[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}”; NSPredicate *matchMail = [NSPredicate predicateWithFormat:@”Matching %@”, checkMail]; return [matchMail evaluateWithObject:myEmail]; } 🙂