Xcode 6.4: NS_INLINE functions called from Swift crash in Release builds
| Originator: | dieter.komendera | ||
| Number: | rdar://22076249 | Date Originated: | 30-Jul-2015 08:27 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 6.4 (6E35b) |
| Classification: | Crash/Hang/Data Loss | Reproducible: | Always |
Summary:
When calling a C function marked as NS_INLINE from Swift, the app crashes when built for Release. It doesn’t crash when built for Debug.
For example
NS_INLINE BOOL myInlineFunction(void) { return UIScreen.mainScreen.bounds.size.height == 568;}
Calling that from Swift leads to
2015-07-30 20:20:42.331 NSInlineWhizBang[82768:5412934] *** NSForwarding: warning: selector (0x1045ccbe2) for message 'mainScreen' does not match selector known to Objective C runtime (0x107d5d8f1)-- abort
2015-07-30 20:20:42.331 NSInlineWhizBang[82768:5412934] +[UIScreen mainScreen]: unrecognized selector sent to class 0x105b24310
2015-07-30 20:20:42.337 NSInlineWhizBang[82768:5412934] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIScreen mainScreen]: unrecognized selector sent to class 0x105b24310'
Steps to Reproduce:
Build & run the attached project in Release mode
Expected Results:
app runs
Actual Results:
app crashes
Regression:
Notes:
Can’t reproduce with Xcode 7.
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!