Custom NSCell drawWithFrame:inView method not getting invoked in OSX 10.8
I have an application where I have defined a custom cell and have overridden the method - (void) drawWithFrame:inView:
This method was drawing my custom cells without any problems as long as I was building my app using Xcode 3.2 on OS X 10.6 or older.
Now I am attempting to migrate the code to build with Xcode 4+ on OS X 10.8. And what I have found out is that my custom cell is not getting drawn anymore. After putting break points and running the app through the debugger, I realized that the overridden - (void) drawWithFrame:inView: method of the custom cell is not getting invoked at all.
My questions are:
1) What is it that makes this method to not invoke at all on OS X 10.8, while it gets invoked and works perfectly fine on OS X 10.6 or older?
2) What alternative do I have to fix this issue?
Apple's documentation advises not to invoke drawWithFrame:inView in you're own subclasses, but advises people to use the drawInteriorWithFrame:inView: method instead.
The documentation for the latest implementation of the NSCell class is listed below.
The reason it's not working in the later OSX versions, is because this particular NSCell method has been changed in the way it's implemented.
Once upon time this method used to be named drawWithFrameInView:, but that version has been deprecated now.
According to the documentation, drawWithFrame:inView: invokes drawInteriorWithFrame:inView: after it draws the cell's border.
I tried overriding drawInteriorWithFrame:inView: in my code. That doesn't get invoked either.
I was reading the drawInteriorWithFrame:inView: method description in the documentation, listed below, and thats where it reccomends not using the drawWithFrame:inView: method,
but if neither method is getting called then it's irrelevant anyway.
|All times are GMT -4. The time now is 11:32 PM.|
Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.