• 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
getting bytes from NSData appends some special characters at the end
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getting bytes from NSData appends some special characters at the end


  • Subject: getting bytes from NSData appends some special characters at the end
  • From: Sudheer dantuluri <email@hidden>
  • Date: Mon, 28 Aug 2006 18:28:03 +0530

Hi All ,

I've a problem while reading bytes from NSData .
Here I'm getting NSData from an XMLDocument and trying to get bytes from the data .
But some special characters are getting added to the bytes .


NSData *xmlData = [[category document] XMLDataWithOptions:NSXMLNodePrettyPrint];
const char *content = (const char *)[xmlData bytes];
NSLog(@" ------ content ------ :%s",content);


Here I'm adding the log

2006-08-28 18:09:51.204   ------ content ------ :
<Category>
    <ID>Downloads</ID>
    <ParentID></ParentID>
    <Name>Downloads</Name>
    <Comments></Comments>
    <Color>
        <redComponent>0.000000</redComponent>
        <greenComponent>0.000000</greenComponent>
        <blueComponent>0.000000</blueComponent>
        <alphaComponent>0.000000</alphaComponent>
    </Color>
    <Path>Downloads.xml</Path>
    <IconPath>Downloads.tif</IconPath>
    <Projects></Projects>
    <Books></Books>
    <Pages></Pages>
    <Color></Color>
</Category>>ategory>±¡”°±¡”

The extra characters are in red.
please help me out in this issue .

Thanks in advance
Sudheer.




_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: getting bytes from NSData appends some special characters at the end
      • From: Chris Suter <email@hidden>
  • Prev by Date: Re: Can I bind the contentArray of an NSArrayController to selectedObjects.array of another?
  • Next by Date: Re: getting bytes from NSData appends some special characters at the end
  • Previous by thread: Re: Problem with NSWorkspaceDidMountNotification and FSResolveAlias()
  • Next by thread: Re: getting bytes from NSData appends some special characters at the end
  • Index(es):
    • Date
    • Thread