• 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
NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSArrayController


  • Subject: NSArrayController
  • From: Johan Kool <email@hidden>
  • Date: Sun, 4 Jul 2004 23:57:46 +0200

Hi Matt,

Here is some sample code:

- (BOOL)writeToFile:(NSString *)path ofType:(NSString *)docType
{
return [[mainArrayController content] writeToFile:path atomically:YES];
}

- (BOOL)readFromFile:(NSString *)path ofType:(NSString *)docType
{
[mainArrayController setContent:[NSArray arrayWithContentsOfFile:path]];
return YES;
}

This of course only works with your own XML files. If you want to parse other XML files, take a look at the documentation for NSXMLParser.

Hope that helps! Cheers,

Johan

Op 4 jul 2004 om 23:43 heeft email@hidden het volgende geschreven:

Van: Matt Jarjoura <email@hidden>
Datum: 4 juli 2004 23:42:04 GMT+02:00
Aan: Cocoa Dev <email@hidden>
Onderwerp: NSArrayController


Is there an easy way to use NSDocument to parse a file into an
NSArrayController? Do I need to subclass NSArrayController?

-Matt
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: NSArrayController
      • From: Mike Ferris <email@hidden>
  • Prev by Date: Change value of NSNumber?
  • Next by Date: Deleting duplicates in NSMutableArray
  • Previous by thread: NSArrayController
  • Next by thread: Re: NSArrayController
  • Index(es):
    • Date
    • Thread