Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString and char *



On 2/11/06, Lars Elden <email@hidden> wrote:
> NSString * msg = [ [ [ NSString alloc ] initWithCString:"Test" ] autorelease
> ];
>
> working, thanks.

It's also notably absent from the answers given to you in an earlier
reply, most likely because it's deprecated in Tiger.  If you're not
using the advice given to you on the list in response to your
questions, why ask them at all?  Ideally, reading the docs should
happen before posting, which would help avoid cluttering the list with
questions that are simply answered by pointing you to the relevant
documentation.

Giving you the benefit of the doubt that you're not using Tiger
(although this would still be in the NSString documentation), if you
want an autoreleased string, just use +stringWithCString:

NSString *msg = [NSString stringWithCString:"Test"];

J.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >NSString and char * (From: "Lars Elden" <email@hidden>)
 >RE: NSString and char * (From: "Lars Elden" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.