I have an application that uses several Modal Sheets to enter data. The modal sheet opening methods worked fine and still work fine, but they are deprecated and I fear that they will not work with future versions of Xcode soon. Here Apple points out how to use modal sheets ,
- (void)showCustomSheet: (NSWindow *)window
{
if (!myCustomSheet)
[NSBundle loadNibNamed: @"MyCustomSheet" owner: self];
[NSApp beginSheet: myCustomSheet
modalForWindow: window
modalDelegate: self
didEndSelector: @selector(didEndSheet:returnCode:contextInfo:)
contextInfo: nil];
}
but with the release of Xcode 5.1, they identify that the loadNibNamed method is deprecated and that we should use a similar function that references top-level objects.
The problem I am facing changes this:
[NSBundle loadNibNamed:@"OrderDetailsWindow" owner:self];
.
NSArray *array;
[[NSBundle mainBundle]loadNibNamed:@"OrderDetailsWindow" owner:self topLevelObjects:&array];
This method call actually opens a modal sheet. However, at the end of my method, which opens a modal sheet, Xcode hangs up with this error.
0x7fff8c33b097: andl 24(%r11), %r10d Thread1: EXC_BAD_ACCESS (code:EXC_I386_GPFLT)
, . . , topLevelObjects ? , ? !