How to retrieve the HTML contained inside a UIWebView in iOS [#iosdev]

Recently on a project I needed to see what was going on inside the UIWebView that I was working with. Turns out it is very simple to retrieve and then log the HTML contained inside the UIWebView, using the stringByEvaluatingJavaScriptFromString method of the UIWebView, coupled with a very simple JavaScript call…

- (void)logDocumentHtml {
    NSString *html = [self.chatWebView stringByEvaluatingJavaScriptFromString: @"document.documentElement.innerHTML"];
    NSLog(@"document HTML:\n%@\n", html);
}

Hope this helps!

UITextField: A Complete API Overview from iPhone Programming Tutorials [@icode_blog, #iosdev]

Great little rundown on the UITextField API. Very helpful!

UITextField – A Complete API Overview | iPhone Programming Tutorials

The UITextField is probably one of the most commonly used UI controls on the iPhone. It is the primary method of user input via the keyboard and provides a great deal of additional functionality. With the success of our las API tutorial on NSArray, I thought I would do another walkthrough, this time on UITextField. I will be explaining all of the properties for it as well as bringing up some functionality that you may not have known about.

How to customize your UINavigationBar in iOS4 and iOS5 (and presumably iOS6) [#iosdev]

Again with the customization of a UINavigationBar. No one likes blue.

At any rate, I can’t believe that I completely forgot how to do this. It’s like two months of Java and SQL erased my Cocoa/Objective-C side of my brain.

Thanks to the following article for a refresher course.

Mladjan Antic

As you know, until iOS 5 came out, we used drawRect override in AppDelegate to customize UINavigationBar. Now iOS 5 give us some new method for styling (and old doesn’t work). How to build app that will work on iOS 4 and iOS 5 with stylized UINavigationBar? You must to do both!

Obrigado!