• 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: NSString format parameter order
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString format parameter order


  • Subject: Re: NSString format parameter order
  • From: Frédéric Testuz <email@hidden>
  • Date: Tue, 8 Apr 2008 12:38:54 +0200

I think using the capacity of Cocoa would be simplier. Look at the doc on the localization :

<http://developer.apple.com/documentation/MacOSX/Conceptual/BPInternational/Articles/StringsFiles.html#//apple_ref/doc/uid/20000005 >

This line :

NSLog(@"%3$u : %2$@ : %1$@", @"le 1", @"le 2", 3);

result in :

2008-04-08 12:37:50.036 Test[483:10b] 3 : le 2 : le 1

F. Testuz



Le 8 avr. 08 à 12:01, Jere Gmail a écrit :
Well, I have found a "good" solution using
stringByReplacingOccurrencesOfString:withString:options:range:
The only problem is that one of the parameters is a float, and if I
want to display it with more or less precision I would have to make a
preprocess of the parameter format into the string.

Now it works with:
[str stringByReplacingOccurrencesOfString:@"%1" withString:string1]

On Tue, Apr 8, 2008 at 11:55 AM, Michael Vannorsdel <email@hidden > wrote:
You could load the strings into an NSArray and then use the proper indexes
to print out the string you want.




On Apr 8, 2008, at 3:48 AM, Jere Gmail wrote:


Well, it's not a language thing at this moment but it started this way.
Right now I have a txt file with one string with the places where the
fields should be. I use it as a template to generate an HTML from some
fields obtained from and XML.
This way I can change the page displayed without having to recompile
the application.




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden




-- http://zon7blog.wordpress.com/ And again we fall. _______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSString format parameter order
      • From: mmalc crawford <email@hidden>
References: 
 >NSString format parameter order (From: "Jere Gmail" <email@hidden>)
 >Re: NSString format parameter order (From: Michael Vannorsdel <email@hidden>)
 >Re: NSString format parameter order (From: "Jere Gmail" <email@hidden>)
 >Re: NSString format parameter order (From: Michael Vannorsdel <email@hidden>)
 >Re: NSString format parameter order (From: "Jere Gmail" <email@hidden>)

  • Prev by Date: Re: NSString format parameter order
  • Next by Date: Re: Returning a value from a function
  • Previous by thread: Re: NSString format parameter order
  • Next by thread: Re: NSString format parameter order
  • Index(es):
    • Date
    • Thread