• 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: hash problem with NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hash problem with NSString


  • Subject: Re: hash problem with NSString
  • From: Nat! <email@hidden>
  • Date: Mon, 27 Sep 2004 23:49:55 +0200


Am 27.09.2004 um 22:05 schrieb Eric Ocean:

Okay, here is code that demonstrates the problem *(might not really be a problem though--see below):



But mysteriously this code

#import <Foundation/Foundation.h>


int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

const char char_array[5] = { 'R', 'o', 'o', 't', '\0' };
NSString *a = [NSString stringWithCString:&char_array length:5];
NSString *b = [NSString stringWithCString:&char_array length:strlen( char_array)];
NSString *c = @"Root";


   NSLog( @"Hash: a=%X b=%X c=%X", [a hash], [b hash], [c hash]);

   [pool release];
   return 0;
}

returns

2004-09-27 23:48:22.489 hash_really_broken_question[2466] Hash: a=889E36C9 b=9B749F28 c=9B749F28

Ciao
	Nat!
------------------------------------------------------
A good dog, though a fool.
Who wants a smart dog!  -- R.A. Lafferty

_______________________________________________
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: hash problem with NSString
      • From: Steve Checkoway <email@hidden>
    • Re: hash problem with NSString [RADAR #]
      • From: Eric Ocean <email@hidden>
References: 
 >hash problem with NSString (From: Eric Ocean <email@hidden>)
 >Re: hash problem with NSString (From: Eric Ocean <email@hidden>)

  • Prev by Date: Re: Advanced?? Bindings Questions
  • Next by Date: Re: hash problem with NSString [RADAR #]
  • Previous by thread: Re: hash problem with NSString
  • Next by thread: Re: hash problem with NSString [RADAR #]
  • Index(es):
    • Date
    • Thread