xcode - How to create a Prototype cell in a Dynamic UITableView? -
this question has answer here:
i made dynamic uitableviewcell uimageview , uilabel.
i linked items code, build , gave me alarm:
couldn't compile connection: <ibcocoatouchoutletconnection:0x7ff657212ee0 <ibproxyobject: 0x7ff6572e5e30> => nationlabel => <ibuilabel: 0x7ff6572e2bd0>>
i've never worked dynamic cells it's stupid mistake of mine, can understand reason of it. how can solve it? thank you!
sounds you're trying establish outlets prototype cell view controller. mentioned in comments, isn't going work because there potentially multiple cells , can't connected same outlet. so, first thing need delete these outlet connections storyboard. once you've done that, code should compile. there have 2 options (well, i'm sure there other ways this, these normal ones):
in storyboard, set unique values
tag
property each element, e.g. make image 1 , label 2. in view controller, anytime need access element, can calling[self.view viewwithtag:]
.create custom cell subclass of
uitableviewcell
, assign prototype, , create outlets between prototype , subclass.
it sounds you've tried (1) , got stuck. if stuck, explain specific issue you're having , work out.
Comments
Post a Comment