• 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: Passing arguments through a binding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing arguments through a binding


  • Subject: Re: Passing arguments through a binding
  • From: Shripad Hebbar <email@hidden>
  • Date: Thu, 20 Dec 2007 10:18:24 +0530


My application is one of several front-ends to a shell-script based installer. The back-end runs on multiple platforms and provides all of the resources (strings) to the various front-ends upon request. It is not feasible to restructure this application so that the Cocoa based front-end uses resources from a NIB-file, they need to be provided by the back-end at runtime.
Obviously you have to use bindings where titles of each of you controls need to be bound to a controller
object which could be a kind of facade to your strings that come from your back-end.

If possible, I'd like to avoid having to manually query for each
internationalized string in code. I'm a Cocoa newbie, so maybe there is
something obvious that I'm missing, but it looks like unless I can pass
an argument to a binding, I'm basically out of luck.
As I said, write a facade which hides all the details as how the title strings are generated. Have clean
KVC compliant methods to return those titles. And in NIB bind your controls to appropriate keys
governed by the KVC compliant methods. Read more on KVC-KVO :


http://developer.apple.com/documentation/Cocoa/Conceptual/ CocoaBindings/CocoaBindings.html

However there would be a problem where localized strings may have different sizes in different languages and
you will have to take care that your controls are properly resized to fit the title.


-Shripada


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

  • Follow-Ups:
    • Re: Passing arguments through a binding
      • From: Nathan Auch <email@hidden>
  • Prev by Date: Re: Edit textView with IB
  • Next by Date: Re: Adding category @interface to header file causes IB to freak out?
  • Previous by thread: Re: Passing arguments through a binding
  • Next by thread: Re: Passing arguments through a binding
  • Index(es):
    • Date
    • Thread