1. 程式人生 > >新增pch 檔案和 header檔案

新增pch 檔案和 header檔案

一 、新增pch檔案

        1 ios->other->PCH file,建立一個pch檔案,新增需要引入的標頭檔案名

      2 把該檔案的路徑新增到 building setting ---> Apple LLVM 7.0 Language------->prefix Header選項中去


二 、新增header檔案

        1 新增header檔案

       2  在pch檔案中新增   #import <UIKit/UIKit.h> 

         再新增 #import “header.h”

三、在header檔案中建立key

// userDefauts  key
#define chatUserName                @"chatUserName"
//普通key
const static NSString * hh = @"jkk";