Re: [Mysql-cocoa-users] how to reflect a NULL field in a table
Brought to you by:
sergecohen
From: Bertrand M. <bma...@wa...> - 2002-06-03 08:59:10
|
le 28/05/02 13:37, Serge Cohen =E0 co...@em... a =E9crit=A0: > Hi; >=20 > We just solved the problem from Jerome Rabas: It comes from the fact > that the result he is having contain some field which are NULL. > Obviously the framework doesn't support that because it then make a nil > object and tries to add it to the returned NSArray or NSDictionary which > is returned for every row. >=20 > As you might now this collections object (array, dictionary...) does not > support nil pointers as object. One easy solution would be for me to > replace that par an empty string, or null number... but that CHANGES the > information contained in the DB, for which NULL is not the same as empty > string (for example); so using solution would remove the difference. >=20 > The only solution I can think of so far is to make a NULL object, only a > child of NSObject which doesn't have any instance variables, and only a > - -description method (returning @"NULL"). I'm not sure that's a good > solution. >=20 > Any one have a better idea? Hi Serge, Hope you had a nice weekend. I thought about the null thing and there might be another solution if you use [NSNull null]. See: http://developer.apple.com/techpubs/macosx/Cocoa/Reference/Foundation/ObjC_= c lassic/Classes/NSNull.html Tell me how it goes. Bertrand Mansion Mamasam |