Re: Inserting Special Characters into a String (small nit being picked)
Re: Inserting Special Characters into a String (small nit being picked)
- Subject: Re: Inserting Special Characters into a String (small nit being picked)
- From: Ian was here <email@hidden>
- Date: Tue, 12 Jul 2005 20:04:57 -0700 (PDT)
Thanks for the pointer ;-)
--- pjl <email@hidden> wrote:
>
> On Jul 11, 2005, at 4:16 PM, Ian was here wrote:
>
> > Here's the source code for inserting special
> > characters into a string for anyone who is
> interested:
> >
> >
> >
> > char diamondChar[] = { 0xe2, 0x99, 0xa6, nil };
> //UTF8
>
> Don't use nil. Use 0 (or even 0x0 for consistency if
> you like). nil
> is (id)0, i.e. a pointer to an object. You have an
> array of 8-bit
> integers. The compiler can automatically cast the
> zero back to a char
> but it's very bad style. Use NULL for pointers, nil
> for objects, '\0'
> for character constant for ASCII NUL, and 0 for
> zero.
>
> > NSMutableAttributedString *bulletedText =
> > [[NSMutableAttributedString alloc]
> > initWithString:[NSString
> > stringWithUTF8String:diamondChar]
> attributes:attDict];
> >
>
__________________________________
Yahoo! Mail for Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail
_______________________________________________
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