• 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: TXT Records with NSImages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TXT Records with NSImages


  • Subject: Re: TXT Records with NSImages
  • From: Joe Turner <email@hidden>
  • Date: Fri, 13 Mar 2009 07:12:42 -0500

Actually, I am converting it to NSData, and then adding it, and it still returns nil

Joe
On Mar 13, 2009, at 3:27 AM, Alexander Spohr wrote:

Just got recently into that pit myself.
Read the docs _very_ carefully for this one. (And file a complaint at the bottom of the doc’s page)


dictionaryFromTXTRecordData:
Return Value

A dictionary representing txtData. The dictionary’s keys are NSStringobjects using UTF8 encoding. !!!!The _values_ associated with all the dictionary’s keys _are NSData_ objects that encapsulate strings or data!!!!



If you feed your NSDictionary anything else than NSData it will return nil.
So you just have to convert your image to NSData and store that.


	atze



Am 13.03.2009 um 03:45 schrieb Joe Turner:

Hello,

Recently, I've been working on an app that will sync with an iphone app. So, I am using NSNetServices. I would like the iPhone to display the mac's icon, so I was thinking of using the TXT Record to store the icon. However, whenever I add it to the dictionary, convert the dictionary to data (using the NSNetService methd), it becomes nil. I am guessing that's because it's too large. Then, I decided to set the size of the image to (1,1) thinking it must be small enough. However, I still got nil. Is there a way to send an NSImage (as NSData in the dictionary, PNG formatted using an NSImageRep then converted to data) through a TXTRecord. And, if so, is there a way for the image to be able to be displayed on the iphone? I know an NSImage cannot be displayed on the iphone, which is why I converted it to PNG data, hoping the iphone could read that.

Thanks!

Joe
_______________________________________________

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


_______________________________________________

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


  • Follow-Ups:
    • Re: TXT Records with NSImages
      • From: Michael Ash <email@hidden>
References: 
 >TXT Records with NSImages (From: Joe Turner <email@hidden>)
 >Re: TXT Records with NSImages (From: Alexander Spohr <email@hidden>)

  • Prev by Date: why can't I see my layer?
  • Next by Date: Re: TXT Records with NSImages
  • Previous by thread: Re: TXT Records with NSImages
  • Next by thread: Re: TXT Records with NSImages
  • Index(es):
    • Date
    • Thread