title: Registering Custom Collection View Cell in UIView
body: <p>I have the identical code from the answer to this <a href="https://stackoverflow.com/questions/19269266/reused-cells-in-a-uicollectionview-show-multiple-uiimageviews-when-they-should-o">question</a>. I am trying to implement a custom view cell and it is doing so and works up until the point it casts the cell and tries to assign properties of my custom view cell (because it is still sees the cell as a UICollectionViewCell rather than CustomViewCell).</p>
  
  <p>The log error that returns still gives the problem associated with registering the custom cell at viewDidLoad/loadView:</p>
  
  <pre><code>-[UICollectionViewCell imageView]: unrecognized selector sent to instance 0x1658c540
  </code></pre>
  
  <p>I am calling the collection view in a UIView, rather than a UIViewController, so there is no class method for viewDidLoad. I tried to implement the register in a method that I know is called first. </p>
  
  <p>How do I manage to get the custom cell class registered? And for that matter, how do I make methods that get run once at the beginning of the instance like a viewDidLoad method?</p>
  
  <p>Let me know if more code is necessary; I will update the question. </p>
  
  <p>EDIT_1:</p>
  
  <p>Turns out I was declaring it in older code I haven't combed over in a while. However, @Wyatt got the logic I needed, however it seems that the NSLog doesn't get run for that method. Anyway I found that I was registering twice in some older code I hadn't combed over in a while that gets called after the init. @Neil's answer is also correct. Thanks guys!</p>