Women in Technology

Hear us Roar



Article:
  Strings in Cocoa: Part I
Subject:   Comparing @"..." type NSStrings
Date:   2001-07-06 17:02:13
From:   mikebeam
Response to: Comparing @"..." type NSStrings

Is that right? Wow, i didn't realize that. Thanks for pointing that out. I guess it makes perfect sense. By the way, what are some of the features of Cocoa that rely on this fact as you mentioned?


Mike

Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • Comparing @"..." type NSStrings
    2001-07-07 01:18:41  halliday [View]

    Additionally, unless I'm misremembering, SELectors are implemented as unique @"..." type NSString constants as well.
  • Comparing @"..." type NSStrings
    2001-07-07 00:47:41  halliday [View]

    As the NSString documentation indicates (in it's Objective-C version): "The compiler makes such object constants unique on a per-module basis".

    Some of the features that rely upon this behavior are Pasteboard Types (they are really @"..." type NSStrings), various Attribute Keys, Exceptions, and Notifications (to name a few). Of course, this is an implementation detail, and is always subject to change.