私は4つのタブを持つアプリを書いています。2番目のタブでは、データをplistに保存し、次のコードを使用してパスを設定しています。
//get the path to the documents directory (where we will store our plist)
NSString* docDirectory = [self applicationDocumentsDirectory];
//append the path to the documents diretory with our plist name
NSString* destPath = [docDirectory stringByAppendingPathComponent:@"surveyResults.plist"];
それはそれ自身の方法にあります。正常に動作します。
4番目のタブに同じコードを配置しましたが、[selfapplicationDocumentsDirectory]でエラーが発生します。
No visible @interface for 'FourthViewController' declares the selector 'applicationDocumentsDirectory'
viewDidLoadメソッドにあります。
あるタブで機能し、別のタブでは機能しない理由はありますか?