【发布时间】:2013-06-27 07:18:09
【问题描述】:
我是(来自java);目标 c 和 xcode 的新手。下面是构建良好但抛出unrecognized selector sent to instance 的代码。我试图通过谷歌搜索来修复它。但没有运气。
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
一点调试显示ox7560cc0属于destinationViewController。不知道出了什么问题..
有什么帮助吗?
【问题讨论】:
标签: ios objective-c uiviewcontroller