RE: NSTask exception on Intel
RE: NSTask exception on Intel
- Subject: RE: NSTask exception on Intel
- From: Nick Briggs <email@hidden>
- Date: Sat, 20 Jan 2007 14:52:16 +0000
Actually it only throws an exception when
1) I'm running in the debugger
2) I've previously called the same code in another almost identical
function (which parses the output differently)
Am I not releasing some connection to pmset properly? As I said no
problems on intel.
Nick
Begin forwarded message:
From: Nick Briggs <email@hidden>
Date: 20 January 2007 14:36:57 GMT
To: email@hidden
Subject: NSTask exception on Intel
Hi
This code works fine on PPC, but on Intel throughs an exception at
"data = [handle availableData]" , any clues why?
NSTask *task = [[NSTask alloc] init];
NSPipe *pipe = [NSPipe pipe];
NSFileHandle *handle = [pipe fileHandleForReading];
NSData *data = nil;
[task setStandardOutput:pipe];
[task setLaunchPath:@"/usr/bin/pmset"];
[task setArguments:[NSArray arrayWithObjects:@"-g", @"sched", nil]];
[task launch];
data = [handle availableData];
[task release];
cheers
Nick
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden