• 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: Showing a URL with spaces in a NSAlertPanel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Showing a URL with spaces in a NSAlertPanel


  • Subject: Re: Showing a URL with spaces in a NSAlertPanel
  • From: Nick Zitzmann <email@hidden>
  • Date: Wed, 21 Jan 2004 18:25:43 -0800

On Jan 21, 2004, at 6:05 AM, Shoaib wrote:

I want to show a URL that contains a space (shown below, escaped with ) in an NSAlertPanel but is shows up garbled.

http://www.mysite.com/Hello World.html
Any ideas?

The second argument of NSRunAlertPanel() takes a formatted string, so if you're just displaying that URL in the panel, you must do something like this:

NSRunAlertPanel(@"The URL is:", @"%@", @"OK", nil, nil, someURL);

Otherwise, the varargs functions NSRunAlertPanel() calls will treat that % as meaning an argument should be pasted in that spot...

Nick Zitzmann
<http://seiryu.home.comcast.net/>
<http://www.freshlysqueezedsoftware.com/>
S/MIME signature available upon request

UNIX: Where /sbin/init is Job #1.
_______________________________________________
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: 
 >Showing a URL with spaces in a NSAlertPanel (From: "Shoaib" <email@hidden>)

  • Prev by Date: Adding Items to Finder's SideBar
  • Next by Date: Reworked Worm example [Re: Small animation]
  • Previous by thread: RE: Showing a URL with spaces in a NSAlertPanel
  • Next by thread: Why is the View height changing when its Origin is changed, interesting isnt it??
  • Index(es):
    • Date
    • Thread