iphone - Clear all Text Fields using a for loop? -


i've used:

iboutlet uitextfield *text1, *text2; 

for referring textfields.

and clear each 1 using:

[text1 settext:@""]; [text2 settext:@""]; 

if wanted clear @ once using loop, how should write code ?

u should assign tag each textfield(say 1,2)

then ur code should follows,

for(int i=1; i<=2;i++) {     uitextfield *tf=(uitextfield *)[self.view viewwithtag:i];     [tf settext:@""]; } 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -