Currently browsing category

Cocoa

原來NSLog();那麼好用

1 2 NSDictionary *playerInfo = [aNotification userInfo]; NSLog(@"%@", playerInfo);NSDictionary *playerInfo = [aNotification userInfo]; NSLog(@"%@", playerInfo); 我很好奇這個 NSDictionary 裡面裝了什麼膏藥? 就用NSLog幫忙揭開神祕的面紗 : Album = …

NSThread sleep

1 2 3 4 5 6 7 8 9 10 11 12 13 14 int main(int argc, char *argv[]) { [NSThread detachNewThreadSelector:@selector(checkiTunesStatus) …

SMS Timer for Mac OS X

在使用Skype傳送簡訊時, 也許會期望Skype提供定時發送簡訊功能吧?! 我就有這個需求.所以索性寫了一個無敵陽春的 SMS Timer 程式.歡迎到這裡下載. When you use the Skype to send the SMS, you may need a function which is …

Customizing XCode File Templates

Want to customize/organize your XCode 2.1 templates?? Here’s a few things I do to help myself. First off let’s get an understanding …

NSTimer:timerWithTimeInterval:target:selector:userInfo:repeats:

+(NSTimer *) timerWithTimeInterval:(NSTimeInterval)seconds    target:(id)target    selector:(SEL)aSelector    userInfo:(id)userInfo    repeats:(BOOL)repeats ## example #import “MyObject.h” @implementation MyObject NSTimer *timer; – (IBAction)myAction:(id)sender { timer = [NSTimer timerWithTimeInterval:1 …

ls in Cocoa

//Launch “ls -l -a -t” in the current directory, and then read the result into an NSString: NSTask *task; task = [[NSTask …