• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSData testing for NULL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSData testing for NULL
      • From: daniel <email@hidden>
    • Re: NSData testing for NULL [SOLVED]
      • From: Robin Hermann <email@hidden>
  • Prev by Date: Retaining state of windows and panels
  • Next by Date: Re: NSData testing for NULL [SOLVED]
  • Previous by thread: Re: Retaining state of windows and panels
  • Next by thread: Re: NSData testing for NULL [SOLVED]
  • Index(es):
    • Date
    • Thread