목록예전꺼(2014년이전꺼)/iOS (35)
liebus
UIView에 터치이벤트 UIView는 UIResponder의 sub class이다 따라서 Responder의 터치관련 이벤트처리 메소드를 Overring 해서 처리 한다. -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { } -(void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { } -(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { } -(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { }
UIAlertView 와 UIActionSheet UIAlertView는 팝업창 이라 생각 하면 되고 UIActionSheet는 모달뷰 형식의 선택 메뉴 정도라 생각 하면 될듣 사용하는 방법은 완전 비슷 한다. UIAlertViewDelegate 또는 UIActionSheetDelegate 를 Protocol로 선언한다. UIAlertView *av = [[UIAlertView alloc] initWithTitle:nil message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil]; [av setTitle:@"Hidden Memo"]; [av show]; [av release]; 와 같이 보인다. 물론 위의 그림은 ..
1. NSDate를 NSString으로 NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"yyyy-MM-dd hh:mm:ss"]; NSString *strDate = [formatter stringFromDate:[NSDate date]]; NSLog(@"%@", strDate); 2. NSString을 NSDate 으로 NSString *strDate = @"2011-12-04"; NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [strDate setDateFormat:@"yyyy-MM-dd"]; NSDate *date = [[NSDat..
상위view에서 하위view 만들때 delegate를 이용하자 self.downViewController = [[DownViewController alloc] initWithNibName:@"DownView" bundle:nil]; self.downViewController.delegate = self; ... 하위view에서 상위view의 Controller사용 [delegate presentModalViewController:self.downTwoViewController animated:YES]; 이래 하면 delegate가 상위view의 Controller가 됨 이거 몰라서 3일 해맸나? 젠장 ... 잊어버리지 말자 이거 까먹으면 짱구 -_-; 현재 작업하는 어플이 뷰가 3단개로 이루워져 있다 1..