Tagged Questions
0
votes
1answer
22 views
iOS - iPhone application documents “No such directory”?
I'm trying to use the method seen in the solution here to delete all the files in the iPhone documents directory for the application I'm writing. I've made some minor changes to the code in the ...
1
vote
1answer
208 views
NSURL isFileURL always returns NO
Can someone explain to me why the following code:
NSString* filePathString = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
NSLog(@"%i", [[NSURL ...
0
votes
1answer
123 views
NSURL bookmark lookup failing
I'm trying to store bookmark references to a collection of NSURLs, but bookmarkDataWithContentsOfURL seems to be failing every time, even for files that I have permission to access. My app is not ...
0
votes
1answer
163 views
Saving images to a directory
Hi I want to save an image to a directory, I pass the NSData and do what I think will save the file in a directory I create but the problem is that it doesnt save. This is what I have so far. Why ...
0
votes
2answers
157 views
initWithContentsOfURL what is the encoding?
Hi I saved a URL that has a path to a directory where I will be storing information, Now I want to retrieve the information but I don't know how to receive the items, I am trying to use ...
0
votes
2answers
168 views
How to write items to a directory and call them, Objective c
Hi I have a bunch of photos that I download from the web and I want to store them in a directory so I dont have to reload photos already downloaded, I am having trouble understanding how exactly to do ...
0
votes
1answer
124 views
copyItemAtPath:toPath:error: is returning NO
The chapter I'm reading is talking about NSFileManager, and the author said to create an empty file called testFile. The testFile is under the same folder as main.m. I didn't create newfile. I'm not ...
2
votes
3answers
415 views
Check if directory is empty or remove only if empty in Objective-C
NSFileManager removeItemAtURL performs only recursive deletion. There is no special treatment for non-empty directories.
How can I remove only empty directories by testing the condition beforehand? ...
1
vote
2answers
853 views
How to compare a URL of “file://localhost/var/mobile/…” with “file:///var/mobile/…”
I'm opening a local file using UIWebView:loadRequest with an NSURLRequest which is in turn set from a URL.
The base location for url is obtained using:
baseDirectory = [[NSFileManager ...
0
votes
1answer
1k views
NSTemporaryDirectory subdirectories
I can't store any file in NSTemporaryDirectory subfolders
rootDirectoryName is GUID
subDirectoryName is also a GUID
self.rootFolderPath=[NSTemporaryDirectory() ...
1
vote
2answers
131 views
What is the reason for NSFileManager's inconsistent use of NSURL?
I read somewhere that Apple encourages the use of NSURL over NSString in terms of paths and file locations, and this is becoming more obvious in new(er) API's - correct me if I am wrong. This Stack ...
0
votes
1answer
710 views
copyItemAtPath, moveItemAtPath, and createFileAtPath all seem to create a file that's unreadable
So I'm trying to figure out why I can't make a copy of my file that's readable. I've tried moveItemAtPath, copyItemAtPath, and createFileAtPath. Each time, reading the data from the original path ...
0
votes
1answer
589 views
Problem getting files from folder, error recognizing folder. (Objective c)
I have the user select a folder from an NSOpenPanel. This returns a filepath like: file://localhost/Folder. Here is my code where it all goes wrong:
NSURL *filePath = [openDlg URL]; //OpenDlg is my ...
0
votes
3answers
351 views
Odd behavior from Dictionary to URL writing/reading
I've been looking all over the site for a similar issue, but none of the fixes for any of the other questions I've found have helped, so maybe I'm looking at it wrong or something. Anyways here is my ...
2
votes
1answer
1k views
How to get Remote File Last-Modification Date
I need to get the file modification date of a remote file.
Obviously, attributes in this example returns NULL:
- (BOOL) fileHasBeenModifiedSinceLastLaunch
{
NSError * err = nil;
NSDictionary ...