I use an XML parser to retrieve an xml from server.
And I have the following two things:
NSMutableArray *catalogueList;
Catalogue *currentCatalogue;
Catalogue looks like this:
#import "Catalogue.h"
@implementation Catalogue
@synthesize id_model;
@synthesize name;
@synthesize url;
@end
And this piece of code also:
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{
if ([elementName isEqualToString:@"catalogue"])
{
// Add currentCatalogue to array
[catalogueList addObject: currentCatalogue.url];
}
This works great, but there is a little problem. When I do this:
NSLog(@"Valoare url %@", currentCatalogue.url);
it displays the correct URL.
But when I do this:
NSLog(@"Valoare url %@", catalogueList);
the output is “link”.
which is not correct at all: instead of Coupé I get Coup\U00e9. Please tell me how to obtain in catalogueList the correct link with the é character.
You are printing an array instead of the object. Try this:
Check out this SOF question NSLog incorrect encoding .
Similar problems with UTF8 characters