Breaking News
Home / iOS / iOS Snippets (page 4)

iOS Snippets

Some useful Box 2D macros

BOX2D has uses meters as a unit for length and width. However the objects need to be draw on screen in pixel sizes. The following macros helps with those conversions. #define PTM_RATIO 40.0f #define SCREEN_TO_WORLD(n) ((n) / PTM_RATIO) #define WORLD_TO_SCREEN(n) ((n) * PTM_RATIO) #define B2_ANGLE_TO_COCOS_ROTATION(n) (-1 * CC_RADIANS_TO_DEGREES(n)) #define COCOS_ROTATION_TO_B2_ANGLE(n) …

Read More »

How to find out SVN version?

Answer Simply run the svn client with the version argument and it would echo back the SVN client version. mymac:ios-apps mvohra$ svn –versionsvn, version 1.6.17 (r1128011)   compiled Nov  8 2011, 18:14:46 Copyright (C) 2000-2009 CollabNet.Subversion is open source software, see product includes software developed by CollabNet (http://www.Collab.Net/).<!

Read More »

How to compute SHA1 digest for NSString?

Computing SHA1 (Message Digest). The following is implemented as extension to NSString. // //  NSString+Hashing.h   #import <Foundation/Foundation.h>   @interface NSString (Hashing) – (NSString *)sha1; @end   // //  NSString+Hashing.m   #import "NSString+Hashing.h" #import <CommonCrypto/CommonDigest.h>   @implementation NSString (Hashing)   – (NSString *)sha1 {         NSData *data …

Read More »

iTunes Connect changes June 2012

Itunes Connect changes (June 2012) App and In-App Catalog Reports Now Available Catalog reports provide you with extended information for all of your apps and In-App Purchases. To view and generate reports, go to the Catalog Reports module on iTunes Connect. New reports can be generated only once every 24 …

Read More »