• 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: Is there such a thing as a global constant (string) in obj-c?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there such a thing as a global constant (string) in obj-c?


  • Subject: Re: Is there such a thing as a global constant (string) in obj-c?
  • From: Clark Cox <email@hidden>
  • Date: Wed, 21 Jul 2004 11:43:39 -0400

In the source:

NSString *const myString = @"blah"


In the header/other source files:

extern NSString *const myString;



On 7 21, 2004, at 10:38, John Spicer wrote:

> I've been trying to make one. I tried putting it in the main file as
> this
> NSString *myconst = @"thedatabit";
>
> and that compiles OK. I then declare it as this in a file I want to use
> it in:
>
> extern const NSString *myconst;
>
> which again compiles ok, BUT I get this warning when I try to use it in
> a message [myObject selectMyString:myconst];
>
> passing arg 1 of `selectMyString:' discards qualifiers from pointer
> target type
>
> Usually, these warnings mean it isn't going to work when you run it,
> it's just too polite to say so!
>
> I've looked on apple's site, and through the 3 ref books I have but no
> joy.
>
> what's the secret?

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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: 
 >Is there such a thing as a global constant (string) in obj-c? (From: John Spicer <email@hidden>)

  • Prev by Date: Re: How to disable Apple's Bug Report Dialog when application crash?
  • Next by Date: Re: Place to discuss Tiger (XCode2, CoreData) issues
  • Previous by thread: Re: Is there such a thing as a global constant (string) in obj-c?
  • Next by thread: Re: Writing pure java cocoa applications
  • Index(es):
    • Date
    • Thread