애플 개발 사이트에서 Reachability로 검색을 한 후 샘플코드를 다운 받는다.

해당 파일에서 Reachability.h / Reachability.m 파일만 현재 프로젝트에 추가시킨 후

SystemConfiguration.framework 프레임을 추가시킨다. 
원하는 뷰에서 Reachability.h를 import 한 후 

int result = [[Reachability reachabilityForInternetConnection] currentReachabilityStatus]; NSLog(@"--%i",result ); 
결과가 0이면 접속불능 
1이면 와이파이 
2이면 3G 상태이다.

'Object-C' 카테고리의 다른 글

iphone open source  (0) 2011.06.19
단축키  (0) 2010.12.17
태그로 서브뷰 찾기  (0) 2010.12.15
NSLog  (0) 2010.12.15
adHoc  (0) 2010.12.13

control + command  + T :      Edit All in Scope
control + D :                         커서의 오른쪽 문자를 지움
control + K :                         라인의 나머지 부분을 지움 (Kill)
command + shift + D :           Open Quick 
command + R :                    북마크 추가
command + shift + F :           파일검색
option + click (창분할) :         세로로 창분할
command + control + S :       스냅샷을 만든다

-디버깅
command + option + P : 다시실행
command + option + O : 한줄실행후 멈춤
command + shift + T : 함수를 호출한 다음라인에서 개발자에게 제어권을 넘김
command + shift + Y : 디버거 실행


'Object-C' 카테고리의 다른 글

iphone open source  (0) 2011.06.19
아이폰에서 3G 인지 와이파이인지 알아보는 방법  (0) 2010.12.22
태그로 서브뷰 찾기  (0) 2010.12.15
NSLog  (0) 2010.12.15
adHoc  (0) 2010.12.13
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableview dequeueReusableCellWithIdentifier:CellIdentifier];

if(cell == nil)
{
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibname:@"PhotoTableCell" owner:self options:nil];
cell = [topLevelObjects objectAtIndex:0];
}

NSDIctionary *photoData = [[self appDelegate].photoArray objectAtIndex:indexPath.row];

UILabel *label;
lable = (UILabel *)[cell viewWithTag:2];
lable.text = [photoData valueForKey:@"Country"];

label = (UILabel *)[cell viewWithTag:3];
lable.text = [photoData valueForKey:@"Region"];

UIImageView *imageView= (UIImageView *)[cell viewWithTag:1];
imageView.image = [photoData valueForKey:@"Thumbnail"];

return cell;
}

'Object-C' 카테고리의 다른 글

아이폰에서 3G 인지 와이파이인지 알아보는 방법  (0) 2010.12.22
단축키  (0) 2010.12.17
NSLog  (0) 2010.12.15
adHoc  (0) 2010.12.13
category  (0) 2010.12.03

+ Recent posts