• 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: String with bytes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: String with bytes


  • Subject: Re: String with bytes
  • From: Chris Suter <email@hidden>
  • Date: Thu, 29 Jun 2006 19:48:33 +1000


On 29/06/2006, at 7:41 PM, Aalok wrote:

Hi,

I want to create NSString with lenght 36 and the content should be 0x00.
I put 36 0's in the string like @"00000...." but it gives me
0x48(ascii value of 0)


I have tried something like... but doesnt work.(it give an error
saying incompatible pointer type.)

char zeroArray[36];
int i;
for(i=0;i<36;i++)
{
zeroArray[i]=0x00;
}

const char x[36];

NSString* checkSum=[[NSString alloc] initWithCharacters:zeroArray length:36];


Please suggest something.

regards,
aalok

You shouldn't be storing data in an NSString.

Use NSData instead.




_______________________________________________ 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
References: 
 >String with bytes (From: Aalok <email@hidden>)

  • Prev by Date: Crash when rectForPage is overridden on Intel
  • Next by Date: /Volumes entry Type detail ?
  • Previous by thread: String with bytes
  • Next by thread: Crash when rectForPage is overridden on Intel
  • Index(es):
    • Date
    • Thread