Re: NSAppleScript - compileAndReturnError always breaks with EXC_BAD_ACCESS
Re: NSAppleScript - compileAndReturnError always breaks with EXC_BAD_ACCESS
- Subject: Re: NSAppleScript - compileAndReturnError always breaks with EXC_BAD_ACCESS
- From: Alex Wied <email@hidden>
- Date: Wed, 16 Jul 2008 09:55:17 +0200
I've found the setting which causes the error below and thought I post
the result in case somebody else runs into the same error.
In menu "Run" disable setting "Enable Guard Malloc" and the scripts
runs fine without any exceptions.
-Alex
On Jul 6, 2008, at 12:44 AM, Alex Wied wrote:
Greetings,
I have a trivial AppleScript that I would like to compile and run
under Objective-C. When I try to compile or execute it via
compileAndReturnError or executeAndReturnError I'm permanetly
receiving a EXC_BAD_ACCESS.
Here's my code:
======= CODE START ===
- (IBAction) simpleScript:(id)sender
{
NSAppleScript* theScript = [[NSAppleScript alloc] initWithSource:
@"beep 3"];
if (theScript != NULL)
{
NSDictionary* errDict = NULL;
// execution of the following line ends with EXC
if (YES == [theScript compileAndReturnError: &errDict])
{
NSLog(@"compiled the script");
[theScript executeAndReturnError: &errDict];
}
[theScript release];
}
}
======= CODE END ===
I did some research and found similar reports that suggested that
this might be a threading or garbage collection issue. I'm calling
the code in the main thread (i.e. no threading) and also disabled
auto garbage collection - without success.
I also tried a variety of other NSAppleScript sample. Whatever I
try, my debugger always ends up with a EXC_BAD_ACCESS.
The precise error message in the status bar of the debugger is:
GDB: Program received signal: "EXC_BAD_ACCESS".
I'm running XCode 3.1 under Leopard 10.5.4.
Any thoughts what's going wrong here? Is this a known problem?
Any help is greatly appreciated!
Thanks
-Alex
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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