[NSURL URLWithString:NSTemporaryDirectory()] is broken on Simulator

Originator:kickingvegas
Number:rdar://12232335 Date Originated:4-Sep-2012
Status:Open Resolved:
Product:iPad SDK Product Version:Version 5.1 (272.21)
Classification:Serious Bug Reproducible:YES
 
The following code breaks with my upgrade to Mountain Lion Version 10.8.1 and using Xcode Version 4.4.1 (4F1003) within the iOS simulator Version 5.1 (272.21)

--- BEGIN
NSString *tmp = NSTemporaryDirectory();
NSURL *tmpURL = [NSURL URLWithString:tmp];
--- END

This code however is functional on devices running 5.1

Steps to Reproduce:

Execute the above code snippet with my OS X and Xcode configuration in an iOS simulator.  tmp will shown holding the address of the application delegate in the variable browser and the tmpURL will yield nil after execution. However, a po tmp will yield the expected NSString.


Expected Results:

tmpURL will be a valid NSURL instance.


Actual Results:

tmpURL is nil.
tmp is shown to point to the application delegate in the variable browser.

Regression:

Notes:

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!