osx - Cocoa: initWithFrame from a custom view proxy is not being called -


according apple's document creating custom view method should called if you're using custom view proxy in interface builder.

if have not created interface builder palette custom view, there 2 techniques can use create instances of subclass within interface builder. first using custom view proxy item in interface builder containers palette. view stand-in custom view, allowing position , size view relative other views. specify subclass of nsview view represents using inspector. when nib file loaded application, custom view proxy creates new instance of specified view subclass , initializes using initwithframe: method, passing along autoresizing flags necessary. view instance receives awakefromnib message.

unfortunately, it's not been called in case. has had deal issue?

there's new behavior in recent versions of xcode when deploying recent versions of os. in file inspector of nib, see if runtime behavior — instantiation: prefer coder checked. if is, uncheck if need/want -initwithframe: called custom views. or, leave checked , take advantage of fact nib loading machinery call -initwithcoder:. of course, should make sure class property supports nscoding encoding , decoding custom internal state makes sense serialize.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -