How to extract the image source from an rss string

后端 未结 1 732
鱼传尺愫
鱼传尺愫 2021-01-16 16:48
This is the yahoo news rss feed

1条回答
  •  無奈伤痛
    2021-01-16 17:45

    You can use NSScanner. Something like this:

    NSString *src = nil;
    NSString *newsRSSFeed = @"

    \"FirstAP - First lady Michelle Obama urged more than 1,000 cadets Friday night on the brink of graduating to keep in mind the families of the soldiers they will lead.


    "; NSScanner *theScanner = [NSScanner scannerWithString:newsRSSFeed]; // find start of IMG tag [theScanner scanUpToString:@" http://d.yimg.com/a/p/ap/20110520/capt.53a8af4c675f421c8b7cba014c589d29-53a8af4c675f421c8b7cba014c589d29-0.jpg?x=130&y=97&q=85&sig=iOyBvkyg0rEKSK3hjlSsNA--

    0 讨论(0)
提交回复
热议问题