Re: NSData testing for NULL [SOLVED]
Re: NSData testing for NULL [SOLVED]
- Subject: Re: NSData testing for NULL [SOLVED]
- From: Robin Hermann <email@hidden>
- Date: Mon, 17 Jan 2005 09:04:56 +0100
Ouch,
NSData is what I want and need. Didn't really wake up yet ;-)
Robin Hermann
On 17 jan 2005, at 08:46, Kevin Callahan wrote:
do you want NSData or NSDate ?
K
On Jan 16, 2005, at 11:16 PM, Robin Hermann wrote:
Thanks for your solutions
NSData *note = [record objectForKey:@"notes"];
Well I tried them all but they don't work (The NSScrollView is not updated), didn't get an error either ;-)
if (note != nil && [note isKindOfClass:[NSDate class]]) {
if (note != Nil && [note isKindOfClass:[NSDate class]]) {
if (note != NULL && [note isKindOfClass:[NSDate class]]) {
Maybe not a very nice solution, but it works:
if ([note respondsToSelector:@selector(length)]) {
No errors and the NSScrollView is updated with the new value.
Can't find very much info (Apple Docs, Google) on NULL, Nil and nil though.
Robin Hermann
On 17 jan 2005, at 05:50, M. Uli Kusterer wrote:
At 21:23 Uhr -0500 16.01.2005, Mark Ritchie wrote:
NSData *note = [record objectForKey:@"notes"];
if ((note != null) && [note isKindOfClass:[NSData class]){
...
}
Note that in the past I would have used the following:
if ((note != null) && ( note != [NSNull null])){
...
}
Just note that this is pseudo-code, not Objective C. "null" is a Java constant. C has NULL, and ObjC additionally offers nil and Nil (the former for instances, the latter typically used for classes).
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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
_______________________________________________
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
_______________________________________________
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