小記

1、真機(jī)調(diào)試?errors but did not return a nonzero exit code to indicate failure?

找到指定的圖片,回爐重造(用photoshop)重新保存一遍。圖片保存為NOT INTERLACED(不交錯(cuò))。(參考:http://blog.csdn.net/kylinbl/article/details/8990832)


2、Mac 設(shè)置安全與隱私 ?允許任何來源

在終端中輸入: sudo spctl --master-disable

3、重寫UIPageControl,用來修改 圓點(diǎn)大小 ?(參考:http://blog.csdn.net/txz_gray/article/details/53218297 ? ??http://www.itdecent.cn/p/59600c18bc11)

4、UISlider?

在使用過程中,其value屬性(起始位置),要放到control 里面去設(shè)置,不能放到view中設(shè)置。(原因:待補(bǔ)充~)

5、創(chuàng)建一個(gè) “00:00” 樣式的字符串 ? count 為int 類型

?[NSString stringWithFormat:@"%02d:%02d",count/60,count%60];

6、讀取本地plist內(nèi)容時(shí)為空(路徑、文件名稱都正確)

原因可能是在讀取 plist文件是 沒有注意 Root,array 、dictionary 要區(qū)分讀取的

(1) 、dictionary

NSDictionary *dataDict = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"yourplistName" ofType:@"plist"]];

(2)、array?

NSString * path =[[NSBundle mainBundle] pathForResource:@"yourplist" ofType:@"plist"];

yourMutableArr = [[NSMutableArray alloc] initWithContentsOfFile:path];


7、NSMutableArray 切換順序

dataArrs = (NSMutableArray *)[[dataArrs reverseObjectEnumerator] allObjects];

8、for循環(huán)添加button, 在外部控制 for循環(huán)里button 的初始化狀態(tài)

1)初始化button


2)在外面控制button 是否被選中


9、刪除 Xcode中的 “Provisioning Profile證書”

在“訪達(dá)”中 “command + G” ?輸入 “~/Library/MobileDevice/Provisioning Profiles?” 進(jìn)入指定文件夾 即可刪除不需要的

10、讀取 info.plist 文件

NSDictionary *plistDict = [NSBundle mainBundle].infoDictionary;

11、p12文件 轉(zhuǎn) pem文件?

1)打開終端,去到文件所在位置

2)執(zhí)行下面的命令行

openssl pkcs12?-in yourfile.p12 ?pemFileName.pem?-nodes

12、$(SRCROOT) ?的使用

1、找到所在位置

1、找到Prefix Header

2、選擇并添加

2、添加$(SRCROOT) /yourAppName/xxxx.pch?

12、將一個(gè)UIView添加到當(dāng)前視圖控制器最上層

?UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];

?UIView *view = ....

?[keyWindow addSubview:view];


13、判斷是否是第一次使用APP

? ? ? ? NSString *isBackMusicFirst =@"isBackMusicFirst";

? ? ? ? BOOLisHomeFirst = [Default boolForKey:isBackMusicFirst];

? ? ? ? if(!isHomeFirst) {

? ? ? ? ? ? [Default setBool:[NSNumber numberWithInt:1] forKey:isBackMusicFirst];

? ? ? ? ? ? [[NSUserDefaults standardUserDefaults] synchronize];

? ? ? ? ? ? NSLog(@"第一次登陸");

? ? ? ? }else{

? ? ? ? ? ? NSLog(@"非第一次登陸");

? ? ? ? }


14、主線程刷新UI的寫法

[[NSOperationQueue mainQueue] addOperationWithBlock:^{

? ? ? alertLabel.text =@"";

?}];


15、Error Domain=NSURLErrorDomain Code=-1022;使用AFNetWorking連接報(bào)錯(cuò)

在plist文件中操作

添加App Transport Security Settings, 展開后輸入Allow Arbitrary Loads,值改成YES


16、Masonry 約束,在self.contentView 上面添加元素,在自定義cell中添加約束,如下:

make.bottom.equalTo(self.contentView.

需要添加contentView。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容