Send the following message to the button object to enable/disable:
// Enable
[myButton setEnabled:YES];
// Disable
[myButton setEnabled:NO];
To determine whether you should show these buttons you should check the following properties on the webview:
[myWebView canGoBack];
[myWebView canGoForward];
You'll want to check these whenever the user loads a page. To do so implement the UIWebViewDelegate method webViewDidFinishLoad:
-(void)webViewDidFinishLoad:(UIWebView *)webView
{
// Enable or disable back
[myBackButton setEnabled:[myWebView canGoBack]];
// Enable or disable forward
[myForwardButton setEnabled:[myWebView canGoForward]];
[super webViewDidFinishLoad:webView];
}