新建一個包含Main.storyboard的專案,在AppDelegate類中,讀取檔案路徑為nil,data的回傳值為nil,用其它專案在這個類中就可以讀取到,這是需要設定什么嗎?
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
NSData *data = [NSData dataWithContentsOfFile:@"/Users/wuli.li/Desktop/123.txt"];
NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
}
uj5u.com熱心網友回復:
問題已經得到解決:因為我們在建新專案的時候,Code Signing Entitlements存在默認值,只需要把這一項選擇other后,將other的值設為空就好。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/129129.html
標籤:iOS
