Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting TXT records with CFNetService



Hi Tomas,

I'm not positive, but I don't think you can mix and match CFNetServiceRegister with CFNetServiceSetTXTData. If you want to use CFNetServiceSetTXTData, then you should use CFNetServiceRegisterWithOptions.

Hope that helps.
-Marc


On Jun 30, 2005, at 5:06 AM, Tomas Franzén wrote:

Hi,

I can't get CFNetServiceSetTXTData to work.
If I call it before CFNetServiceRegister, my app crashes when calling CFNetServiceRegister with this in console.log:


*** -[NSCFData _fastCharacterContents]: selector not recognized [self = 0x3c5850]
*** Uncaught exception: <NSInvalidArgumentException> *** - [NSCFData _fastCharacterContents]: selector not recognized [self = 0x3c5850]

...and this is from the actual crash log:

Thread 0 Crashed:
0 com.apple.Foundation 0x92897200 _NSRaiseError + 264
1 com.apple.Foundation 0x92896f3c +[NSException raise:format:] + 40
2 com.apple.Foundation 0x9287006c -[NSObject (NSForwardInvocation) forward::] + 176
3 libobjc.A.dylib 0x909b10d0 _objc_msgForward + 176
4 com.apple.CoreFoundation 0x9072946c __CFStringEncodeByteStream + 100
5 com.apple.CFNetwork 0x90f23178 CFNetServiceRegister + 348

If I instead call 'SetTXTData after 'ServiceRegister, nothing crashes, but the TXT records are not broadcasted.
I have tried both creating the TXT data with CFNetServiceCreateTXTDataWithDictionary, and creating it myself. Both conform to the specs, and look fine.


So my question is: How do I set TXT records with the CFNetService API?

Thanks,

Tomas Franzén
Lighthead Software
http://www.lightheadsw.com/
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Bonjour-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/bonjour-dev/email@hidden

This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Bonjour-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/bonjour-dev/email@hidden

This email sent to email@hidden
References: 
 >Setting TXT records with CFNetService (From: Tomas Franzén <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.