swalkner
swalkner

Reputation: 17329

Symbol not found: _UIPageViewControllerOptionSpineLocationKey

I'd like to have the page-curl animation when my app runs on iOS 5, for iOS 4-devices I made a custom animation.

I'm setting the spineLocation manually, as it didn't work otherwise (see: UIPageViewController: pageViewController:spineLocationForInterfaceOrientation: not called):

if ([UIPageViewController class]) {
   NSDictionary *options = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithInt:UIPageViewControllerSpineLocationMid], UIPageViewControllerOptionSpineLocationKey, nil];
   ...

But that gives me at runtime on iOS4:

 Symbol not found: _UIPageViewControllerOptionSpineLocationKey

The code isn't reached on iOS4-devices, nevertheless it crashes with that error message. What can I do to make that work?

Thanks!

Upvotes: 0

Views: 578

Answers (2)

steipete
steipete

Reputation: 7641

Don't weak-link UIKit unless you want a less-performant app, especially on startup! For this specific problem you can work around with just using

@"UIPageViewControllerOptionSpineLocationKey"

instead of the constant defined in UIKit. It's ugly, but it gets the job done without weak-linking the whole framework.

Upvotes: 0

Stephen Darlington
Stephen Darlington

Reputation: 52565

I think you'll need to weak link to the UIKit framework. From the documentation, it looks like UIPageViewControllerOptionSpineLocationKey is a static variable so checking for the object isn't enough to avoid the runtime error.

Upvotes: 3

Related Questions