ios - Cannot connect IBOutlet of UIView declared in protocol to a xib entity -
ios - Cannot connect IBOutlet of UIView declared in protocol to a xib entity -
i have iboutlet declared in protocol:
@protocol someprotocol <nsobject> @property (nonatomic, strong) iboutlet uiview* view; @end
then there class inherits protocol:
//.h @interface someclass : nsobject <someprotocol> @end //.m @implementation tsnfactoryviews @synthesize view = _view; @ned
and in xib file set someclass class owner expect see view outlet , connect appropriate xib instance.
in xcode 4 had no issue concept. since xcode 5, view disappears sometime , in xcode 6 has disappeared, strangely has disappeared in xib files, application can compile , run without issue.
the problem have new xib files because can not setup relationship. looks bug me.
edit:
the someclass in case mill class generates view instances or/and keeps instances of view. way several years without issue. connection bullet on left iboutlet uiview view;* disappeared. have many xib files file owners set single mill class (in post someclass) generating custom views.
a protocol lays out design needs in class. declaring iboutlet in protocol not magically add together property class adheres protocol.
you have add together iboutlet uiview* interface of someclass, able connect it.
additionally, makes no sense @ declare iboutlet in protocol. protocol should declare interface or api - means of implementation should class adhering protocol. hence questionable declare properties @ all, should rather declare methods (getters or setters).
in case means, add together protocol:
- (uiview*)view;
and class someclass can take implement via property this:
@property (nonatomic, strong) iboutlet uiview* view;
ios xcode6 protocols xib iboutlet
Comments
Post a Comment