Thursday, November 25, 2010

Invisible UIActivityIndicatorView loading activity indicator on iPhone4

I found that a UIActivityIndicatorView is invisible on iphone4 while it's working fine on simulator or earlier iphone version. And it's because "UIActivityIndicatorViewStyleWhiteLarge" is invisible on white background on iphone4. After change style to "UIActivityIndicatorViewStyleGray", it shows up but no "large" option.

Tuesday, November 23, 2010

Push Notification:iPhone deviceToken convert to NSString

Here's how to convert the (NSData *)deviceToken to (NSString *):
NSString *deviceTokenString = [[deviceToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]];
// also remove the space
deviceTokenString = [deviceTokenString stringByReplacingOccurrencesOfString:@" " withString:@""];

Monday, June 29, 2009

Using SoundEngine from apple

Sound Engine 2.0.3 from
http://stormyprods.com/SoundEngine/

Barebones Usage Example

#import 

UInt32     bangSound;

Sunday, June 28, 2009

Play short sound on iphone

Play short sound on iphone

SystemSoundID soundID;
NSString *path = [[NSBundle mainBundle] 
pathForResource:@"RapidFire" ofType:@"wav"]; 

Friday, June 26, 2009

FREE & COOL open source Tools: Jing, Audacity, Handbrake

Check it out, all of them run on Linux, Mac and Windows
And they are FREE! really COOOOOL!!!

Jing: Making your own tutorial, record your screen, share you skills.
http://www.jingproject.com/

Audacity: Sound Editor
http://audacity.sourceforge.net/

Handbrake: Video Transcoder
http://handbrake.fr/

Test Highlighter


public class HelloBlogger {
public static void main(String [] args) {
System.out.println("Hello Blogger!!");
}
}

Thursday, June 18, 2009

Cocos2d framework for iphone

Cocos2d is an open source, 2d graph engine for iphone.

Director
Scene
Layer
Sprite
Menu
....
Schedule animation --- no timer needed, very convenient

Resource List
http://www.alexcurylo.com/blog/2009/05/16/resources-cocos2d/

Great Cocos2d Tutorial
http://www.bit-101.com/blog/?p=2138

WAMP windows apache mysql php

WAMP quick install apache mysql php.
Selectable features.

Saturday, May 02, 2009

Dynamic Memory Allocation

Allocation of memory during execution is called dynamic memory allocation. C provides library functions to allocate and free memory dynamically during program execution. Dynamic memory is allocated on the heap by the system.


#include "stdlib.h"
int *ptr;
ptr = (int *)malloc(sizeof(int));