【发布时间】:2012-05-09 22:18:02
【问题描述】:
在 prepareForSegue 期间,我尝试为属性赋值并得到错误
2012-05-09 23:14:22.122 LeakSpotter[17709:15b03] * 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[UIViewController setCoordLong:]:发送了无法识别的选择器到实例 0xa86e930'
标题:
@property (nonatomic, retain) NSString *CoordLong;
@property (nonatomic, retain) NSString *CoordLat;
它们是合成的。
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
NSLog(@"Fired segue %@", [segue identifier]);
if([[segue identifier] isEqualToString:@"returnToLeakSpotter"]){
NSLog(@"Return to leak spotter segue...");
//ContactsViewController *cvc = (ContactsViewController *)[segue destinationViewController];
}else if ([[segue identifier] isEqualToString:@"gotoTakePhoto"]) {
NSLog(@"Go to photo view");
takePhotoViewController *takePhotoC = [segue destinationViewController];
takePhotoC.CoordLong = @"-9.88";
takePhotoC.CoordLat = @"45.45";
我是否遗漏了一些明显的东西?
谢谢
【问题讨论】:
标签: objective-c ios exception segue