5

I am going to use NSXMLElement in my project, so I tried to

#import <Foundation/NSXMLDocument.h> 

but it gives an error: "No such file or directory." How can I include this?

jscs
  • 63,694
  • 13
  • 151
  • 195
Aravindhan
  • 15,608
  • 10
  • 56
  • 71

3 Answers3

15

NSXMLDocument is an OS X only class

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSXMLDocument_Class/Reference/Reference.html

You cant use it in iOS.

Warren Burton
  • 17,451
  • 3
  • 53
  • 73
0

On iOS you can use NSXMLParser.

zoul
  • 102,279
  • 44
  • 260
  • 354
valexa
  • 4,462
  • 32
  • 48
0

You should include Foundation/Foundation.h which pulls in everything you need. If you created the project not from one of Apple's Objective-C templates, you'll need to make sure that the Foundation framework is referenced by it.

JeremyP
  • 84,577
  • 15
  • 123
  • 161
  • @Aravindhanarvi: Sorry about this, but I didn't realise this was an iphone question. In fact (as Warren says) the classes you want aren't available on the iPhone. – JeremyP May 06 '11 at 09:24