Questions tagged [nsfilewrapper]

On iOS and Mac OS X, the NSFileWrapper class provides access to the attributes and contents of file-system nodes. A file-system node is a file, directory, or symbolic link. Instances of this class are known as file wrappers.

On iOS and Mac OS X, the NSFileWrapper class provides access to the attributes and contents of file-system nodes. A file-system node is a file, directory, or symbolic link. Instances of this class are known as file wrappers.

File wrappers represent a file-system node as an object that can be displayed as an image (and possibly edited in place), saved to the file system, or transmitted to another application.

There are three types of file wrappers:

  • Regular-file file wrapper: Represents a regular file.
  • Directory file wrapper: Represents a directory.
  • Symbolic-link file wrapper: Represents a symbolic link.

A file wrapper has these attributes:

  • Filename. Name of the file-system node the file wrapper represents.
  • file-system attributes. See NSFileManager Class Reference for information on the contents of the attributes dictionary.
  • Regular-file contents. Applicable only to regular-file file wrappers.
  • File wrappers. Applicable only to directory file wrappers.
  • Destination node. Applicable only to symbolic-link file wrappers.
81 questions
1
vote
1 answer

Storing a BOOL in UIDocument using NSFileWrapper

This may be me being incredibly thick, but how do I store a BOOL in a UIDocument? I am currently using NSFileWrappers for storing a string and an image in the "contentsForType:error:" method, but seeing as there's no way to convert a bool into…
Carl Goldsmith
  • 750
  • 1
  • 5
  • 11
0
votes
1 answer

iCloud loses NSData

I'm creating an app with iCloud. But I have some problems. It creates directory on iCloud using NSFileWrapper, then it creates NSData (text) file in NSFileWrapper directory. I'm using this code to convert NSData to NSString: text=[NSString…
Riddick
  • 375
  • 4
  • 14
0
votes
1 answer

When using NSFileWrapper, is there a way to handle huge output files by writing multiple times with chunks of NSData objects?

I a macOS Cocoa application, I need to save a Bundle in my app proprietary format. For this reason, I decided to look at NSFileWrapper that appears to be the cleanest solution to deal with the problem. My code looks like this: NSFileWrapper…
Alfonso Tesauro
  • 1,730
  • 13
  • 21
0
votes
1 answer

(Why) Should I keep a pointer to the FileWrapper in the open document?

I have a working document based project with both iOS and macOS targets. The document is a bundle and I have each target able to open files from the other. I was looking at some online tutorials on UIDocument (and particularly this one from…
Jef
  • 4,728
  • 2
  • 25
  • 33
0
votes
0 answers

Getting a package contents as NSData

My app creates some back-up files as Packages (in fact as directories with an extension, and an Exported UTI that conforms to com.apple.package). I would like to be able to read them as NSData, that I can attach to an email in a…
Thomas Albert
  • 275
  • 1
  • 10
0
votes
2 answers

Recipe for making Cocoa NSDocument packages play well with svn?

I have a tool that writes package-style documents. It's implemented using NSDocument and overrides the following NSDocument methods: - (NSFileWrapper *)fileWrapperOfType:(NSString *)typeName error:(NSError…
Kaelin Colclasure
  • 3,925
  • 1
  • 26
  • 36
0
votes
1 answer

Saving document using NSFileWrapper

I'm developing an document-based application that allow users to insert images, movies to make compositions. When saving the document, I create a directoryFileWrapper in which I put the xml representation of my project, and one fileWrapper for each…
vtruant
  • 273
  • 1
  • 12
0
votes
1 answer

error when AppKit framework added in iphone application

i want to import in my iphone application, but i know this framework is not available in iphone sdk,but i need to use NSfileWrapper class in this framework, is this class also available in UIKit or others framework available in iphone sdk, thanks
issac
  • 1,501
  • 6
  • 22
  • 29
0
votes
2 answers

Writing NSMutableAttributedString to rtf file could not open?

My tried code is given below:- #define FontFamily(fname,fsize) [UIFont fontWithName:fname size:fsize] #define themeRed [UIColor colorWithRed:189.0f/255.0f green:0.0f/255.0f blue:12.0f/255.0f alpha:1] #define helveticaBold…
Prince Kumar Sharma
  • 12,591
  • 4
  • 59
  • 90
0
votes
0 answers

Error while subclassing NSFileWrapper in Swift

I have subclassed NSFileWrapper to specialise it for my own file wrapper while retaining the file handling functionality that NSFileWrapper offers. I have not overriden anything and not implemented any of the NSFileWrapper's initialisers in my…
Roshan
  • 1,937
  • 1
  • 13
  • 25
0
votes
1 answer

Saving a "project"-type document (containing sub-documents)

I'm trying to create a "project"-like document, in that it contains subdocuments in a specified directory. I'd like a brand new save of a document to set up that directory with appropriate subdirectories. I'd like a "Save As" to copy all those…
andyvn22
  • 14,696
  • 1
  • 52
  • 74
0
votes
1 answer

IPhone FIlewrappers and document packages?

Suppose I have an model object class Box. In my Box class I add images references (png), audio (mp3) etc... Rather than store them as NSData it seems better to reference the paths to the files...to save memory. I would like archive this Box class.…
sysco
  • 1
  • 1
0
votes
1 answer

Content of a file package won't refresh: why?

Does anyone know this issue? I am writing in a file package (with methods of NSDocument), via [(NSFileWrapper *)content writeToURL:myURL options:NSFileWrapperWritingAtomic | NSFileWrapperWritingWithNameUpdating …
Colas
  • 3,473
  • 4
  • 29
  • 68
0
votes
1 answer

NSDocument and NSFileWrapper: strategy to reduce memory footprint?

Based on the Apple Docs, the recommended practice for using file packages with NSDocument seems to be to keep a reference to the root NSFileWrapper in the custom NSDocument implementation. My question: doesn't this mean that I'll end up with twice…
Mark
  • 6,647
  • 1
  • 45
  • 88
0
votes
1 answer

NSDocument class file bundle not copy right

I created an NSDocument base app, which provides a custom file format, which is a bundle containing multiple resources... all works fine, i can save, load, show package contents etc... the problem is, when i want to sent it over internet, like with…
Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179