ios4 - Place UIButton randomly on the view -


thank great site, biginner in ios programming , find site immensely helpfull.

actualy have 2 questions:

1) how transform nsstring nsaray of chars?
2) how place uibutons randomly on view when each button.title shows 1 char new char array?

i programaticaly.

  1. to transform nsstring nsaray of chars:

    nsmutablearray *characters = [[nsmutablearray alloc]  initwithcapacity:[mystring length]];  (int i=0; < [mystring length]; i++)  {  nsstring *ichar = [nsstring stringwithformat:@"%c", [mystring characteratindex:i ]];   [characters addobject:ichar];  }  

2.place uibutons randomly on view when each button.title shows 1 char new char array

    uibutton *charbutton = [[uibutton alloc]initwithframe:cgrect(<your required frame>)];     charbutton.titlelabel.text = [characters objectatindex:<ur required value>];     [self.view addsubview:charbutton] 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -