xcode - How to create a Prototype cell in a Dynamic UITableView? -


this question has answer here:

i made dynamic uitableviewcell uimageview , uilabel. enter image description here

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):

  1. 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:].

  2. 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

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -