Re: Is Concatenation that complex?
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.