All Posts in IOS/ XCode

May 16, 2013 - No Comments!

Lifelike gravity with Accelerometer in Cocos2D + Box2D, Xcode Sample

Small code snippet reference for getting lifelike gravity from your accelerometer in your projects. This is for Cocos2D and Box2D but is easily changeable to your project needs whichever language you program in.

- (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration
{
b2Vec2 gravity ( 9.8 * acceleration.x, acceleration.y * 9.8);
world->SetGravity(gravity);
}

August 1, 2011 - No Comments!

Code Sign error: The identity ‘iPhone Developer’ doesn’t match any valid certificate/private key pair in the default keychain

Small issue I just ran into working on a group XCode project - I was greeted by the message "Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain". Simple fix, by going to > Project settings/ overview > Targets (select the target file) > Under Code Signing make sure your developer certificate is selected and not that of the project author that may have overwritten yours as in our case using GIT.