Currently browsing tag

Programming, Page 5

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 …