NSData testing for NULL
NSData testing for NULL
- Subject: NSData testing for NULL
- From: Robin Hermann <email@hidden>
- Date: Sun, 16 Jan 2005 23:05:19 +0100
I have the following situation:
I get data from a MySQL TEXT-field and put the text it in a NSScrollview:
NSData *note = [record objectForKey:@"notes"];
unsigned long len = [note length];
unsigned char noteBuffer[len];
[note getBytes:noteBuffer];
NSString *noteString = [NSString stringWithCString:noteBuffer length:len];
[notes setString:noteString];
But when there is no text I get the following message in the log:
-[NSNull length]: selector not recognized
How can I avoid this?
Robin Hermann
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden