• 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: How to concatenate two values?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to concatenate two values?


  • Subject: Re: How to concatenate two values?
  • From: Guy English <email@hidden>
  • Date: Thu, 3 Mar 2005 18:31:07 -0500

I think you want:

completeString = [NSString stringWithFormat: @"%@ %@",  myPath, now];

see the docs on NSCalendarData for getting localized & formatted
strings back from them.

stringWithFormat works like printf except it adds the %@ specifier
which indicates the argument is an NSObject subclass. These arguments
will have "description" called on them which returns a string object.
See the docs for more info. From the pesudo code I assume you're new
to C based languages - you may want to check out some basic C / printf
docs to get an idea of how it works.

Guy


On Thu, 3 Mar 2005 15:20:03 +0100, Ronald Hofmann <email@hidden> wrote:
> Hi everybody,
> first of all I would like to say thank you to the people who help us
> newcomers with great hints.
>
> My problem is as follows:
> I have values which already work fine.
>
>         NSCalendarDate *now=[NSCalendarDate calendarDate];//this is a date
> value
>         NSString *myPath = NSHomeDirectory();//this is a string value
>
> I want to concatenate both values.
>
> Something like "myString= myPath&now;" but this does not work because
> of the diffenrent types.
>
> I can“t find how to do this. Any hints out there?
>
> tia, Ronald
> ===============
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >How to concatenate two values? (From: Ronald Hofmann <email@hidden>)

  • Prev by Date: Re: LaunchServices: LSFindApplicationForInfo worse results in 10.3 than in 10.1?
  • Next by Date: Re: How to concatenate two values?
  • Previous by thread: How to concatenate two values?
  • Next by thread: Re: How to concatenate two values?
  • Index(es):
    • Date
    • Thread