I have a problem with creation to NSString. The error is: "error: expected ']' before numeric constant". The code is below. Can you help me to find a solution for create these?
NSStri开发者_开发技巧ng *titleXML = [NSString stringWithFormat:@"<?xml version="1.0" encoding="UTF-8"?>"];
You need to escape the quotes in your string. Try it like this
NSString *titleXML = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"];
You have quote characters embedded in your string, you need to escape them with backslash like this:
NSString *titleXML = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"];
You have to escape your double quotes in the string using \"
:
NSString *titleXML = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"];
You'll need to escape those double quotes in the string for it to work. Like so:
NSString *titleXML = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"];
精彩评论