It would be helpful if you could show more, especially how you alloc
and init
your worldV
and what you have in your viewDidLoad
.
Normally you don't create a new DetailViewController for SplitView setup.
Instead of creating a new DetailViewController, try to grab a hold of the existing detail view controller by creating a property:
@property(strong, nonatomic) DetailViewController *detailViewController;
and:
self.detailViewController = (DetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController];
First thing to test here is whether your worldV
is nil
. A simple NSLog in animateToPosition
would reveal the answer.
And whenever you need to call that method, do:
[self.detailViewController animateToPosition];
To animate from one coordinate to another with time, you may need to change your animateToPosition
method to:
-(void)animateToPosition:(MaplyCoordinate)coordinates time:(CGFloat)time
Consult whether or not your MaplyCoordinate
is an object, which I doubt.
So, to sum up, in your tableview's viewDidLoad
, get a hold of the detail view controller.
When didSelectRow
gets called, use the new method suggested and pass the coordinate and time this way:
[self.detailViewController animateToPosition:coordinates time:1.0];
Hope this helps.