• 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 Concatenation that complex?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is Concatenation that complex?


  • Subject: Re: Is Concatenation that complex?
  • From: Allan Odgaard <email@hidden>
  • Date: Fri, 23 Apr 2004 05:38:05 +0200

On 23. Apr 2004, at 4:58, Adam wrote:

or in my specific less interesting case I want to end up with "(20)"

From what I have read in Obj-C I have to do this:

You can settle with:
NSString* str = [NSString stringWithFormat:@"(%d)", cookie];

But string concatenation is definitely more cumbersome in ObjC than Java, as the language do not have any support for it (other than providing constant strings), it's just another class. That said, if you use ObjectiveC++ you have access to operator-overloading and can provide a global operator+ to concatenate strings (though you probably need wrappers, since operator+ works with instances not pointers... but you can provide implicit conversion operators to make the compiler do that... yeah... you probably do not want to take this route ;) ).





** Cocoa FAQ: <http://www.alastairs-place.net/cocoa/faq.txt> **
_______________________________________________
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 Concatenation that complex? (From: Adam <email@hidden>)

  • Prev by Date: Re: Is Concatenation that complex?
  • Next by Date: Re: Is Concatenation that complex?
  • Previous by thread: Re: Is Concatenation that complex?
  • Next by thread: Re: Is Concatenation that complex?
  • Index(es):
    • Date
    • Thread