1

I've been getting reports of my app crashing on load in iOS 6. It's built with the iOS 8 SDK and works fine on 7 & 8. I've just managed to get hold of an iOS 6 device to test and it does in fact crash on launch with the error:

dyld: Symbol not found: _UITransitionContextFromViewControllerKey
Referenced from: /var/mobile/Applications/895BC1B3-A362-42C9-8560-5CF40A682A10/myapp.app/MyApp Expected in: /System/Library/Frameworks/UIKit.framework/UIKit in /var/mobile/Applications/895BC1B3-A362-42C9-8560-5CF40A682A10/myapp.app/MyApp

I understand that dyld is a linker problem, but have no idea where to start with this. I've unlinked and re-added UIKit, but still doesn't work.

Thanks

Darren
  • 10,182
  • 20
  • 95
  • 162

2 Answers2

1

This is because UITransitionContextFromViewControllerKey doesn't exist until iOS 7. Working around this probably isn't worth the effort--it means dropping all usage of UIViewControllerContextTransitioning, as the protocol is new in iOS 7, or creating a separate code path for iOS 6. If that's what you want, look into weak-linking UIKit, although this may result in slow startup.

Steve McKay
  • 2,123
  • 17
  • 26
  • Thanks, I can't find any reference in my code to `UITransitionContextFromViewControllerKey` which is why i'm confused. Setting the `UIKit` framework to optional stops the crash, but is that the right thing to do here? – Darren Mar 01 '15 at 23:48
  • Possibly some generated code, e.g. from Interface Builder, is using the symbol. If you're linking to any static libraries, it's possible for them to be importing the symbol. If your app is importing `UITransitionContextFromViewControllerKey`, then it means that there is some code path, not necessarily code you've written, using it. On iOS 6 it will be `NULL`. This may or may not cause Bad Things to happen. If you want to dig really deep you could use `otool -tvV` to disassemble your app and see where UITCFVCK is being referenced and assess your risk level. I'd probably just not support iOS 6. – Steve McKay Mar 02 '15 at 02:57
  • Thanks for the explanation. I'll have a go of otool and weigh up my options. – Darren Mar 02 '15 at 07:15
  • The culprit is Aviary https://www.aviary.com it does say in their docs to weak link UIKit, but I guess after years of updates one doesn't read the install docs every time. – Darren Mar 02 '15 at 09:18
0

Look like your using UIViewControllerContextTransitioning. It's available only on iOS 7+.

See this question for more details Restore pre-iOS7 UINavigationController pushViewController animation

Community
  • 1
  • 1
Taier
  • 2,109
  • 12
  • 22