Re: TXT Records with NSImages
Re: TXT Records with NSImages
- Subject: Re: TXT Records with NSImages
- From: Alexander Spohr <email@hidden>
- Date: Fri, 13 Mar 2009 09:27:51 +0100
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