iOS Question I need someone to help me with compile error

tsteward

Well-Known Member
Licensed User
Longtime User
Converting my app to b4i and when I try to compile I get the attached error.
It is in b4xpage b4i_b4xpagetool and I think it's related to b4i_swiftbutton (which I have quite a few in this layout) but I have no idea where/how.
The error report is just overwhelming for me
 

Attachments

  • new 1.txt
    156.6 KB · Views: 19

aeric

Expert
Licensed User
Longtime User
I saw this:
B4X:
B4i line: 543
For Each vw As Label In CutsA
property 'object' not found on object of type 'NSObject *'
Are you sure CutsA is an array or list that can be iterated?
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
I saw this:
B4X:
B4i line: 543
For Each vw As Label In CutsA
property 'object' not found on object of type 'NSObject *'
Are you sure CutsA is an array or list that can be iterated?
my app has Cutsa declared as below and I can iterate over them in B4A

Class Globals
Private CutsLblA(12), CutsA(12),CutsB(12) As B4XView
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
CutsTxtA1 etc are
B4X:
Private cutsTxtA12,cutsTxtA11,cutsTxtA10,cutsTxtA9,cutsTxtA8,cutsTxtA7,cutsTxtA6,cutsTxtA5,cutsTxtA4,cutsTxtA3,cutsTxtA2,cutsTxtA1 As Label

Then in a setup routine in my app I fill the array like this
B4X:
count = 0
    For Each b4txt As Label In Array(cutsTxtA1,cutsTxtA2,cutsTxtA3,cutsTxtA4,cutsTxtA5,cutsTxtA6,cutsTxtA7,cutsTxtA8,cutsTxtA9,cutsTxtA10,cutsTxtA11,cutsTxtA12)
        CutsA(count) = b4txt
        CutsA(count).Visible=False
        count = count+1
    Next
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
In this line, i would change As Label to As B4XView:
B4X:
Private cutsTxtA12,cutsTxtA11,cutsTxtA10,cutsTxtA9,cutsTxtA8,cutsTxtA7,cutsTxtA6,cutsTxtA5,cutsTxtA4,cutsTxtA3,cutsTxtA2,cutsTxtA1 As B4XView

Instead of this code:
B4X:
    count = 0
    For Each b4txt As Label In Array(cutsTxtA1,cutsTxtA2,cutsTxtA3,cutsTxtA4,cutsTxtA5,cutsTxtA6,cutsTxtA7,cutsTxtA8,cutsTxtA9,cutsTxtA10,cutsTxtA11,cutsTxtA12)
        CutsA(count) = b4txt
        CutsA(count).Visible=False
        count = count+1
    Next
Use simply this code:
B4X:
CutsA = Array As B4XView (cutsTxtA12,cutsTxtA11,cutsTxtA10,cutsTxtA9,cutsTxtA8,cutsTxtA7,cutsTxtA6,cutsTxtA5,cutsTxtA4,cutsTxtA3,cutsTxtA2,cutsTxtA1)
 
Upvote 0
Top