Develop
2014.03.26 11:04
[ios] 유용한 매크로
조회 수 3701 댓글 0
# 유용한 매크로
#define ApplicationDelegate ((MyAppDelegate *)[[UIApplication sharedApplication] delegate]) #define UserDefaults [NSUserDefaults standardUserDefaults] #define SharedApplication [UIApplication sharedApplication] #define Bundle [NSBundle mainBundle] #define MainScreen [UIScreen mainScreen] #define ShowNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = YES #define HideNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = NO #define NetworkActivityIndicatorVisible(x) [UIApplication sharedApplication].networkActivityIndicatorVisible = x #define NavBar self.navigationController.navigationBar #define TabBar self.tabBarController.tabBar #define NavBarHeight self.navigationController.navigationBar.bounds.size.height #define TabBarHeight self.tabBarController.tabBar.bounds.size.height #define ScreenWidth [[UIScreen mainScreen] bounds].size.width #define ScreenHeight [[UIScreen mainScreen] bounds].size.height #define TouchHeightDefault 44 #define TouchHeightSmall 32 #define ViewWidth(v) v.frame.size.width #define ViewHeight(v) v.frame.size.height #define ViewX(v) v.frame.origin.x #define ViewY(v) v.frame.origin.y #define SelfViewWidth self.view.bounds.size.width #define SelfViewHeight self.view.bounds.size.height #define RectX(f) f.origin.x #define RectY(f) f.origin.y #define RectWidth(f) f.size.width #define RectHeight(f) f.size.height #define RectSetWidth(f, w) CGRectMake(RectX(f), RectY(f), w, RectHeight(f)) #define RectSetHeight(f, h) CGRectMake(RectX(f), RectY(f), RectWidth(f), h) #define RectSetX(f, x) CGRectMake(x, RectY(f), RectWidth(f), RectHeight(f)) #define RectSetY(f, y) CGRectMake(RectX(f), y, RectWidth(f), RectHeight(f)) #define RectSetSize(f, w, h) CGRectMake(RectX(f), RectY(f), w, h) #define RectSetOrigin(f, x, y) CGRectMake(x, y, RectWidth(f), RectHeight(f)) #define DATE_COMPONENTS NSYearCalendarUnit|NSMonthCalendarUnit|NSDayCalendarUnit #define TIME_COMPONENTS NSHourCalendarUnit|NSMinuteCalendarUnit|NSSecondCalendarUnit #define FlushPool(p) [p drain]; p = [[NSAutoreleasePool alloc] init] #define RGB(r, g, b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0] #define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
[출처] https://gist.github.com/mwaterfall/953656
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
573 | Develop | [c] 서비스 거부 공격(DoS;Denial of Service) 간단 소스.. ㅋㅋ | hooni | 2013.04.23 | 6740 |
572 | Develop | [c++] 자료구조(링크리스트,스택,큐)와 후위 표기 계산기 샘플 ㅋㅋ 4 | hooni | 2013.04.23 | 12356 |
571 | Develop | [js] 큐 형식으로 배열사용.. ㅋㅋ | hooni | 2013.04.23 | 7052 |
570 | Develop | [js] 자바스크립트와 정규표현식 메뉴얼 (chm 형식) | hooni | 2013.04.23 | 7644 |
569 | Develop | [c++] mfc로 만든 사용자 계정 리스트 출력(EnumUser) 프로그램 예제 | hooni | 2013.04.23 | 7320 |
568 | System/OS | [linux] SSH에 대한 기본 설명과 설치/설정 | hooni | 2013.04.23 | 10665 |
567 | Develop | [js] 자바스크립트 메뉴얼 사이트.. ㅋㅋ | hooni | 2013.04.23 | 7434 |
566 | Develop | [js] ajax를 이용해 외부문서 불러오기.. | hooni | 2013.04.23 | 6812 |
565 | Develop | [c] 문자열 뒤집기 초간단 샘플 코드 ㅎㅎ | hooni | 2013.04.23 | 7136 |
564 | Develop | [c++] mfc로 만든 월플렉스 멀티 수납 시스템(2D기반 설계) | hooni | 2013.04.23 | 7427 |
563 | Develop | [c++] mfc로 만든 인테리어 수납 시스템(2D기반 설계) | hooni | 2013.04.23 | 7276 |
562 | Develop | [c++] mfc로 만든 부엌 수납 시스템(2D기반 설계) | hooni | 2013.04.23 | 7289 |