links for 2009-07-30
Jul 31
-
http, download, cahcing
-
sample code
-
class
iPhone Developer
Jul 31
이 글은 alones님의 2009년 7월 30일의 미투데이 내용입니다.
Jul 30
iphone addTextFieldWithValue, apple, iphone, iPhone/iPod, TextField, UIAlertView, 아이폰, 애플, 앱, 앱 개발 1 Comment
예전에 delicious 해뒀었는데, 좀 쓰려고 하니 찾을 수가 없어서 구글링해서 다시 찾았다.
AppSotre에서 App을 구매할 때 password를 물어보는 Alert View 처럼 Alert View에 Text Field를 넣어서 사용하는 것이다. 아래 그림처럼.

예제 코드는 아래와 같다 (Ref: Alert with TextFields).
In the .h file
UITextField *textfieldName; UITextField *textfieldPassword;
In the .m file
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { // Clicked the Submit button if (buttonIndex != [alertView cancelButtonIndex]) { NSLog(@"Name: %@", textfieldName.text); NSLog(@"Name: %@", textfieldPassword.text); } } ... - (void) someMethod { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Please Login" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Submit", nil]; [alert addTextFieldWithValue:@"" label:@"User Name"]; [alert addTextFieldWithValue:@"" label:@"Password"]; // Username textfieldName = [alert textFieldAtIndex:0]; textfieldName.keyboardType = UIKeyboardTypeAlphabet; textfieldName.keyboardAppearance = UIKeyboardAppearanceAlert; textfieldName.autocorrectionType = UITextAutocorrectionTypeNo; // Password textfieldPassword = [alert textFieldAtIndex:1]; textfieldPassword.clearButtonMode = UITextFieldViewModeWhileEditing; textfieldPassword.keyboardType = UIKeyboardTypeNumbersAndPunctuation; textfieldPassword.keyboardAppearance = UIKeyboardAppearanceAlert; textfieldPassword.autocorrectionType = UITextAutocorrectionTypeNo; textfieldPassword.secureTextEntry = YES; [alert show]; }
UIAlertView::addTextFieldWithValue 을 사용하지 않고 Text Field를 직접 생성해서 Alert View에 추가 후에 버튼과 겹치지 않게 좌표계를 이동해주는 등 여러 가지 짓을 하는 경우도 아래와 같이 있지만, 위 코드가 깔끔한 것 같다.
Topic : Add TextField or other control to UIActionSheet or UIAlertView
UITextFiedl inside UIAlertView
UITextField in UIAlertView on iPhone – how to make it responsive?
하지만, 현재 이 방법은 undocumented 된 것으로 실제 코드를 사용해 보면 아래와 같은 warning이 발생한다.즉, Apple 심사에서 reject될 수도 있다.
훔, 관건은 UIAlertView::addTextFieldWithValue를 사용하지 않고도 이와 같이 UIAlertView에서 TextField를 사용할 수 있으니 심사 과정에서 통과할 수도 있다는 것이다.

Jul 30
web2.0 Google, wordpress, 블로그 7 Comments
이 번 블로그에서 써왔는데, WordPress로 옮겨서 사용하고 있지 않다가,
WordPress의 검색 기능도 불편함이 있어서, Google Custom Search를 다시 달았습니다.
우측에 있습니다.