Titanium JIRA Archive
Appcelerator Community (AC)

[AC-4413] Hyperloop iOS - Using "ViewForTag" returns an object without previously defined methods.

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2016-09-29T20:16:48.000+0000
Affected Version/sAppcelerator Studio 4.5.0
Fix Version/sn/a
ComponentsHyperloop
Labelshyperloop, ios
ReporterRodolfo Perottoni
AssigneeShak Hossain
Created2016-09-02T06:25:05.000+0000
Updated2016-09-29T20:16:48.000+0000

Description

I'm facing a weird issue while using the code from the attached "HL_CollectionView". The line number 40 is throwing a "function not defined" error. I'm just executing the command *setText* of UILabel, which is also executed in the line 44. For some reason when i recover the UILabel from my *UICollectionViewCell* using the method *viewWithTag* it doesn't have the *setText* method available anymore, which makes using UICollectionViews kinda useless in this case... The error is also attached.

Attachments

FileDateSize
HL_CollectionView.js2016-09-02T06:15:03.000+00002977
UICollectionViewDelegate.js2016-09-02T06:15:03.000+00001319
UICollectionView error.rtf2016-09-02T06:24:37.000+00007700

Comments

  1. Nuno Costa 2016-09-09

    In my tests and before test this TAG tip in order to not duplicate views when cell are dequeue, I used :
       
       var nameLabel =  UILabel.alloc().initWithFrame(CGRectMake(0, 0, 80, 40));
       nameLabel.text =  data[indexPath.row].firstName;
       
       cell.contentView.addSubview(nameLabel);
       
    In order to not crash, not use the "setText" method and use the" text" property.
       label.setText('foo')
       
    by
        label.text = 'foo'  
       
    works.

JSON Source