The following code, while not necessarily pretty, worked absolutely fine in iOS 4.1 (returned an NSString with formatted HTML with the passed URL). In iOS 4.2.1, however, the function always returns nil if using stringWithFormat. NSLog shows the contents of embedHTML are correct, but the value of *html is always nil.
Any help is appreciated.
....
NSString *html = [self getHTML:urlString1];
....
- (NSString *)getHTML:(NSString *) url {
NSString *embedHTML = [NSString stringWithFormat:@"<html><head>\
<style type=\"text/css\">\
body {\
background-color: transparent;\
color: white;\
</style>\
</head><body style=\"margin:0\">\
<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
width=\"111\" height=\"116f\"></embed>\
</body></html>", url];
NSLog(@"Log: %@", embedHTML);
return embedHTML;
}