0

I parse a rss file. In description tag i have also an image . How can i get it and displayed ?

I started to check if an url is in description with :

NSString *substring = @"http:"; NSRange textRange = [[item objectForKey:@"summary"] rangeOfString:substring]; if(textRange.location != NSNotFound) { NSLog(@"there is an url"); } else { NSLog(@"there is not an url"); } 

but i don't know how to get it

2
  • 1
    You should consider using NSXMLParser, and try to find any <img> inside your description tag. Trying to find text like that in HTML/XML code is prone to errors, you never know how the text will be formatted, if there are spaces or tabs, lowercase or uppercase, etc. Commented Jan 31, 2015 at 11:38
  • Parse your XML file, the above mentioned method is tedious and not recommended Commented Jan 31, 2015 at 11:45

1 Answer 1

1

If you are hesitant in "xml parsing" then you can convert this xml to NSDictionary first using https://github.com/nicklockwood/XMLDictionary then just operate it like normal NSDictionary

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.