0

Hi when I get the value from XML which is :

<settings>
  <setting name='Conference Number' value='#159' />
</settings>

then I wrote that :

 NSString *textType = [content substringToIndex:46];

When I print this:

    NSLog(@"print here the textType%@", textType);

it prints : print here the textType<settings>
  <setting name='Conference Number'

so that is what I want but when I say :

 if ([textType  isEqual: @"<setting name='Conference Number'"]){
        // Do something


    }

It doesn't work, any help appreciate

Steven
  • 762
  • 1
  • 10
  • 27
  • It's currently equals to `@"\n – Larme Jul 03 '17 at 11:23
  • Did you take into account to use a XML parser? – Amin Negm-Awad Jul 03 '17 at 11:27
  • @AminNegm-Awad: I suggested a XML Parser (implictly but giving the "main class" object nam `NSXMLParser` on his previous quesiton https://stackoverflow.com/questions/44850293/how-to-unwrap-the-content-value-from-xml-in-objective-c#comment76738347_44850293 – Larme Jul 03 '17 at 11:58
  • Hi @Larmer, I wrote if ([textType isEqual: @"\n – Steven Jul 03 '17 at 12:16
  • And maybe it is a tab. Or another kind of space. It isn't that easy. You should never compare the string directly unless you write an XML parser. This is highly error prone. – Amin Negm-Awad Jul 03 '17 at 12:40

0 Answers0