lionheart / openradar-mirror

A mirror of radars pulled from http://openradar.me/.
245 stars 17 forks source link

50347914: Bundle.main returns the wrong bundle inside a framework #21223

Open openradar-mirror opened 5 years ago

openradar-mirror commented 5 years ago

Description

Summary:

 Bundle.main inside a framework returns the wrong data.

 [From the docs:](https://developer.apple.com/documentation/foundation/bundle/1410786-main)
 "_For code running in a framework, the main bundle offers access to the framework’s bundle directory_."

 However, when breaking in the provided test method, the main bundle is referring to Xcode:

 ```
 (lldb) po Bundle.main
 NSBundle </Applications/Xcode-10.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents> (loaded)
 ```

 I would expect the frameworks bundle here.

Steps to Reproduce:

Expected Results:

Actual Results:

Version/Build:

Xcode 10.2.1 (10E1001)

Configuration:

osx 10.14.4 (18E226)

- Product Version: 10.2.1 Created: 2019-04-30T20:48:21.340827 Originated: 2019-04-30T00:00:00 Open Radar Link: http://www.openradar.me/50347914