2013-06-29 2 views
1

나는 (java에서); 객관적인 새로운 c와 xcode. 아래 코드는 괜찮 으면서도 unrecognized selector sent to instance을 던지는 코드입니다. 나는 그것을 검색하려고 노력했다.. 그러나 어떤 운도.[UIViewController setRecipeName :] : 인식 할 수없는 선택자를 인스턴스로 보냄

if ([segue.identifier isEqualToString:@"myAccSegue"]) { 
    MyAccountController *destViewController = segue.destinationViewController; 
    NSString *s = @"avcd";//[_carImages objectAtIndex: (NSUInteger)index.section ]; 
    destViewController.recipeName=s; 
} 

및 MyAccountController은 다음과 같습니다

#import <UIKit/UIKit.h> 

@interface MyAccountController : UITableViewController 

@property NSInteger index; 

@property (nonatomic,strong) NSString *recipeName; 

@end 

는 MyAccountController.m에 내가 @synthesise recipeName을 썼다. 내가 오류

2013-06-29 23:02:28.962 abcd[9171:c07] -[UIViewController setRecipeName:]: unrecognized selector sent to instance 0x7560cc0 

를 얻을 실행하면 약간의 debuggng는 ox7560cc0이 destinationViewController에 속하는 보여줍니다. 무엇이 잘못되었는지 잘 모르겠다.

어떤 도움을 주시겠습니까?

답변

20

오류 메시지

 
-[UIViewController setRecipeName:]: unrecognized selector sent to instance ... 

MyAccountController *destViewController = segue.destinationViewController; 

가 예상대로 MyAccountController하지만 UIViewController을 반환하지 않았 음을 나타냅니다.

이유는 사용자가 스토리 컨트롤러 파일의 "MyAccountController"로보기 컨트롤러의 "사용자 지정 클래스"를 설정하지 않았기 때문입니다.

+0

좋은 문제는 내 문제를 해결했습니다. –

+0

굉장 :) 감사합니다. 나는 내 머리를 치고 있었다. .. – Priyatham51

관련 문제