使用NSDateComponents时的SIGABRT

时间:2014-06-13 08:09:36

标签: objective-c sigabrt

NSDate *myDate = [[messagesCopy objectAtIndex:indexPath.row] date];

NSDateComponents *components = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:myDate]; // CRASH

cell.dateLabel.text = [NSString stringWithFormat: @"%d", (int)[components month]];

错误消息:

2014-06-16 12:57:17.706 OrgBeac [2828:60b] - [Message sizeWithFont:constrainedToSize:lineBreakMode:]:无法识别的选择器发送到实例0x16e55010 2014-06-16 12:57:17.709 OrgBeac [2828:60b] *由于未捕获的异常终止应用程序' NSInvalidArgumentException',原因:' - [Message sizeWithFont:constrainedToSize:lineBreakMode: ]:无法识别的选择器发送到实例0x16e55010' * 第一次抛出调用堆栈: (0x2e6f4fd3 0x38f6dccf 0x2e6f8967 0x2e6f7253 0x2e6f84f8 0xad603 0xad9c3 0x31020a2b 0x30fe569f 0x30fe73fd 0x30fe7351 0x30fe6f45 0xace8b 0x2f0e56d1 0x39324cef 0x393222ad 0x39321319 0x2f0e3cb9 0x2f0e3f41 0x2f0e40b7 0x2f0e41b5 0xac6a1 0x2f033fc3 0x2f033f07 0x2f033e21 0x2e35b0e7 0x2e359cf7 0x2e628941 0x2e2f16bb 0x2e2f1579 0x2e2f140d 0x2e6c025b 0x2e6bf72b 0x2e6bdf1f 0x2e628f0f 0x2e628cf3 0x33581663 0x30f7416d 0xab1d7 0x3947aab7) libc ++ abi.dylib:以NSException类型的未捕获异常终止

0 个答案:

没有答案