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
Post a Comment