Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9184351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:01:33+00:00 2026-06-17T19:01:33+00:00

I created a subclass of NSTableCellView to do some custom drawing. The table’s content

  • 0

I created a subclass of NSTableCellView to do some custom drawing. The table’s content is obtained through a binding to an NSArrayController, thus, new instances of my NSTableCellView subclass are created ‘automatically’ when new data are added to the NSArrayController. I need some code to run once when a new instance is created so I thought it should go in init. I implemented both init and initWithFrame (see below) but neither of these seem to be called when new instances of the subclass are created (i.e. I don’t see my NSLog messages in the console). Is there a different init method that I should use?

- (id)init {
    self = [super init];
    if (self) {
        // Initialization code here.
        NSLog(@"init");
    }
    return self;
}

- (id)initWithFrame:(NSRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code here.
        NSLog(@"init with frame");
    }
    return self;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:01:34+00:00Added an answer on June 17, 2026 at 7:01 pm

    To answer your question, the designated initializer is initWithFrame:. However, if a view is encoded in a NIB (as it is in this case), initWithCoder: is called. You have to override that method.

    Don’t use awakeFromNib; in general, it may get called more often than you expect, and I’ve seen it cause people trouble.

    However, a good place to do initialization of your cell is in the table view delegate method viewForTableColumn:row: — you can still use it and use bindings.

    corbin
    (I wrote the class in question).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a custom subclass of NSCell with an NSImageCell, some NSTextFieldCells, and an
I have created a subclass of UITableViewController that is used as the custom class
I have created a custom subclass of UITableViewCell. There, I allow the user to
I created a custom UITableViewCell subclass which contains a button named testbtn . I
I've created a subclass of UIScrollView to implement a one of my custom controls,
I created a subclass of AFHTTPClient and am trying to send some JSON parameters
I have created a a subclass of Table in my ASP.NET project which creates.
I've created a subclass of Array and written some messages for it that have
I have created a subclass of a UITableViewCell that I am using with some
I created a subclass from UIView #import <UIKit/UIKit.h> @interface MeeSelectDropDownView : UIView { UILabel

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.