Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. NSURL *url = [[NSURL alloc] initFileURLWithPath:@"http://www.w3schools.com/xml/note.xml"];
  2. NSData *xmlData = [[NSData alloc] initWithContentsOfURL:url];
  3.  
  4. NSError *parseError = nil;
  5. NSDictionary *xmlDictionary = [XMLReader dictionaryForXMLData:xmlData error:&parseError];
  6.  
  7.  
  8. NSError *error;
  9. NSData *jsonData = [NSJSONSerialization dataWithJSONObject:xmlDictionary
  10. options:NSJSONWritingPrettyPrinted
  11. error:&error];
  12. NSLog(@"%@", jsonData);
  13.  
  14. [NSJSONSerialization dataWithJSONObject:options:error:]: value parameter is nil'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement