看到別人使用簡書都有代碼塊,自己在網(wǎng)上查了一下色迂,確實有解決辦法,但是感覺描述的不是很清楚假消,自己再記錄一下掏导。
生成代碼塊如下
+(NSInteger)getLocalCasesCountByTable{
if ([[LPDataBase sharedDatabase].database open]) {
LPUser * user =[KBCoordinatingContext sharedInstance].userInfo;
NSString *selectSQL = [NSString stringWithFormat:@"SELECT Count(*) FROM %@ where UserID = '%@' and Draft = '1'",KTopicList,user.UserID];
return [[LPDataBase sharedDatabase].database intForQuery:selectSQL];
}
return 0;
}
方法
上下用這個做標簽 “```” 中間是你的代碼
上面的這段文字就會生成代碼塊
需要注意的是“```” 這個符號是鍵盤左上角挨著數(shù)字1 的那個鍵(ps 原諒作者孤陋寡聞童芹,不知道它叫什么??)