This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSTask * list = [[NSTask alloc] init]; | |
[list setLaunchPath:@"/bin/ls"]; | |
[list setCurrentDirectoryPath:@"/"]; | |
NSPipe * out = [NSPipe pipe]; | |
[list setStandardOutput:out]; | |
[list launch]; | |
[list waitUntilExit]; | |
[list release]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSImage *computerImage = [NSImage imageNamed:NSImageNameComputer]; | |
NSInteger size = 256; | |
NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] | |
initWithBitmapDataPlanes:NULL | |
pixelsWide:size | |
pixelsHigh:size | |
bitsPerSample:8 | |
samplesPerPixel:4 | |
hasAlpha:YES |