我正在使用TTStyledTextLabel和來自XHTML數據的TTStyledText來顯示新聞文章。 它工作正常,除了img是數據而不是鏈接,在這種情況下它崩潰!Three20 - TTStyledTextLabel遇到base64圖像數據而不是URL - 崩潰
代碼
TTStyledTextLabel *storyLabel = [[TTStyledTextLabel alloc] init];
[storyLabel setText: [TTStyledText textFromXHTML:[articleContents objectForKey:@"storyText"]]];
正常工作與正常的圖像網址XML,
但是當它遇到這樣的圖像數據:
img class="alignleft" src="data:image/jpg;base64,/9j/4AAQSkZJRgA...
(lots more in here)...1HhI0T//2Q==" alt="" width="267" height="189"/
它與輸出崩潰:
-[NSURLResponse allHeaderFields]: unrecognized selector
sent to instance 0xb83b370
這隻發生在遇到圖像數據時,否則如果是正常的img鏈接,它會加載正常。
謝謝!