Monday, May 30, 2011

Objective C date comparision

if (licenseDictionary == nil){
     return @"Not Registered"; 
}else if([today compare:expDate] == NSOrderedAscending) {
     [gotoButton setEnabled:YES]; return [licenseDictionary objectForKey:@"Name"]; 
} else{
     return @"License Expired";
}

Wednesday, May 25, 2011

Convert sound through Mac terminal

You may use the afconvert tool to convert sounds. For example, to convert the 16-bit linear PCM system sound Submarine.aiff to IMA4 audio in a CAF file, use the following command in the Terminal application:

afconvert /System/Library/Sounds/Submarine.aiff ~/Desktop/sub.caf -d ima4 -f caff -v


You can inspect a sound to determine its data format by opening it in QuickTime Player and choosing Show Movie Inspector from the Movie menu.
Custom sounds must be under 30 seconds when played. if a custom sound is over that limit, the default system sound is played instead.


iPhone support sound formats are
Linear PCM, MA4 (IMA/ADPCM), uLaw or aLaw wAy...

How multitasking works on iPhone

Here is an interesting article about how multitasking works on iPhone

http://gizmodo.com/5512656/how-multitasking-works-in-the-new-iphone-os-40