Re: [Mysql-cocoa-users] testing for a NULL value from the db
Brought to you by:
sergecohen
From: Aaron J. <aj...@ed...> - 2004-07-22 16:26:48
|
It its class is NSNull, why not do: if ([[row objectForKey:@"COMMENT"] class] != NSNull) Aaron On Jul 22, 2004, at 11:14 AM, John Spicer wrote: > I have some rows in the database table that are nulls. > > I am trying to do an assignment like this: > > [thisOne setCOMMENT:[row objectForKey:@"COMMENT"]]; > > > but later on in assignments to elements I get an error of > > *** -[NSNull length]: selector not recognized > > since it's a null and not a string. > > How do I test this coming from the db and set it to an empty string? > > I tried this > > if ([row objectForKey:@"COMMENT"] != NULL) > > > but it's not a null, it's an object with a name of NSNull which I > don't know how to deal with! > > Help! |