NSOpenPanel: Setting message also sets directoryURL to nil (bad side effect)

Originator:greg
Number:rdar://20764519 Date Originated:2015-04-30
Status:Resolved Resolved:15216g
Product:OS X Product Version:10.10.3 (14D131)
Classification:Serious Reproducible:Always
 
When -[NSOpenPanel setMessage:] is called, it sets that instance of NSOpenPanel's directoryURL to nil as an unintended and undesired side effect.

To reproduce:
a. Use OS X 10.10.3 (14D131)
b. Download the attached NSOpenPanelBug.zip file:

http://smilesoftware.com/downloads/NSOpenPanelBug.zip

c. Double-click NSOpenPanelBug.zip to decompress
d. Open the NSOpenPanelBug folder
e. Launch the NSOpenPanelBug app
f. Follow the instructions in the app, namely:

1. Click "Don't set message", navigate to the Desktop, and click Cancel
2. Click "Set message before directoryURL", then click Cancel
*. Note that you're shown the /Applications folder
3. Click "Don't set message", navigate to the Desktop, and click Cancel
4. Click "Set directoryURL before message", then click Cancel
*. Note that you're shown the Desktop rather than /Applications
5. Click "Set message before directoryURL", then click Cancel
*. Note that you're shown the /Applications folder

Expected that the order of setting directoryURL and message on an instance of NSOpenPanel should not matter.

Found that setting message before setting directoryURL works as expected but that setting message _after_ setting directoryURL sets directoryURL to nil.

MacBook Pro (Retina, 15-inch, Late 2013)
2.6 GHz Intel Core i7
16 GB 1600 MHz DDR3
NVIDIA GeForce GT 750M 2048 MB

10.10.3 (14D131)

Does NOT occur on Mavericks (10.9.5), so appears to be a Yosemite regression. View style does not appear to have any impact.

This problem DOES occur on 10.10.4 (14E11f).

Also, it does not matter if the deployment target / SDK is 10.9 or 10.10. Happens in both cases on 10.10.

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!