• 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
Re: encodeArrayOfObjCType: (with key?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: encodeArrayOfObjCType: (with key?)


  • Subject: Re: encodeArrayOfObjCType: (with key?)
  • From: Prachi Gauriar <email@hidden>
  • Date: Mon, 21 Feb 2005 14:10:13 -0500


On Feb 21, 2005, at 1:43 PM, Chris Outwin wrote:

I would like to encode an array of 4 floats with an associated key. The code I have so far is:

- (void)encodeWithCoder:(NSCoder *)encoder {

	if(encoder allowsKeyedCoding) {
      [encoder encodeBool:myBOOL forKey:@"theBool"];
	  // I want to encode the float array with a key here.
	}
	else {
	  // encode in sequenced order here
    }
}

I have several float arrays to encode. What is the approach to encode a float array having a key?

Is -encodeBytes:length:forKey: unsuitable for your needs? I think you could just call it like:


[encoder encodeBytes:myArray length:(4 * sizeof(float)) forKey:@"myArray"];

-Prachi

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >encodeArrayOfObjCType: (with key?) (From: Chris Outwin <email@hidden>)

  • Prev by Date: Adding view
  • Next by Date: Re: Automatic key view handling
  • Previous by thread: encodeArrayOfObjCType: (with key?)
  • Next by thread: Re: encodeArrayOfObjCType: (with key?)
  • Index(es):
    • Date
    • Thread