• 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: Automatically replacing part of text in a text label
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automatically replacing part of text in a text label


  • Subject: Re: Automatically replacing part of text in a text label
  • From: Rich Collyer <email@hidden>
  • Date: Tue, 17 Mar 2009 13:49:17 -0700

You might try just getting the name as an NSString with:

NSString applicationName = [[[NSBundle mainBundle] infoDictionary] objectForKey: CFBundleExecutable];

Than populate the dialog with that string (using the technique shown by Mark.

+++++++++++++++++++++++
Rich Collyer - Senior Software Engineer
email@hidden

IronKey - The World's Most Secure Flash Drive
2008 SC Magazine Readers Choice Award Winner
2008 FOSE Best of Show Winner
2007 GCN Labs Reviewers Choice Winner
+++++++++++++++++++++++




On Mar 17, 2009, at 1:33 PM, Peter Ammon wrote:


On Mar 15, 2009, at 11:20 PM, Peter Zegelin wrote:

I have some text labels in a registration dialog that contain the application name eg

"xxx Demonstration"
"Thank you for purchasing xxx"

and so on.

I would like this registration dialog to be general enough that I can use it in multiple applications. Is there a simple way to replace the xxx with the actual application name at runtime? At the moment I'm thinking I'll have to wire every label up to my registration controller and do it in awakeFromNib, but I was hoping for something easier.

Thanks!

Peter

You could create a subclass of NSTextField that does its own replacement. That would save you from having to create outlets.


-Peter

_______________________________________________

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:
@ironkey.com


This email sent to email@hidden

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

References: 
 >Automatically replacing part of text in a text label (From: Peter Zegelin <email@hidden>)
 >Re: Automatically replacing part of text in a text label (From: Peter Ammon <email@hidden>)

  • Prev by Date: Re: Automatically replacing part of text in a text label
  • Next by Date: Banding/smoothing problem with drawing angled gradients.
  • Previous by thread: Re: Automatically replacing part of text in a text label
  • Next by thread: Re: Automatically replacing part of text in a text label
  • Index(es):
    • Date
    • Thread