Mailing Lists: Apple Mailing Lists

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

simple string to NSData question



I'm a newbie (haven't done C in years, been using Java, Ruby mostly), so
sorry if this is a dumb question.

I'm trying to parse an xml file, so to get started I put the xml in a
String:

NSString *xml = @"<?xml version=\"1.0\"
encoding=\"UTF-8\"?><person><first>Larry</first><last>Furg</last></person>";


Now I need to move this to a NSXMLDocument, which takes an NSData.

Looking at NSData, I see there is a method initWithBytes.... but I'm not
sure how to put it in there from my NSString.

thanks for any help
phil
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to 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.