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

NSArchiver


  • Subject: NSArchiver
  • From: stuartbryson <email@hidden>
  • Date: Sun, 12 Aug 2001 12:28:34 +1000

Hi all,

In my program I create various 3D objects within a Build function. I want to however save these 3D objects to file so I can just import them when I run. I thought NSArchiver would do the trick. I started with the code below:

Object3D *tempObj;
NSArchiver *tempArchive;

tempObj = [[[Sphere alloc] init] autorelease];
[tempObj setRadius:85.0];
[tempObj setColour:[[[RGBVector alloc] initWithValuesRed:1.0 green:0.0 blue:0.0]autorelease]];
[self addThreeDObject:tempObj];

if (![tempArchive archiveRootObject:tempObj toFile:@"/MyPath/3dObject"]);
NSLog(@"File was not archived");

This does not work however... I am not sure why but the compiler says that NSArchiver does not respond to archiveRootObject... I checked the doco and perhaps I do not understand how to use the + methods in each class. I understand that + methods are class methods and not instance methods?

Any help on this would be appreciated. Perhaps NSArchiver isn't even the way to go?

Thanks

Stuart


  • Follow-Ups:
    • Re: NSArchiver
      • From: Fritz Anderson <email@hidden>
    • Re: NSArchiver
      • From: tyler <email@hidden>
  • Prev by Date: Portable Network Graphics format
  • Next by Date: Re: WriteToFile:atomically: question
  • Previous by thread: Re: Portable Network Graphics format
  • Next by thread: Re: NSArchiver
  • Index(es):
    • Date
    • Thread