Re: combining two entities to one binding
Re: combining two entities to one binding
- Subject: Re: combining two entities to one binding
- From: Koen van der Drift <email@hidden>
- Date: Sun, 02 Oct 2011 10:42:29 -0400
On Oct 2, 2011, at 10:11 AM, Keary Suska wrote:
> Unfortunately not in the binding text itself, at least AFAIK. There are a number of ways to do this, the most obvious being adding a method to your model class such as:
>
> - (NSString *)hardReturn
> {
> return @"\n";
> }
>
> and adding it to your bind pattern. I have to say though, that this begs for a dynamic property as I describe above. It is much more extensible and easier to debug.
>
> If, however, you find that you will need to insert carriage returns in a number of different bindings for a number of different model objects, you might consider using an NSFormatter that, for example, replaces occurrences of the string "\n" with a newline. You could also set a category on NSController for the method above, and have it available for any binding. Many options.
I ended up just using two text fields below each other each showing a property. Of course, I now realize that the subject title is a bit misleading, I only have one entity with several properties.
- Koen._______________________________________________
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