Custom UICollectionViewCell question.

Susan Cudmore susan.cudmore at gmail.com
Wed Aug 28 17:04:41 EDT 2013


Before anyone else spends cycles thinking about this... problem solved.
Thanks T.J.!

I was setting the cell identifier in the storyboard and then also
registering it programatically. Oy!


On Wed, Aug 28, 2013 at 2:20 PM, Susan Cudmore <susan.cudmore at gmail.com>wrote:

> Hi All,
>
> I'm trying to use a custom UICollectionViewCell that has a top level view
> with subviews including an imageview, and several labels that I need to set
> when the cell is loaded. I am using storyboards and creating the
> aforementioned views in the cell that shows up when I drag in a
> UICollectionView. I believe the identifiers are set correctly and I am
> registering the cell with the UICollectionView obj in viewDidLoad. I have
> also hooked up Outlets (at least it appears so to me) in my
> UICollectionViewCell for each of the properties that I wish to set at run
> time.
>
> I'm trying to dequeue my custom cell using its identifier in
> cellForIndexPath. I see that the initWithFrame method gets called on my
> custom UICollectionViewCell. It seems that unless I set the frame on all of
> the views and programmatically add them to the contentView of the
> UICollectionViewCell, the views don't show up. At that point, why am I
> bothering to put any of these views in IB?
>
> Any idea what I might be missing? Would I be better off creating a nib and
> loading the cell from a nib rather than have it embedded in the
> UICollectionView in the storyboard?
>
> Thanks for any pointers!
>
> /Sue
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mactechgroup.org/pipermail/mactechgroup-discuss/attachments/20130828/f8a5eaa4/attachment-0001.html>


More information about the MacTechGroup-discuss mailing list