Values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' insteadapp
解決辦法:spa
一、系統推薦方法 [NSString stringWithFormat:@「%ld", (long)integerNum];orm
二、強制轉換int [NSString stringWithFormat:@"%d", (int)integerNum];對象
三、轉爲數字對象 [NSString stringWithFormat:@「%@", @(integerNum)];ci
四、使用%zd佔位符 [NSString stringWithFormat:@「%zd", integerNum]; (最簡單的方法)編譯器
補充:string
關於%zd格式化字符,只能運行在支持C99標準的編譯器中,表示對應的數字是一個size_t類型,size_t是unsigned int 的加強版,表示與機器類型相關的unsigned類型,即:size-t在32位系統下是unsigned int(4個字節),在64位系統中爲long unsigned int(8個字節)。it
\\ 反斜槓編譯
\a 警告ast
\b 退格
\f 換頁
\n 換行
\r 回車
\t 跳格Tab
\v 垂直跳格
空格在輸入時不須要轉義,直接敲空格