0
有人可以解釋我爲什麼我的代碼不起作用嗎?問題在我的設備中寫入NSData
//get the documents directory:
NSArray *paths = NSSearchPathForDirectoriesInDomains
(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
//make a file name to write the data to using the
//documents directory:
NSString *fullFileName = [NSString stringWithFormat:@"%@/subscriptions", documentsDirectory];
[dataReply writeToFile:fullFileName atomically:NO];
NSData *getData=[[NSData alloc]initWithContentsOfFile:fullFileName];
INFACT如果我嘗試
NSString *string = [[NSString alloc] initWithData:getData encoding:NSASCIIStringEncoding];
而如果我加載的myData沒有將它保存到我的設備它的工作原理! (所以我敢肯定,我的數據是不爲空)
什麼是不工作? – dasdom
定義「作品」。定義「不起作用」。 –