Re: Saving an alias(AliasHandle/AliasRecord) with NSUserDefaults.
Re: Saving an alias(AliasHandle/AliasRecord) with NSUserDefaults.
- Subject: Re: Saving an alias(AliasHandle/AliasRecord) with NSUserDefaults.
- From: Ron Davis <email@hidden>
- Date: Mon, 21 Apr 2003 11:47:59 -0500
on 4/21/03 10:10 AM, Peter Fischer at email@hidden wrote:
>
I'm having a hell of a time with this one, and was hoping someone
>
could help me out. I am attempting to save an AliasHandle off the the
>
NSUserDefaults, in hopes that it can be retrieved when the program is
>
executed at a later time.
We use this line to encode an alias as a NSData
[NSData dataWithBytes:*aliasHandle
length:GetHandleSize((Handle)aliasHandle)]
When decoding we do this:
aliasHandle = (AliasHandle)NewHandle([data length]);
[data getBytes:*aliasHandle];
So maybe you need to allocate the handle in your decode. We wrote an Alias
wrapper class, so I'm pulling this code out of a couple of places. Hopefully
it will help.
--
Ron Davis
"Always bear in mind that your own resolution to succeed is more important
than any other thing." --Abraham Lincoln
_______________________________________________
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.