Tagged Questions
0
votes
1answer
23 views
What is the hexadecimal part in the Documents folder's path?
I have a file located in my app's Documents folder. When the app is terminated I save the file's URL in the AppDelegate's applicationWillTerminate method:
// archiver init code
[archiver ...
-1
votes
0answers
34 views
Get the Size of a File [duplicate]
hHello this is my function bellow .. the code looks somehow correct. I want check the fileSize into myDocs folder .. the file returns that exists but does not print his size.
-(BOOL) checkFile: ( ...
0
votes
2answers
561 views
NSFileManager moveItemAtPath:toPath:error: changes filename
I have a importFile stored at NSString* importFile (printed with NSLog %@):
...
1
vote
1answer
119 views
NSFileManager -createFileAtPath fails with NSInvalidArgumentException
Maybe I've just missed something in the documentation, but I can't find anything that says this behavior should have changed in iOS 8.
My app sets the current working directory to the Documents ...
0
votes
1answer
30 views
Manual VS Automatic Array Clarification
In my app, I'm going from creating an array of objects manually to creating an equal array where the objects are stored in a reference folder. I create the automatic array with ...
57
votes
9answers
27k views
How to detect total available/free disk space on the iPhone/iPad device?
I'm looking for a better way to detect available/free disk space on the iPhone/iPad device programmatically.
Currently I'm using the NSFileManager to detect the disk space. Following is the snippet ...
1
vote
1answer
104 views
Load file in Today extension when device is locked
In my today extension with my device unlocked, this line of code works as expected, returning the data from the image path:
let imageData = NSData(contentsOfFile: path)
However when my device is ...
1
vote
3answers
330 views
iOS code: Fails on other machines, but not mine with [NSFileManager copyItemAtPath:toPath:error:]: source path is nil'
I'm developing with a team, using macs that were all imaged exactly the same. Using the machine on which I wrote the code, I can programmatically create and then write to a pList file. But when I use ...
14
votes
2answers
7k views
Storing images locally on an iOS device
Some iOS photo-related apps store images created with the app somewhere other than the photo library. For example Fat Booth shows a scrolling list of photos created with the app at app start-up. Note ...
2
votes
0answers
41 views
UIDocument “Save As” Functionality
I have a UIDocument named "Old". I've made some changes to it and would like to re-save it under the name "New". The contents of "Old" should not change. Here is my failed attempt:
First, copy the ...
2
votes
2answers
311 views
Merge folders with NSFileManager, overwrite only existing files
Basically I am looking for a way to merge two folder in the filesystem with the cocoa API:
I have a folder containing files and sub-folders, which I want to copy to a different location in the ...
2
votes
1answer
28 views
NSCocoaErrorDomain 513 on iOS8 devices
I am trying to create a folder using
BOOL status =[fileManager createDirectoryAtPath:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:pathComponent] ...
1
vote
1answer
47 views
Get list of files at path swift [duplicate]
Just trying to make a for..in loop for files in the local app folder
let filemanager:NSFileManager = NSFileManager()
let files = filemanager.enumeratorAtPath(NSHomeDirectory())
for filename in files!
...
0
votes
2answers
29 views
Create Array of Strings from Group Contents
I have 3 xml files in a group folder within my project's supporting files. I'm trying to create an array that contains the filenames, as strings, for each file in the group's folder.
Example...Group ...
0
votes
2answers
22 views
Can't save and load plist file
When i tried to create plist file('Checklist.plist') using following methods i can't see the file in the directory.
- (NSString *)documentsDirectory {
NSArray *paths = ...
-1
votes
0answers
39 views
Does NSFileManager createFileAtPath: overwrite existing files in the iOS SDK?
I have the following code. Will it overwrite existing files? If not, what code should I use to overwrite?
NSFileManager *fileManager = [[NSFileManager alloc] init];
NSArray *paths = ...
0
votes
1answer
20 views
How to compress a UIImage in order to send it to a server faster
I need to send an image to a server in chunks of 512 bytes.
I am getting the image with:
- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary ...
3
votes
2answers
594 views
.DS_Store file skipping
In my application I Use NSFileManager to get the number of files in a folder using following code
NSFileManager *manager=[NSFileManager defaultManager];
NSString *path;
int numberofFiles=[[manager ...
0
votes
1answer
49 views
Today Extension (App Groups)
I have been browsing the Apple Documentation for hours now and there is so little on the Today Extension, so I just can't get to the bottom of this problem...
I am trying to access a plist file ...
0
votes
1answer
158 views
Shared the file within two target using GROUP APP
- (void) readTheFile{
NSError *error;
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *path = [self getTheFilePath];
if (![fileManager fileExistsAtPath: path])
...
0
votes
0answers
24 views
NSFileManager removeItemAtPath does not remove file
So, I searched the net and stackoverflow, checked the threads mentioned above this text box as possible already asked questions but the answers or tips couldn't help me because the code at first was ...
0
votes
1answer
22 views
iOS Extension and accessing files in Resource
Suppose I have a file data.txt in the Resource bundle of an extension (not the Resource bundle of the application). How do I access it? I have tried:
NSString *filePath = [[NSBundle mainBundle] ...
0
votes
0answers
86 views
Swift iCloud in iOS7
I use this line of code in my app to check, whether the user has enabled iCloud documents or not:
let ubiquitousURL = NSFileManager.defaultManager().URLForUbiquityContainerIdentifier(nil)
In iOS 8 ...
5
votes
2answers
5k views
NSFileManager not deleting a file that exists
I am having some problem with using the NSFileManager functionalities.
This happens both on the Simulator and an iPhone device (iOS 5.1).
Basically, I have a bunch of files that are stored in a ...
49
votes
4answers
19k views
Is there any way to see the file system on the iOS simulator?
Is there any way to browse the file system of a currently running or just killed iOS simulator? I'd settle for being able to see a specific app's files if there's a way to do that.
Note that I don't ...
4
votes
3answers
886 views
containerURLForSecurityApplicationGroupIdentifier gettting nil value
Hi i am making two iPad app that communicate with one file and fetches all the data from one file. I search and find this "containerURLForSecurityApplicationGroupIdentifier" we can create group and ...
0
votes
1answer
43 views
Error copying file from app bundle
I used the FireFox add-on SQLite Manager, created a database, which saved to my desktop as "DB.sqlite". I copied the file into my supporting files for the project. But when I run the app, immediately ...
0
votes
1answer
29 views
objective-c how to batch multiple read operations
I am performing multiple read operations on the same resource stored on disk.
Sometimes the read operation itself takes longer than the time between requests for that same resource. In those cases ...
1
vote
0answers
89 views
CFString allocations issue using ARC
In my application I am dealing with uploading of images. My images are in documents directory.
I am using NSFileManager to get the data from it and converting to base 64 encoding.
Everything goes ...
0
votes
0answers
19 views
UIManagedDocument won't create nor save
I am very new to objective-c and have been following the cs193 stanford class to self teach how to program for iOS. currently I am trying to create a UIManagedDocument so i can store my core data in ...
13
votes
5answers
14k views
How to overwrite a file with NSFileManager when copying?
I'm using this method to copy a file:
[fileManager copyItemAtPath:sourcePath toPath:targetPath error:&error];
I want to overwrite a file when it exists already. The default behavior of this ...
0
votes
0answers
31 views
iOS constantly creates free space when downloading user content
I have an app which has 16 downloadable units, each is around 60-100MB in size.
I checked in settings (settings => general = > usage), there are 0 bytes available.
But when I start downloading a ...
0
votes
1answer
66 views
How to create a folder in iOS application Home Page
Is there is any tutorial to explain folder creation in iOS app?
In My application there is a home page contain different type of document. I want to arrange documents in folder with respect to the ...
10
votes
3answers
10k views
Getting bundle file references / paths at app launch
Suppose I have an arbitrary set of files included in the Main App Bundle. I would like to fetch the file URLs for those at launch and store them somewhere. Is this possible using NSFileManager? The ...
1
vote
1answer
53 views
NSFileHandle reading corrupt data from Video file
I'm using NSFileHandle to get the data of a video as its being recorded.
It works fine notification-wise and I'm getting notified using NSFileHandleDataAvailableNotification. The problem is the ...
0
votes
0answers
24 views
remove inbox folder after open in files from other app to my app
I have used this code for open other files imported from other app via openin menu
but the problem is that when i try to delete in box folder after importing document it gives me permission error
...
0
votes
2answers
299 views
NSFileManager ubiquityIdentityToken returns nil unexpectedly?
I am using this iCloud library within my application: https://github.com/iRareMedia/iCloudDocumentSync
On my iPhone running iOS 8, I run the app and ubiquityIdentityToken returns a value and ...
1
vote
2answers
87 views
save image to subfolder of /library/Application Support/bundleID_name/… iOS
The following code works without error or exception - but still, it does not do what it should ! I wanted to save an image into the iOS library/Application Support folder. More precisely, the image ...
0
votes
0answers
40 views
Is it necessary to set Data Protection attributes to a file when using Capabilities?
I protect the files I save in my app by setting the Data Protection attributes each time I save a file (see code below).
NSDictionary *attributes = [NSDictionary dictionaryWithObject:protectionKey ...
1
vote
1answer
20 views
Create file with specific permisions in iOS
In my project i'm creating a file using the function:
- (BOOL)createFileAtPath:(NSString *)path contents:(NSData *)data attributes:(NSDictionary *)attr;
I want to grant this file permissions so ...
0
votes
1answer
29 views
How to save html files in Document Directory iOS?
I have lots of html files and i want to save that html files into an Temporary Directory or an Documents Directory which one is suitable.
I want to save all the html files in the directory Please tell ...
1
vote
1answer
46 views
Why a Database hasn't created?
I've tried to create a Database using sqlite3.0 in my app, but the database hasn't created. Here is my code:
// Getting the documents directory
dirPaths = ...
0
votes
0answers
40 views
How to Implement Search Functionality from HTML files in iOS?
I have Bunch of HTML files which i have Saved in the Documents Directory and i can also read that html files content. but i don know how to can implement search from that.
When the User type 'A' the ...
0
votes
1answer
49 views
NSFileManager, how to determine if a file or directory can be removed?
Is there a way to tell, if calling
[[NSFileManager defaultManager] removeItemAtPath:filePath error:NULL];
will fail?
0
votes
1answer
36 views
Put files in bundle into specific folder locations on iOS app
The files inside of my app bundle are arranged into folders, but when I check the file layout of the bundle, it seems these files are all added to the same directory, and not sorted by folder as I ...
0
votes
0answers
22 views
File metadata iOs for file in app documents directory
I want to check the metadata (NSFileModifiedDate) of a file I created in my apps document's directory.
NSURL *fileURL = [self getFullFileURLFromFileId:file];
NSFileManager *fm = [NSFileManager ...
0
votes
2answers
2k views
I'm trying to find a file size. But my length is equl to zero
I'm trying to find a file size.
NSFileHandle *output = [NSFileHandle fileHandleForWritingAtPath:self.finalPath];
//seek to begin of the file
[output seekToFileOffset:0];
NSData *mydata = [output ...
0
votes
1answer
341 views
NSFileManager leads to SourceKit Service Terminated
It's totally confusing on using this line
var docContents : NSArray! = NSFileManager.defaultManager().contentsOfDirectoryAtPath(archieveDirectoryPath,error:
&err)
I get the alert like ...
0
votes
2answers
42 views
Get NSData from a file
I am trying get NSData of an own file.
My code is as follow, but NSData returned is always nil… (As you can see, I check if the file exists previously)
if ([[NSFileManager defaultManager] ...
0
votes
3answers
79 views
How to save PDF file in iPhone device through application
Currently, I am working on create PDF file, saving it and retrieving file in UIWebview to display through iPhone application.But,Now I want to save PDF file in iPhone device like in NewsStand or ...