PDA

View Full Version : Why can't I initialize my custom class?




DavidCar
Jan 24, 2007, 10:26 PM
In this example I posted earlier:

"My Approach to printing NSTableView"

http://forums.macrumors.com/showthread.php?t=273153

I was never able to properly initialize my custom NSBox class. I used Interface Builder to declare an NSBox to belong to the custom class, and the other methods there are called correctly, but not the init or initWithFrame methods, so I had to use an inelegant way of doing it.

Any thoughts as to what I'm doing wrong?



kainjow
Jan 24, 2007, 11:50 PM
Your NSBox subclass may be created via the initWithCoder: method.

DavidCar
Jan 25, 2007, 12:24 AM
Your NSBox subclass may be created via the initWithCoder: method.

I just tested it, and you're correct. Problem solved.

Thanks for the suggestion.

DC