2011-08-18 67 views

回答

6

我之前在使用錯誤定義的URL時看到過這個。例如:

NSString *f = [NSTemporaryDirectory() stringByAppendingPathComponent:@"tmp.txt"]; 

// This is an invalid file url and will fail when you try to save to it. 
NSURL *invalidFileURL = [NSURL URLWithString:f]; 

// This URL is acceptable. 
NSURL *validFileURL = [NSURL fileURLWithPath:f isDirectory:NO];