• 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: constants? strings? what do i wrong?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: constants? strings? what do i wrong?


  • Subject: Re: constants? strings? what do i wrong?
  • From: Pete Yandell <email@hidden>
  • Date: Tue, 3 Feb 2004 13:02:04 +1100

It's got nothing to do with whether or not it's in a header. By way of
demonstration, a Foundation Tool project with the following files works
just fine.

test.h:
#define ASTRING @"Hello, World!"

main.m:
#import <Foundation/Foundation.h>
#import "test.h"

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

NSLog (ASTRING);

[pool release];
return 0;
}

I once again assert that the problem lies in something that you haven't
shown us. :)

Pete Yandell
http://pete.yandell.com/

On 03/02/2004, at 12:29 PM, Steffi Krause wrote:

>> The problem is not in the bit of the code that you've shown us.
>>
>> If I create a project and do:
>>
>> #define ASTRING @"Hello, World!"
>> NSLog(ASTRING);
>
> thanks again for being so helpful! there is not much more code and i
> commented it all out so the problem
> is reduced to what i showed you.
>
> the thing is i wanted to define the constant in the header file and
> then use
> it inside the implementation
> (inside an IBAction). now i simply declare two variables in the header
> and
> set their content in the init
> routine of the class. i'd still prefer the way of the constant, though.
>
> --
> GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99
> EUR/Monat...)
> jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++
> http://www.gmx.net/derspiegel +++
> _______________________________________________
> 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.
_______________________________________________
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.

References: 
 >Re: constants? strings? what do i wrong? (From: "Steffi Krause" <email@hidden>)

  • Prev by Date: NSTableHeaderCell
  • Next by Date: Re: Packager
  • Previous by thread: Re: constants? strings? what do i wrong?
  • Next by thread: Re: Name instance variables, methods and parameters.
  • Index(es):
    • Date
    • Thread