iphone - adding uitextfields dynamically at runtime -


i want generate textfields dynamically in app scenario having textfield , button if entered number 2 in textfield , pressed button, 2 texfields must generated on view controller

you can achieve using code;

int num=yournum; (int = 1; <= num; i++) {      uitextfield *textfield = [[uitextfield alloc] initwithframe:cgrectmake(...)];     textfield.tag = i;     ...     [self.view addsubview:textfield]; } 

and access correct text field afterwards you'd call [self.view viewwithtag:tag].


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -