목록분류 전체보기 (166)
liebus
NSString *strTemp = @"test.PNG"; // 이미지 이름 NSString *temp=[NSString stringWithFormat:@"%@/Documents/%@", NSHomeDirectory(), strTemp); //Documents에서 strTemp이미지의 위치 얻는다. UIImage *iiTemp = [UIImage imageWithContentsOfFile:temp]; // Documents에서 이미지를 읽어 올때는 imageName은 안먹더라 // 꼭 imageWithContentsOfFile: 로 땡겨 오길 바람
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..