我有什么办法可以解决它。
NavigationControllerWithSlider* controller = (NavigationControllerWithSlider*) self.ViewLocations; // ViewLocations ----> subView of ViewController && NavigationControllerWithSlider is a ViewController .
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setRightSlidingViewWithSliderImage:length:]: unrecognized selector sent to instance 0x805df60'
*** First throw call stack:
(0x1bec012 0x1508e7e 0x1c774bd 0x1bdbbbc 0x1bdb94e 0x19f7c 0x90d1c7 0x90d232 0x90d4da 0x9248e5 0x9249cb 0x924c76 0x924d71 0x92589b 0x925e93 0x925a88 0xb9a6 0xb3e8 0xaf40 0x8db285 0x8db4ed 0x44c5b3 0x1bab376 0x1baae06 0x1b92a82 0x1b91f44 0x1b91e1b 0x1b467e3 0x1b46668 0x82bffc 0x86dd 0x22b5)
libc++abi.dylib: terminate called throwing an exception
(lldb)
这是我的代码:
//ViewController.m
NavigationControllerWithSlider* controller = (NavigationControllerWithSlider*) self.ViewLocations; // ViewLocations ----> subView of ViewController
UIImage * img = [UIImage imageNamed: @"open_panel.png"];
UIImage * closeImg = [UIImage imageNamed: @"close_panel.png"];
UIImage * img1 = [UIImage imageWithCGImage:img.CGImage scale:img.scale orientation:UIImageOrientationUpMirrored];
UIImage * closeImg1 = [UIImage imageWithCGImage:closeImg.CGImage scale: closeImg.scale orientation:UIImageOrientationUpMirrored];
[controller setRightSlidingViewWithSliderImage:img1 length:300.0f];
controller.rightSlidingViewControllerId = @"toBeEmbeddedRight";
controller.rightSlidingView.hideSliderImage = closeImg1;
controller.rightSlidingView.headPadding = 44.0f;
controller.rightSlidingView.trailPadding = 44.0f;
//NavigationControllerWithSlider.m
- (void) setRightSlidingViewWithSliderImage: (UIImage*) image length: (CGFloat) length {
_rightSlidingView = [[SlidingViewController alloc] initWithPosition: DDSliderPositionRight image: image length: length];
_rightSlidingViewControllerId = @"";
}
我在这里缺少什么..?任何帮助请......