FROM : Roarke Lynch
DATE : Thu Dec 19 19:19:08 2002
On Thursday, December 19, 2002, at 03:32 AM, Cidric John wrote:
> Ok, this might be a bit basic for you seasoned veterans out there, but
> I do get trouble in archiving floats and integers. Basically, I don't
> know how to properly use the "- encodeValuesOfObjCTypes:" methods.
> I've tried to use some permutations of [coder
> encodeValuesOfObjCTypes:@encode(int) anInt]; but without success. I
> could not find a good documentation of the "@encode()" compiler
> directive. Alternatively, I've archived a NSNumber, but I was really
> disappointed because for some reasons it didn't record my float/int
> correctly. So if someone could provide two lines of code, one for
> coding and one for decoding an integer using
> "encodeValuesOfObjCTypes:", I would be really grateful!
I don't know if it was a typo or not, but you used anInt instead of
&anInt. i.e
wrong: [coder encodeValueOfObjCType:@encode(int) at:myInt]
right: [[coder encodeValueOfObjCType:@encode(int) at:&myInt]
unless of course that myInt is a pointer right?
Roarke Lynch
-------------------------------
<email_removed>
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Thu Dec 19 19:19:08 2002
On Thursday, December 19, 2002, at 03:32 AM, Cidric John wrote:
> Ok, this might be a bit basic for you seasoned veterans out there, but
> I do get trouble in archiving floats and integers. Basically, I don't
> know how to properly use the "- encodeValuesOfObjCTypes:" methods.
> I've tried to use some permutations of [coder
> encodeValuesOfObjCTypes:@encode(int) anInt]; but without success. I
> could not find a good documentation of the "@encode()" compiler
> directive. Alternatively, I've archived a NSNumber, but I was really
> disappointed because for some reasons it didn't record my float/int
> correctly. So if someone could provide two lines of code, one for
> coding and one for decoding an integer using
> "encodeValuesOfObjCTypes:", I would be really grateful!
I don't know if it was a typo or not, but you used anInt instead of
&anInt. i.e
wrong: [coder encodeValueOfObjCType:@encode(int) at:myInt]
right: [[coder encodeValueOfObjCType:@encode(int) at:&myInt]
unless of course that myInt is a pointer right?
Roarke Lynch
-------------------------------
<email_removed>
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Cédric John | Dec 19, 09:32 | |
| Roarke Lynch | Dec 19, 19:19 | |
| Nico | Dec 19, 19:31 |






Cocoa mail archive

