Using "foreach"


hello all

have view several textfields on want test nullstrings when user presses button.

have several if statements check this, wondering how use "for each" looping cycle through them instead , cut down on code.

view conform hierarchical structure that, example, textfields contained within view? if case perceived like:

foreach(uitextview in uiview) {

............code here......

}

correct - how written?

many help.

cheers.
 

uiview not container (directly) can't that. use foreach iterate of the subviews property you'd have check each item see if uitextview. compiler won't automatically you.
 


Forums iPhone, iPad, and iPod Touch iOS Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments