ios - For loop based on array length in Swift -



ios - For loop based on array length in Swift -

i have been trying take length of array , utilize length set amount of times loop should execute. code:

if notes.count != names.count { notes.removeallobjects() var namearraylength = names.count index in namearraylength { notes.insertobject("", atindex: (index-1)) } }

at moment error:

int not have fellow member named 'generator'

seems simple issue, haven't yet figured out solution. ideas?

you need specify range. if want include namearraylength:

for index in 1...namearraylength { }

if want stop 1 before namearraylength:

for index in 1..<namearraylength { }

ios for-loop swift

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -