본문 바로가기

iPhone

[iPhone] UIAlertView 자동종료 #pragma mark - alert창 선택시 불리는 함수 -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ if([alertView tag]==PHONE && buttonIndex == YES) { _phone = [_phone stringByAppendingString:@"\n\ncalling...."]; UIAlertView *alert = [[UIAlertView alloc ]initWithTitle:_phone message:@"wait.. 더보기
[iPhone] 동기식 다운로드 download NSURL *url = [NSURL URLWithString:/*파일 다운 받을 url 주소 */]; NSMutableURLRequest *thrRequest = [NSMutableURLRequest requestWithURL:url]; NSURLResponse *response; NSError *error; NSData *getedData = [NSURLConnection sendSynchronousRequest:thrRequest returningResponse:&response error:&error]; NSString*_path = [[NSHomeDirectory() stringByAppendingString:@"/Documents/"] stringByAppendingString:[response.. 더보기
[iPhone] Uivew 밀는 효과 ******controller.h //******************************************************// IBOutlet UIView *menuView; //******************************************************// ******controller.m //******************************************************// - (void)viewDidLoad { UIPanGestureRecognizer* drg = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(dragGesutreMethod:)];//내가 만든 함수 [me.. 더보기
[iPhone] 어플 실행시 navigation barbutton 만들기 Alpha_viewDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. UINavigationController *navi= [[UINavigationController alloc] initWithRootViewController:[[Alpha_viewViewController alloc]init]]; [self.window addSubview:navi.view]; //self.window.rootViewController = sel.. 더보기
[iPhone] UITableVIew 꼭 써야하는 함수 tableView:cellForRowAtIndexPath: Asks the data source for a cell to insert in a particular location of the table view. (required) - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath Parameters tableView A table-view object requesting the cell. indexPath An index path locating a row in tableView. Return Value An object inheriting from UITableView.. 더보기
[iPhone] UIAlertView 창 띄우기, 사라지게 하기 ***.h 해더 파일 /*뱅글뱅글 하게 돌아가게 하는것 */ IBOutlet UIActivityIndicatorView *activityIndicator; /*경고 창 에 띄우는 것*/ IBOutlet UIAlertView *alert; ****.m 소스 파일 //알람창 alert = [[UIAlertView alloc] initWithTitle:@"홈페이지에서 정보 수집중message:@"LOADING ..." delegate:self cancelButtonTitle:nil otherButtonTitles:nil]; [alert show]; //빙글뱅글 //빙글뱅글 activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicato.. 더보기
[iPhone] Uitableview 선택 해제 //셀 선택시 이벤트를 처리하는 함수 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES];//선택해제 } 더보기
[iPhone] Thread 작성법 및 UI 변수와 데이터 주고 받기 *Thread 생성법:: NSThread *myThread; myThread = [[NSThread alloc] initWithTarget:self selector:@selector(/*함수명*/) object:nil]; [myThread start]; *UI 변수와 주고 받는 법 [self performSelectorOnMainThread:@selector(writeLabel:)//여기는 함수 명 withObject:@"START" //여기는 파라미터 waitUntilDone:YES]; -(void)writeLabel:(NSString *)msg { label.text = msg; //label은 IBOutlet UILabel*label; textView.text = msg; //textView 는 I.. 더보기
[Iphone] 홈버튼 눌렀을시 종료 시키기 ...AppDelegate.m 파일 내에서 - (void)applicationDidEnterBackground:(UIApplication *)application { exit(0);//백그라운드로 갈때 프로그램 종료 시킴 작성 } 더보기
[iPhone] webview 에 화면 출력 IBOutlet UIWebView* _web; IBOutlet UIViewController * _ViewWeb; NSString *strurl = @"http://....... 링크 주소 "; NSURL *url = [NSURL URLWithString: strurl]; NSURLRequest *request = [NSURLRequest requestWithURL: url]; [_web loadRequest:request]; self.view = _ViewWeb.view; 더보기

반응형