목록예전꺼(2014년이전꺼)/iOS (35)
liebus
버튼을 3개를 만들고(A버튼, B버튼, C버튼) A버튼 배경색 흰색 B버튼 배경색 흰색 C버튼 배경색 흰색 이래 만들고 A버튼 클릭시 B버튼 블루색 C버튼 레드색 2초 후 B버튼 래드색 C버튼 블루색 일케 할려고 했다. 해서 첨음 sleep() 을 사용했다. -_-;;; 아래 처럼 누차 말하지만 워낙 아는게 없어서;; -(IBAction)touchButton:(id)sender { [self.btnB setBackgroundImage:[UIImage imageNamed:BLUE_35] forState:UIControlStateNormal]; [self.btnC setBackgroundImage:[UIImage imageNamed:RED_35] forState:UIControlStateNormal]; sl..
view 생성시 설정한 tag로 view를 얻어 오는 방법 현재 진행하고 있는 간략한 게임이 30개의 버튼이 있고 이 버튼중 사용자가 터치한 버튼을 찾는 게임(?)을 개발하고 있다. 물론 button touch event의 sender를 이용하여 할 수 도 있지만 버튼 생성시 지정한 tag로 버튼의 값을 알아 오는 방법 여러개의 뷰가 존재 할때 필요한 view를 얻어 올때 편리 할듣 viewWithTag 를 이용 UIButton *tempBtn = (UIButton *)[self.view viewWithTag:touchCount]; tempBtn은 touchCount 의 tag번호를 가지고 있는 Button되시겠다. 내가 워낙 허접하다 보니까 이런거 까지 까먹어서 적어 놓다니 젠장 ㅠ
NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, YES); NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil; return basePath;