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 protected])
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/archive%40mail-archive.com
This email sent to [email protected]