id properties in Sample code

0 views
Skip to first unread message

falconcreek

unread,
Feb 19, 2009, 12:51:25 AM2/19/09
to ObjectiveResource
Accessing the personId property when running the sample code caused a
crash.

It seems that there is a type mismatch between FromXmlDelegate
else if ([type isEqualToString:@"integer"]) {
return [NSNumber numberWithInt:[propertyValue intValue]];

and the model class properties for id objects that results in the
following error

2009-02-19 00:46:55.154 objective_resource[6736:20b] *** -[NSCFNumber
isEqualToString:]: unrecognized selector sent to instance 0x110d760

(gdb) continue
2009-02-19 00:48:48.966 objective_resource[6736:20b] *** Terminating
app due to uncaught exception 'NSInvalidArgumentException', reason:
'*** -[NSCFNumber isEqualToString:]: unrecognized selector sent to
instance 0x110d760'

I fixed locally by changing the personId property to an NSNumber in
Person.h and also modifying ViewPersonController.m to use [NSNumber
stringValue] when setting up the cell.

cell.text = [person.personId stringValue];

Josh Vickery

unread,
Feb 19, 2009, 7:18:05 AM2/19/09
to objectiv...@googlegroups.com
On Thu, Feb 19, 2009 at 12:51 AM, falconcreek
<falconcr...@gmail.com> wrote:
>
> Accessing the personId property when running the sample code caused a
> crash.
Ah, good catch, thank you:
http://yfactorial.lighthouseapp.com/projects/18393-objectiveresource/tickets/23-update-tests-to-run-with-both-json-and-xml#ticket-23-12
Reply all
Reply to author
Forward
0 new messages