Re: Cocoa shell works great from PB, crashes as standalone.
Re: Cocoa shell works great from PB, crashes as standalone.
- Subject: Re: Cocoa shell works great from PB, crashes as standalone.
- From: email@hidden
- Date: Tue, 23 Oct 2001 19:36:13 +0200
On Tuesday, October 23, 2001, at 07:04 PM, Chilton Webb wrote:
- (void)StartServer {
[StartButton setEnabled:NO];
[StopButton setEnabled:YES];
[statusbox setStringValue:@"Server is running. Click 'Stop' to stop
it."];
gameserver=[[NSTask alloc] init];
[gameserver setLaunchPath:@"./TCPServerAlpha"];
This is wrong; try something like
[gameserver setLaunchPath:[[NSBundle mainBundle]
pathForResource:@"TCPServerAlpha" ofType;@""]];
[gameserver launch]; //<-- if I comment this out, it works.
}
Never rely on a relative path.
Regards,
John Hornkvist
--
ToastedMarshmallow, the perfect Cocoa companion
http://www.toastedmarshmallow.com