Archives
All Posts Tagged
Tag: ‘iphone’

Decode HTML characters in iPhone SDK with Objective-C

Just create an interface by following this code. @interface MREntitiesConverter : NSObject { NSMutableString* resultString;}@property (nonatomic, retain) NSMutableString* resultString;- (NSString*)convertEntiesInString:(NSString*)s;@end @implementation MREntitiesConverter@synthesize resultString;- (id)init{ if([super init]) { //resultString = [[NSMutableString alloc] init]; } return self;}- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)s { [self.resultString appendString:s];}- (NSString*)convertEntiesInString:(NSString*)s { if(s == nil) { NSLog(@”ERROR : Parameter string is nil”); } …

Read More

Showing UIAlertView on cocos2d Scene/Layer

This can be done easily just like when you are working with the standard ViewController. Here is the sample code… UIAlertView *alert = [[UIAlertView alloc] init]; [alert setTitle:@"My Title"]; [alert setMessage:@"My message"]; [alert setDelegate:self]; [alert addButtonWithTitle:@"OK"]; [alert addButtonWithTitle:@"Cancel"]; [alert show]; [alert release]; With this, you can detect which button was pressed by handling the alertView …

Read More

The most easiest method to add a splash screen for your iPhone application

Well done, I don’t know if there is any other framework that let you add a splash screen easier than the iPhone SDK or not. I never see it. What you want to do is just creating your splash screen image in PNG format which have 320×480 resolution for portrait or 480×320 if your app …

Read More

Prevent your iPhone app from entering into Sleep/Standby mode

I’m not quite sure why it’s so easy than I ever think of. But it is! [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; It just disables the Idle Timer of iPhone OS for my application. Sweet!

Read More

How to capture a screenshot for your app by the app itself

It just likes what you did by running the app and hold the stand-by button then push on the home button. When you run this code, it will capture the current screenshot and add into the Camera Roll. It’s not yet included in the official SDK but you can get it run easily. @interface UIApplication …

Read More

iPhone screen resolution for developers and graphic designers

Credited to “The iPhone Developer’s Cookbook” which I think is the best book for beginner to getting started on iPhone SDK development.

Read More