• 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
Re: NSNull and @""
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSNull and @""


  • Subject: Re: NSNull and @""
  • From: "Colin Barrett" <email@hidden>
  • Date: Fri, 10 Oct 2008 17:11:02 -0700

On Fri, Oct 10, 2008 at 3:20 PM, DKJ <email@hidden> wrote:
> I've made an NSDictionary where the values are strings. Is there a
> difference between setting a value as [NSNull null] and setting it as @""?
> (I've been using the former.)

It's up to you. Unlike other languages, Cocoa dictionaries are not
type homogenous (ObjC in general has a weak type system and its
objects are statically typed). It is up to the caller of objectForKey:
(which returns id) to check the type of the returned object and make
sure it is what you are expecting it to be.

-Colin
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSNull and @""
      • From: "Shawn Erickson" <email@hidden>
References: 
 >NSNull and @"" (From: DKJ <email@hidden>)

  • Prev by Date: Re: NSNull and @""
  • Next by Date: Re: NSNull and @""
  • Previous by thread: Re: NSNull and @""
  • Next by thread: Re: NSNull and @""
  • Index(es):
    • Date
    • Thread