• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSFileWrapper with XML document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSFileWrapper with XML document


  • Subject: Re: NSFileWrapper with XML document
  • From: Michael Babin <email@hidden>
  • Date: Sun, 28 Oct 2007 07:17:08 -0500


On Oct 27, 2007, at 9:49 PM, Rick Langschultz wrote:

Hello everyone,

I can't figure out why this is throwing an error:

- (NSFileWrapper *)fileWrapperRepresentationOfType:(NSString *)aType {
NSMutableDictionary *contents = [NSMutableDictionary dictionary];

NSXMLElement *rootElement = (NSXMLElement *)[NSXMLNode elementWithName:@"document"];
NSXMLDocument *xmlDocument = [[NSXMLDocument alloc] initWithRootElement:rootElement];


[contents setObject:xmlDocument forKey:[[NSString alloc] initWithString:@"properties.xml"]];
NSFileWrapper *documentBundle = [[NSFileWrapper alloc] initDirectoryWithFileWrappers:contents];

return [documentBundle autorelease];
}


The Error:

[Session started at 2007-10-27 21:47:30 -0500.]
2007-10-27 21:47:42.606 ApplicationName[2087] *** -[NSXMLDocument preferredFilename]: selector not recognized [self = 0x3c9130]
2007-10-27 21:47:42.612 ApplicationName[2087] *** -[NSXMLDocument preferredFilename]: selector not recognized [self = 0x3c9130]


besides releasing the rootElement and xmlDocument am I doing anything wrong?

Yes. -[NSFileWrapper initDirectoryWithFileWrappers:] expects a dictionary that contains NSFileWrapper's, not NSXMLDocument's.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSFileWrapper with XML document (From: Rick Langschultz <email@hidden>)

  • Prev by Date: AuthSample
  • Next by Date: Re: NSManagedObjectContext - Key Value compliant
  • Previous by thread: NSFileWrapper with XML document
  • Next by thread: mouseUp: in TableView on Leopard
  • Index(es):
    • Date
    • Thread