Re: EXC_BAD_ACCESS when calling NSOpenPanel

2009-11-25 Thread Jens Alfke
On Nov 25, 2009, at 3:25 PM, Ken Thomases wrote: > You haven't retained this panel. If you want this object to live beyond the > current autorelease context, you need to retain it. (Note that not retaining > doesn't guarantee that it _will_ be released at the end of the autorelease > context,

Re: EXC_BAD_ACCESS when calling NSOpenPanel

2009-11-25 Thread Ken Thomases
On Nov 23, 2009, at 6:51 PM, Darren Wheatley wrote: > I have the following code as the action from a button click: > > - (IBAction)chooseFile:(id)sender; > { >NSOpenPanel *openPanel = [NSOpenPanel openPanel]; You haven't retained this panel. If you want this object to live beyond the curre

Re: EXC_BAD_ACCESS when calling NSOpenPanel

2009-11-23 Thread Graham Cox
On 24/11/2009, at 11:51 AM, Darren Wheatley wrote: > - (IBAction)chooseFile:(id)sender; > { >NSOpenPanel *openPanel = [NSOpenPanel openPanel]; >[openPanel setCanChooseDirectories:NO]; >[openPanel setCanCreateDirectories:NO]; >[openPanel beginSheetForDirectory:nil >

Re: EXC_BAD_ACCESS when calling NSOpenPanel

2009-11-23 Thread Jens Alfke
On Nov 23, 2009, at 4:51 PM, Darren Wheatley wrote: > On my 10.6.2 iMac running XCode 3.2.1 it builds and runs fine. On my MacBook > Pro with exactly the same OS version (10.6.2) and XCode version I get a crash > - EXC_BAD_ACCESS when I run it. Just the exception type isn't very useful. You sh

Re: EXC_BAD_ACCESS when calling NSOpenPanel

2009-11-23 Thread Darren Wheatley
The only difference between the two machines is that the working machine has DefaultFolderX installed on it. As a test I installed Default Folder X on the MBP as well. The code now runs without error. So, why would Default Folder X be masking the problem (it overloads the file open/save dial