• 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: Strange behavior of view based NSTableView with NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange behavior of view based NSTableView with NSTextView


  • Subject: Re: Strange behavior of view based NSTableView with NSTextView
  • From: Jonathan Mitchell <email@hidden>
  • Date: Sat, 18 Jul 2015 18:50:44 +0100

> On 18 Jul 2015, at 14:37, Nick <email@hidden> wrote:
>
>
> here. Could you suggest me what am i doing wrong?
> Thanks
>
>
>   if([[tableColumn identifier] isEqualToString:@"FirstColumn"]) {
>
>       NSTableCellView *tableCellView = [tableView makeViewWithIdentifier:
> @"FirstColumnCellView" owner:tableView];
>
>       NSTextView *view = [[[tableCellView subviews][0] subviews][0]
> subviews][0];
>
>       view.string = [NSString stringWithString:self.entries[row]];
>
>       view.delegate = self;
>
>
>       return tableCellView;
>
>   }
>
>
Not sure but try this.
In the call to  -makeViewWithIdentifier:owner: try setting the owner to nil (I tend to do this) or the table delegate (the default superclass implementation does this).
The owner receives an -awakeFromNib: call each time -makeViewWithIdentifier:owner: is issued which can cause unexpected behaviour

> [[[tableCellView subviews][0] subviews][0]
> subviews][0];
Your code will be a lot more maintainable if you declare an NSTableCellView subclass here with proper outlets.
Do you really need an NSTextView rather than an NSTextField?

Jonathan



_______________________________________________

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: 
 >Strange behavior of view based NSTableView with NSTextView (From: Nick <email@hidden>)

  • Prev by Date: Re: XPC Services & non-Sandboxed Applications
  • Next by Date: Re: AfxIsValidAddress
  • Previous by thread: Strange behavior of view based NSTableView with NSTextView
  • Next by thread: Re: XPC Services & non-Sandboxed Applications
  • Index(es):
    • Date
    • Thread