1 - (void)dooo 2 { 3 4 NSLog(@"------"); 5 NSString * str=@"<p style=\"text-align: center;\"><img style=\"width:94%;height:auto\" src=\"http://p1.img.cctvpic.com/photoworkspace/contentimg/2014/01/13/2014011318535072073.jpg\" alt=\"訪美首站為西雅圖將參觀波音和微軟\" width=\"500\"/></p><p style=\"text-align: center;\"><span style=\"color: #0000ff;\"><strong>AC米蘭官方宣布阿萊格里下課</strong></span></p><p><span style=\"color: #000000;\"> 北京時間1月13日晚6時,意甲AC米蘭俱樂部官方宣布主帥阿萊格里下課。昨天的意甲第19輪比賽中,AC米蘭客場3比4不敵升班馬薩索洛,比賽結束之后就傳出了阿萊格里將會被解雇的消息。</span></p><p><span style=\"color: #000000;\"> 米蘭的官方公告中寫道:“阿萊格里先生和他的助手們將不再擔任球隊一線隊教練的工作,對此我們非常遺憾,感謝阿萊格里和他的團隊幾年來為俱樂部做出的貢獻,祝願他在未來的工作中繼續取得成功。”<span style=\"font-size: 14px;\">此前意大利方面的消息都是在阿萊格里下課后,前米蘭球星因扎吉將暫時接手球隊,不過米蘭官方公告中稱球隊的訓練和比賽任務暫時由助理教練毛羅-塔索蒂負責。</span></span></p><p><span style=\"color: #000000;\"> <span style=\"font-size: 14px;\">阿萊格里在2010年世界杯后上任成為AC米蘭隊主教練,帶隊第一個賽季就幫助米蘭七年后重奪意甲聯賽冠軍,隨后又率隊在北京擊敗國米奪得意大利超級杯,第二個賽季米蘭戰績同樣不錯,可惜在關鍵一戰中因為裁判的誤判失去了一個重要進球,米蘭在聯賽冠軍的爭奪中輸給了尤文圖斯,后面兩個賽季米蘭陣容人員不整,不過阿萊格里還是率隊贏得了上賽季的第三名,從而獲得本賽季歐冠參賽資格。新賽季米蘭戰績比上賽季還差,主帥阿萊格里終於被解職。</span></span></p>"; 6 7 [self flattenHTML:str]; 8 9 } 10 - (NSString *)flattenHTML:(NSString *)html { 11 12 NSScanner *theScanner; 13 NSString *text = nil; 14 15 theScanner = [NSScanner scannerWithString:html]; 16 17 while ([theScanner isAtEnd] == NO) { 18 // find start of tag 19 [theScanner scanUpToString:@"<" intoString:NULL] ; 20 // find end of tag 21 [theScanner scanUpToString:@">" intoString:&text] ; 22 // replace the found tag with a space 23 //(you can filter multi-spaces out later if you wish) 24 html = [html stringByReplacingOccurrencesOfString: 25 [NSString stringWithFormat:@"%@>", text] 26 withString:@""]; 27 } // while // 28 29 NSLog(@"-----===%@",html); 30 return html; 31 }