현재 도달 할 수있는 사람의 수를 늘리기 위해 iOS4에서 내 앱을 사용할 수있게하려고합니다.iOS5에서 iOS4 충돌 - ViewController
우리는 StoryBoard에서 벗어나 .xib 파일을 대신 사용하고 있습니다.
2012-09-14 18:32:42.705 CrunchCalculator[7037:11303] -[CategoryViewController presentViewController:animated:completion:]: unrecognized selector sent to instance 0x6b42230
2012-09-14 18:32:42.707 CrunchCalculator[7037:11303] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CategoryViewController presentViewController:animated:completion:]: unrecognized selector sent to instance 0x6b42230'
*** Call stack at first throw:
(
0 CoreFoundation 0x013625a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00ef1313 objc_exception_throw + 44
2 CoreFoundation 0x013640bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x012d3966 ___forwarding___ + 966
4 CoreFoundation 0x012d3522 _CF_forwarding_prep_0 + 50
5 CrunchCalculator 0x0002e560 +[OpenCalcViewController openCalcView:fromViewController:] + 8256
6 CrunchCalculator 0x0002fe0a -[CategoryViewController openCalc:] + 106
7 UIKit 0x002554fd -[UIApplication sendAction:to:from:forEvent:] + 119
8 UIKit 0x002e5799 -[UIControl sendAction:to:forEvent:] + 67
9 UIKit 0x002e7c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
10 UIKit 0x002e67d8 -[UIControl touchesEnded:withEvent:] + 458
11 UIKit 0x004e84de _UIGestureRecognizerSortAndSendDelayedTouches + 3609
12 UIKit 0x004e8c53 _UIGestureRecognizerUpdateObserver + 927
13 CoreFoundation 0x0134389b __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 27
14 CoreFoundation 0x012d86e7 __CFRunLoopDoObservers + 295
15 CoreFoundation 0x012a11d7 __CFRunLoopRun + 1575
16 CoreFoundation 0x012a0840 CFRunLoopRunSpecific + 208
17 CoreFoundation 0x012a0761 CFRunLoopRunInMode + 97
18 GraphicsServices 0x014b61c4 GSEventRunModal + 217
19 GraphicsServices 0x014b6289 GSEventRun + 115
20 UIKit 0x00263c93 UIApplicationMain + 1160
21 CrunchCalculator 0x0000276a main + 170
22 CrunchCalculator 0x000026b5 start + 53
)
terminate called throwing an exception(lldb)
보통 내가 다른보기 열려면이를 사용 :
UIViewController *controller;
controller = [[CategoryViewController alloc]initWithNibName:@"CategoryViewController" bundle:nil];
controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:controller animated:YES];
[controller release];
을하지만,이 경우에 나는에서 함수를 호출
는 지금이 정지되는 유일한 것은이 오류입니다 이 코드를 사용하는 다른 파일 (효율성) :
#import "AllofTheFiles.h"
+ (void)openCalcView: (NSString *)nameOfView fromViewController:(UIViewController *)controller {
NSUserDefaults *saveSpot = [NSUserDefaults standardUserDefaults];
UIViewController *modalController;
if ([nameOfView isEqualToString:@"Tax"]) {
modalController= [[TAXViewController alloc]initWithNibName:@"TAXViewController" bundle:nil];
}else if ([nameOfView isEqualToString:@"Rent"]){
modalController= [[RENTViewController alloc]initWithNibName:@"RENTViewController" bundle:nil];
} //... cut other else if's to save space
modalController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[controller presentViewController:modalController animated:YES completion:nil];
[modalController release];
}
어떻게 해결할 수 있습니까? 미리 감사드립니다!
은 다음과 같습니다 코드에서 전화를하고, 반복해서
respondsToSelector
테스트 및is deprecated
경고를 복제하지 않으며, 단지 UIViewController에 추가합니다 CatagoryViewController는 UIViewController 유형입니까? – Kyle