viewwithtag

Swift, collection view & storyboard, get null when using viewWithTag on another Label

一笑奈何 提交于 2020-01-06 18:43:09
问题 I am seeing some extremely odd behavior that I would like some assistance with. I have a collection view cell that originally had one label, with a tag of 43. I am setting the value of the label using the following code: func collectionView(collectionView: UICollectionView!, cellForItemAtIndexPath indexPath: NSIndexPath!) -> UICollectionViewCell! { let object = self.fetchedResultsController.objectAtIndexPath(indexPath) as NSManagedObject let cell = collectionView

XCode 6 UICollectionview viewwithtag not working

老子叫甜甜 提交于 2019-12-21 14:59:17
问题 Seems XCode 6 is different in using viewwithtags then XCode 5 was. I am using the following code in XCode 6 with Storyboards. 50 cells are created but the label is not visible.Everything is set correctly like the tag etc. If I use the "old" XCode 5 way to do it with Register cell classed it seems to work for iOS 7 but in iOS 8 the data is not passed to the label until I start to scroll. static NSString * const reuseIdentifier = @"MyCell"; - (void)viewDidLoad { [super viewDidLoad]; // Register

XCode 6 UICollectionview viewwithtag not working

旧巷老猫 提交于 2019-12-04 10:09:39
Seems XCode 6 is different in using viewwithtags then XCode 5 was. I am using the following code in XCode 6 with Storyboards. 50 cells are created but the label is not visible.Everything is set correctly like the tag etc. If I use the "old" XCode 5 way to do it with Register cell classed it seems to work for iOS 7 but in iOS 8 the data is not passed to the label until I start to scroll. static NSString * const reuseIdentifier = @"MyCell"; - (void)viewDidLoad { [super viewDidLoad]; // Register cell classes [self.collectionView registerClass:[UICollectionViewCell class]

UICollectionView cell.ViewWithTag returning nil for UILabel

陌路散爱 提交于 2019-12-04 05:03:06
问题 This label seems to return nil, even though I have the reuseIdentifier and tag set properly. override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { var identifier: String = "CollectionCell" var cell: UICollectionViewCell = collectionView.dequeueReusableCellWithReuseIdentifier(identifier, forIndexPath: indexPath) as! UICollectionViewCell // Configure the cell //save till later, when images are actually present /

UICollectionView cell.ViewWithTag returning nil for UILabel

限于喜欢 提交于 2019-12-02 04:50:43
This label seems to return nil, even though I have the reuseIdentifier and tag set properly. override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { var identifier: String = "CollectionCell" var cell: UICollectionViewCell = collectionView.dequeueReusableCellWithReuseIdentifier(identifier, forIndexPath: indexPath) as! UICollectionViewCell // Configure the cell //save till later, when images are actually present //var cellItem1 = hostManager[indexPath.row * 2] let label:UILabel = cell.viewWithTag(1) as! UILabel