2012-10-02 34 views
0

我想在完成它們之後刪除我的兩個plist。我想這一點使用這一行:因爲我沒有使用NSObject的「NSFileManager沒有可見接口」,iOS

No visible @interface for 'NSFileManager' declares the selector 'removeFileAtPath:error'

是這樣的:

[[NSFileManager defaultManager] removeFileAtPath:path error:NULL]; 

這給我的錯誤?

在.H

:UITableViewController<UIApplicationDelegate,UIAlertViewDelegate> 

我怎樣才能解決這個錯誤或刪除的plist文件?

+0

你從哪裏找到'removeFileAtPath'?沒有這樣的方法。不在iOS上,不在Mac上。 – calimarkus

回答

7

NSFileManager docs沒有列出removeFileAtPath:error:方法,這就是爲什麼你會得到該錯誤。你需要的是removeItemAtPath:error:方法(項目,而不是文件)。

要回答你的問題有關NSObject的,如果你的頭向UITableViewController docs,你可以看到類的繼承樹:

Inherits from UIViewController : UIResponder : NSObject

這表明的UITableViewController從UIViewController中,從UIResponder繼承,從NSObject的繼承繼承。所以你實際上使用NSObject,儘管分爲三代。請注意,這與NSFileManager錯誤無關。

相關問題