Re: newbie defines and NSString problem
Re: newbie defines and NSString problem
- Subject: Re: newbie defines and NSString problem
- From: Eric Blair <email@hidden>
- Date: Thu, 11 Mar 2004 11:28:11 -0500
On Thursday, March 11, 2004 at 11:12 AM, Ken Hawkins wrote:
>
let me dive right in as i'm sure it is an easy one.
>
>
i have a defines.h:
>
>
#define FOO "bar"
>
>
annd now i include it in main.c (example)
>
>
where i try to
>
>
NSString *str = [NSString stringWith???: FOO];
>
>
i inserted the '???' because i have tried a number of routines from:
>
>
stringWith Format:@"%s":FOO];
>
stringWith Format:@"%@":FOO];
>
stringWith Format:@"%s":CFSTR(FOO)];
>
>
it always returns me an erro before token ";"
>
>
if i take out the 'FOO' and insert any old @"bar" it will will work.
>
>
what am i easily overlooking?
>
Try
stringWithCString or stringWithUTF8CString or #define FOO @"bar"
--Eric
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.