[ 자기개발 ]/개발에 필요한 정보 정리
[Obj-c] xCode 프로젝트 생성시 필수 셋팅
스밤바
2020. 4. 10. 16:35
1. 13.0 이하 버전을 개발 시 필수사항
- AppDelegate.h 에 @property (nonatomic, strong) UIWindows *window; 추가
2. prefix.pch 추가
(1). prefix.pch 파일 생성
xCode - File - New - File - PCH
ProjectName : 프로젝트명-PrefixHeader.pch
* 파일을 추가할때는 프로젝트 폴더를 선택해서 추가
(2). build settings 설정
Precompile Prefix Header : YES
Prefix Header : 경로 ( sample_github/sample_github-PrefixHeader.pch )
* 경로를 추가해야 하기 때문에 (1)에서 프로젝트 폴더 아래 생성을 하는거다.)
3. NSLog 디버그시에만 표출하고 (경로, 함수명, 라인) 표출 설정
#ifdef DEBUG #define NSLog( s, ... ) NSLog( @"[%@ %s(%d)] %@", [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __PRETTY_FUNCTION__, __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] ) #else #define NSLog( s, ... ) #endif |