I have the following method:
-(QFFriend*)getFriendById:(NSString*)fid
{
TFLog(@"NList %@", self.nFlist);
TFLog(@":%@:%@:", @"3", fid);
TFLog(@"%@", [self.nFlist valueForKey:@"3"]);
// TFLog(@"%@", [self.nFlist valueForKey:fid]);
}
And when I run it WITH the comment, I get this result: (and crash because I left out the return)
2013-04-12 07:39:49:972 QF[42881:2311] NList {
2 = "<QFFriend: 0x1dd61970>";
3 = "<QFFriend: 0x1dd76570>";
4 = "<QFFriend: 0x1dd84a70>";
7 = "<QFFriend: 0x1dd70760>";
}
2013-04-12 07:39:49:974 QF[42881:2311] :3:3:
2013-04-12 07:39:49:976 QF[42881:2311] <QFFriend: 0x1dd76570>
However, If I uncomment that line I get another crash, can someone explain what could be wrong?
2013-04-12 07:43:28:736 QuizFuzz[42912:2311] NList {
2 = "<QFFriend: 0x1c5888c0>";
3 = "<QFFriend: 0x1c5a5c30>";
4 = "<QFFriend: 0x1c5acaf0>";
7 = "<QFFriend: 0x1c5badf0>";
}
2013-04-12 07:43:28:738 QF[42912:2311] :3:3:
2013-04-12 07:43:28:740 QF[42912:2311] <QFFriend: 0x1c5a5c30>
2013-04-12 07:43:28.741 QF[42912:907] -[__NSCFNumber length]: unrecognized selector sent to instance 0x1d8521b0
2013-04-12 07:43:28:754 QF[42912:2311] ERROR: -[__NSCFNumber length]: unrecognized selector sent to instance 0x1d8521b0
2013-04-12 07:43:28.756 QF[42912:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber length]: unrecognized selector sent to instance 0x1d8521b0'
How can the two last calls not be equivalent? I send in a string in both cases!