在開發應用程式中,不可避免的會使用到檔案讀寫操作,如何才能高效省力的來處理這些操作呢!那就是把一些常用的檔案操作流程寫進乙個工具類中,每次要用的時候
就直接匯入檔案,介面呼叫就可以啦!下面是我寫的乙個檔案操作類。
#import "fileutil.h"
@implementation fileutil
/*檔案是否存在*/
+ (bool)isfileexisted:(nsstring *)filename
return yes;
}/*建立指定名字的檔案*/
+ (bool)createfileatpath:(nsstring *)filename
return no;
}/*建立指定名字的資料夾*/
+ (bool)createdirectoryatpath:(nsstring *)filename
return no;
}/*得到檔案路徑*/
+ (nsstring *)getfilepath:(nsstring *)filename
/*刪除檔案*/
+ (bool)deletefileatpath:(nsstring *)filename
[filemanager removeitematpath:path error:nil];
return yes;
}/*得到plist檔案*/
+ (nsmutabledictionary *)getplistfile:(nsstring *)filename
/*獲取plist檔案目錄*/
+ (nsstring *)getplistfilepath:(nsstring *)filename
@end
是不是很簡單粗暴啊!:)
iOS開發 建立乙個簡單的TableView
1,建立工程 在workspace中新增乙個工程 table 建立完成後,設定此專案為當前除錯 執行工程 product scheme 2,在viewcontroller中新增tableview 開啟main.storyboard,在右下角的控制項視窗中拖動table view到viewcontro...
iOS開發之自己封裝乙個progressHUD控制項
看了幾個輕量級的progress view 我覺得kvnprogress做的最漂亮吧 突然我想為什麼我自己不封裝乙個控制項 然後我研究了一下kvnprogress kvn簡單的介面是由storyboard搭建的 呼叫了最簡單的showwithstatus,然後用reveal檢視了一下 然後看了xco...
開發乙個簡單的WebExtension
首先需要準備乙個45版本以上的火狐瀏覽器用於開發擴充套件。1.需要編寫的第乙個檔案是我們的manifest.json。這個檔案是整個擴充套件的核心,是乙個按照json格式寫成的檔案。既然是json格式就要有相應的key和value,這裡列出擴充套件中常用的幾個key。manifest version...