• 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: Bind to single table selection but not multiple?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bind to single table selection but not multiple?


  • Subject: Re: Bind to single table selection but not multiple?
  • From: Trygve Inda <email@hidden>
  • Date: Mon, 11 Sep 2006 15:43:12 +0000
  • Thread-topic: Bind to single table selection but not multiple?

> This thread should help (ignore my post which was kindly corrected):
> http://www.cocoabuilder.com/archive/message/cocoa/2006/6/30/166668
>
> George
>
>

Thanks George,

So:

- (id)transformedValue:(id)value {
    return (([value intValue] > 1) ? [NSNumber numberWithBool:NO] : value);
}


How do I tell IB about this method... Since there seems to be no way to
determine that this is coming from my table.

Can I somehow enter this line (or a variation of it) on the value transform
line in IB?

Or did you use:

@implementation MyNSArrayController

- (void) awakeFromNib {
  [self addObserver:self forKeyPath:@"selectedObjects"
            options:0 context:nil];
}

- (void)observeValueForKeyPath:(NSString *)keyPath
            ofObject:(id)object change:(NSDictionary *)change
            context:(void *)context {
  [self setValue:
      [NSNumber numberWithBool:
        [[self selectedObjects] count] == 1]
      forKey: @"selectionIsOne"];
}

@end

Thanks,

Trygve


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Bind to single table selection but not multiple?
      • From: George Orthwein <email@hidden>
References: 
 >Re: Bind to single table selection but not multiple? (From: George Orthwein <email@hidden>)

  • Prev by Date: MEETING: Chicago - CocoaHeads / CAWUG September 12th
  • Next by Date: Unit testing core data
  • Previous by thread: Re: Bind to single table selection but not multiple?
  • Next by thread: Re: Bind to single table selection but not multiple?
  • Index(es):
    • Date
    • Thread