• 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: Data Structure to Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Data Structure to Data


  • Subject: Re: Data Structure to Data
  • From: Ben Trumbull <email@hidden>
  • Date: Fri, 18 Jan 2008 14:25:36 -0800

Bruce,

Directly encoding a struct is not going to have a happy ending. If it's in process, you can pass a pointer or an NSValue created with +valueWithPointer.

If you need a copy or to pass it to another process, you're going to need to write some encode/decode function. In addition to the semantic issue of a deep copy, structs have alignment and endian issues.

Also, plist structures can effectively be toll free bridged.

<http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFPropertyLists/CFPropertyLists.html>

For passing image data between a CLI and a user app, especially on the same machine, you might try writing the image data to file, and passing the path in the notification instead. The file system is very efficient with larger sized blobs (> 128K) and pretty reasonable down to 16-32K.

I'd wager that +dataWithContentsOfMappedFile: is faster than passing a large block of image data via notifications.
--


-Ben
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Reading a string from a socket
  • Next by Date: Re: Reading a string from a socket
  • Previous by thread: Re: Data Structure to Data
  • Next by thread: How to popup a panel or window over a runmodal window
  • Index(es):
    • Date
    • Thread