> On 18 Jul 2015, at 14:37, Nick <[email protected]> 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 protected]) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
