NSOpenPanel logs userSpaceScaleFactor warning on retina Macs

Originator:matt
Number:rdar://12095871 Date Originated:14-Aug-2012 10:51 AM
Status:Duplicate/12307534 Resolved:
Product:Mac OS X Product Version:10.8/12A269
Classification:Other Bug Reproducible:Always
 
Summary:

The first time NSOpenPanel is used by an application on a Retina MacBook Pro running 10.8 the following warning is logged:

*** WARNING: Method userSpaceScaleFactor in class NSWindow is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.

Steps to Reproduce:

Create and begin an NSOpenPanel. Sample code:

NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setCanChooseFiles:NO];
[panel setCanChooseDirectories:YES];
[panel setAllowsMultipleSelection:YES];
[panel setPrompt:@"Select"];
[panel setCanCreateDirectories:YES];
[panel setDelegate:self];
[panel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) {
	// Handle result
}];

Expected Results:

The open panel appears with no warnings logged.

Actual Results:

The warning mentioned in the summary is logged.

Regression:

Notes:

Backtrace for the call to NSLog:

* thread #1: tid = 0x2903, 0x00007fff91dae75a Foundation`NSLog, stop reason = breakpoint 2.1
    frame #0: 0x00007fff91dae75a Foundation`NSLog
    frame #1: 0x00007fff937b5348 AppKit`_NSWarnDeprecatedHiDPIMethod + 345
    frame #2: 0x00007fff93b8401d AppKit`-[NSWindow userSpaceScaleFactor] + 97
    frame #3: 0x00007fff9224585c FinderKit`-[FIFinderViewGutsController windowState] + 327
    frame #4: 0x00007fff9223fece FinderKit`-[FIFinderViewGutsController _internalSetTargetPath:withViewStyle:] + 752
    frame #5: 0x00007fff9223f3c6 FinderKit`-[FIFinderViewGutsController setTargetNode:withViewStyle:] + 495
    frame #6: 0x00007fff92240a98 FinderKit`-[FIFinderViewGutsController deferredRetargetAndReloadForNode:] + 381
    frame #7: 0x00007fff92240e6b FinderKit`-[FIFinderViewGutsController urlResolutionCompleted:] + 158
    frame #8: 0x00007fff92468b8a CoreFoundation`_CFXNotificationPost + 2554
    frame #9: 0x00007fff91d67a76 Foundation`-[NSNotificationCenter postNotificationName:object:userInfo:] + 64
    frame #10: 0x00007fff91db18a7 Foundation`__NSThreadPerformPerform + 225
    frame #11: 0x00007fff92435841 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    frame #12: 0x00007fff92435165 CoreFoundation`__CFRunLoopDoSources0 + 245
    frame #13: 0x00007fff924584e5 CoreFoundation`__CFRunLoopRun + 789
    frame #14: 0x00007fff92457dd2 CoreFoundation`CFRunLoopRunSpecific + 290
    frame #15: 0x00007fff95249774 HIToolbox`RunCurrentEventLoopInMode + 209
    frame #16: 0x00007fff95249454 HIToolbox`ReceiveNextEventCommon + 166
    frame #17: 0x00007fff952493a3 HIToolbox`BlockUntilNextEventMatchingListInMode + 62
    frame #18: 0x00007fff935aafa3 AppKit`_DPSNextEvent + 685
    frame #19: 0x00007fff935aa862 AppKit`-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
    frame #20: 0x00007fff935a1c03 AppKit`-[NSApplication run] + 517
    frame #21: 0x00007fff93546656 AppKit`NSApplicationMain + 869
    frame #22: 0x0000000100001afe OnScreen`main + 62 at main.m:17
    frame #23: 0x0000000100001ab4 OnScreen`start + 52

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!