Note that there are some explanatory texts on larger screens.

plurals
  1. PONSOpenPanel acting weird
    primarykey
    data
    text
    <p>I'm trying to use NSOpenPanel to bring up on open file page. It works fine for the most part except for 3 things: </p> <ol> <li><p>The first issue is that the side bar doesn't appear, although I can still click on it.</p></li> <li><p>The second issue is that when I switch to a folder with less files than the previous ones, the screen isn't cleared and some of the previous files still appear, although they are unclickable.</p></li> <li><p>When I try to switch to the columns view, the app crashes. But all 3 other views work just fine.</p></li> </ol> <p>Here's the crash log:</p> <pre><code>AppKit`-[NSTableView setVerticalMotionCanBeginDrag:]: 0x7fff91d4f899: pushq %rbp 0x7fff91d4f89a: movq %rsp, %rbp 0x7fff91d4f89d: movq 7385076(%rip), %rax ; TrustKeychains::systemKcHandle() + 92 0x7fff91d4f8a4: movq (%rax,%rdi), %rax 0x7fff91d4f8a8: movq 7385193(%rip), %rcx ; tp_policyTrustSettingParams + 92 0x7fff91d4f8af: movl $4292870143, %edi 0x7fff91d4f8b4: andl (%rax,%rcx), %edi &lt;- Crash points here with EXC_BAD_ACCESS (code=1, address = 0x18) 0x7fff91d4f8b7: shll $21, %edx 0x7fff91d4f8ba: andl $2097152, %edx 0x7fff91d4f8c0: addl %edi, %edx 0x7fff91d4f8c2: movl %edx, (%rax,%rcx) 0x7fff91d4f8c5: popq %rbp 0x7fff91d4f8c6: ret </code></pre> <p>The crash log says the crash is in Thread 1.</p> <p>I was wondering if anyone knew how to fix it. Here is my code</p> <pre><code>-(IBAction)openDialog:(id)sender{ NSWindow *window = [[viewArray objectAtIndex:currentIndex] window]; NSOpenPanel *openDialog = [NSOpenPanel openPanel]; [openDialog setCanChooseFiles:YES]; [openDialog setCanChooseDirectories:NO]; NSString *homeString = [NSString stringWithFormat:@"file://localhost%@",NSHomeDirectory()]; [openDialog setDirectoryURL:[NSURL URLWithString:homeString]]; NSArray *fileTypes = [[NSArray alloc] initWithObjects:@"xcodeproj", nil]; [openDialog setAllowedFileTypes:fileTypes]; [openDialog beginSheetModalForWindow:window completionHandler:^(NSInteger result){ if (result == NSFileHandlingPanelOKButton){ NSURL *doc = [openDialog URL]; [[NSWorkspace sharedWorkspace] openFile:[doc relativePath]]; } }]; </code></pre> <p>}</p> <p>I put the exact same code in a different XCode project and it works just fine, so I'm not quite sure where the problem is. Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload