• 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
How do I make NSData from cabron-Handle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I make NSData from cabron-Handle


  • Subject: How do I make NSData from cabron-Handle
  • From: Gore <email@hidden>
  • Date: Sat, 26 Jan 2002 16:27:46 +0200

I would like to encode my Handle variable so that I can save me SndBank on the HD...

my code looks like this (SndBank is the class this code is in...):

///////////////////////////////// interface

@interface SndBank : NSObject
{
Handle sndHandle;
}

//////////////////////////////// implementation

- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeValueOfObjCType: @encode(Handle) at: &sndHandle];
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
[aDecoder decodeValueOfObjCType: @encode(Handle) at: &sndHandle];

return self;
}

+ (SndBank *)sndWithData:(NSData *)data
{
return [[NSUnarchiver unarchiveObjectWithData: data] autorelease];
}

- (NSData *)sndData
{
return [NSArchiver archivedDataWithRootObject: self];
}

/////////////////////////////////////////////////////////////

the sndHandle is the handle returned from my sound recording methood...
if there is a way to record sound using apples cocoa frameworks, then please tell me!


  • Follow-Ups:
    • Re: How do I make NSData from cabron-Handle
      • From: Finlay Dobbie <email@hidden>
    • Re: How do I make NSData from cabron-Handle
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: How viable is Cocoa development?
  • Next by Date: Re: How viable is Cocoa development?
  • Previous by thread: Drawing 2D / NSQuickDrawView
  • Next by thread: Re: How do I make NSData from cabron-Handle
  • Index(es):
    • Date
    • Thread