Re: [iphone] Libxml2 with a wrapper to NSArray
Re: [iphone] Libxml2 with a wrapper to NSArray
- Subject: Re: [iphone] Libxml2 with a wrapper to NSArray
- From: Fritz Anderson <email@hidden>
- Date: Thu, 3 Dec 2009 21:34:33 -0600
On 3 Dec 2009, at 5:40 PM, Philip Vallone wrote:
> NSString *filePath = [[NSBundle mainBundle] pathForResource:@"manifest" ofType:@"xml"];
> NSData* xmlData = [filePath dataUsingEncoding:NSUTF8StringEncoding];
Separate from Sean's help, sending dataUsingEncoding: to an NSString gets you an NSData that wraps the binary representation of the characters of the string itself. You want something like
NSData * xmlData = [NSData dataWithContentsOfFile: filePath];
Also:
> NSArray *resultNodes = [NSArray array];
This points the variable resultNodes at an empty NSArray, which you will not be able to change.
> warning: implicit declaration of function 'PerformXPathQuery'
This indicates that you use of PerformXPathQuery was the first time the compiler has ever seen that function. It is universal practice to declare functions in advance, usually in a header (.h) file imported into the source file. It helps the compiler generate correct code and warn you about potential errors.
This last point is kind of basic to C. If you're not used to C, you shouldn't be starting with Objective-C, Cocoa, and libxml. Take a couple of weeks, back off, and learn C and its standard libraries first.
— F
_______________________________________________
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