본문 바로가기

분류 전체보기

iphone 로컬라이징 출처 : http://www.pcraft.kr/103 1. xib 로컬라이징 xib는 아시다시피 Interface Builder로 만든 UI 인스턴스 입니다. xcode에서 로컬라이징할 xib를 선택한후 Get Info를 합니다. General Tab에서 Make Localization을 클릭하면 기본적으로 English가 만들어집니다. Korean을 추가하려면 Add Localization을 클릭하여 Korean을 입력하면 생성이 됩니다. 이 순간부터 독립적인 UI가 생기므로 개발이 완료된 후 이 작업을 하시는 것이 좋습니다. 이제는 기존 xib파일이 2개로 나뉘어 있는 것을 보실 수 있는데, 그중 English를 더블클릭하여 Interface Builder로 여신후 Tool - Strings로 변경을.. 더보기
custom keyboard 1) Overlay an image. 2) Overlay a button. And you’re done. Here’s the code I used: - (void)textFieldDidBeginEditing:(UITextField *)textField { // locate keyboard view UIWindow* tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1]; UIView* keyboard; UIImageView *decimalKeyboard = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 216)]; decimalKeyboard.image = [UIImage.. 더보기
개발자료 정리 출처 : http://improgrammer.com/12 -푸쉬 서버 개발 관련 자료- 이지 APNS 오픈 소스 라이브러리 http://www.easyapns.com/ 구글 코드 APNS 오픈 소스 http://code.google.com/p/apns-php/ 서버 튜토리얼 http://blog.boxedice.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial/ -label이나 textView에 현재 시간을 표시하고 싶습니다- NSDate *t = [NSDate date]; NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; NSString *timeSt.. 더보기
NSString 자주 쓰는 함수 NSDate를 NSString으로 Iphone NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"yyyy년 MM월 dd일 hh:mm:ss"]; NSString *strDate = [formatter stringFromDate:[NSDate date]]; NSLog(@"%@", strDate); //---------------------------------------------------------- NSString* aStr = [[NSString alloc] initWithData:aData encoding:NSUTF8StringEncoding]; NSData* aData = [aStr data.. 더보기
UIImageView URL로 로드하기 UIImageView *tempImageView = [[UIImageView alloc] initWithImage:[UIImage imageWithData: [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.abc.com/image.png"]]]]; 더보기
어디서든 키보드 감추기 //키보드를 사라지게 하기 위해 사용하는 재귀함수 - (void)_hideKeyboardRecursion:(UIView*)view { if ([view conformsToProtocol:@protocol(UITextInputTraits)]) { [view resignFirstResponder]; } if ([view.subviews count]>0) { for (int i = 0; i < [view.subviews count]; i++) { [self _hideKeyboardRecursion:[view.subviews objectAtIndex:i]]; } } } //키보드 감추기 - (void)hideKeyboard { UIWindow *tempWindow; for (int c=0; c < [[[UIAp.. 더보기
하위뷰에서 상위뷰 컨트롤 하는 방법 NSString *className = [NSString stringWithFormat:@"%s", object_getClassName([self.superview nextResponder])]; if ([className isEqualToString:@"XXXXlViewController"]) { [(XXXXlViewController *)[self.superview nextResponder] sizeToFit]; } 더보기
원하는 문자만 입력 받기 LEGAL 에 있는 문자만 입력 받는 방법 #define LEGAL @"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz " textField의 delegate의 shouldChangeCharactersInRange를 아래와 같이 구현 - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { NSCharacterSet *cs = [[NSCharacterSet characterSetWithCharactersInString:LEGAL] invertedSet]; NSString *.. 더보기
Sqlite 파일 디바이스에 저장하기 // First, test for existence. BOOL success; NSFileManager *fileManager = [NSFileManager defaultManager]; NSError *error; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *writableDBPath = [documentsDirectory stringByAppendingPathComponent:@"TESTDB.sqlite"]; success = [fileManager fil.. 더보기