• 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
Specifying primitive types in NSCoders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Specifying primitive types in NSCoders


  • Subject: Specifying primitive types in NSCoders
  • From: Ken Tozier <email@hidden>
  • Date: Sat, 29 Jun 2002 11:50:12 -0400

I'm sure this is a simple one, but I can't find any concrete examples of
how to specify primitive types in encoding and decoding methods.

For example:

- (void)decodeValueOfObjCType:(const char *)valueType at:(void *)data

What exactly do you pass into "valueType"?

Is Apple actually making us do something like this?

char floatConstant = 'f'
float floatValue;

[self decodeValueOfObjCType:&floatConstant at:&floatValue];

Don't they have constants defined for these?

I looked at NSCoder which tells you to look at chapter 4 in the Obj c
reference. Looking in Obj c reference it has a table of values, but no
examples of use and says look at NSCoder

Could someone provide a couple of quick examples for how to call encode
and decode for primitives

Thanks

Ken Tozier
_______________________________________________
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: Specifying primitive types in NSCoders
      • From: Andy Lee <email@hidden>
  • Prev by Date: Making a window non-draggable
  • Next by Date: Re: Getting key events when the program is in the background?
  • Previous by thread: Re: Making a window non-draggable
  • Next by thread: Re: Specifying primitive types in NSCoders
  • Index(es):
    • Date
    • Thread