View Full Version : setFont - warnings
Feb 23, 2009, 06:52 AM
Im trying to set the fontsize of my uiwebview (ie. the content there) by using this code:
[webView setFont:[UIFont size:30]];
However, my app freezes, and I get the following warning (no error, though):
"warning: 'UIFont' may not respond to '+size:'
(Messages without a matching method signature will be assumed to return 'id' and 'accept'...' as arguments.)
warning: 'UIWebView' may not respond to '-setFont'."
Any idea what Im doing wrong here?
Feb 23, 2009, 07:00 AM
It's because size is not a class method of UIFont - which is what the error is telling you. The method you're looking for is systemFontOfSize:
Also setFont: is not a method of UIWebView. I don't know if you can do what you're trying to do there. Maybe you should try reading the class documentation rather than trying to make up your own imaginary methods? Simply guessing the method names is probably not a successful strategy.
Feb 23, 2009, 07:41 AM
No, your right, webview does not support fontsize, so this seems to be impossible.
Im trying to implement a way to extract an integer-variable from the systems settings (using Root.plist and NSUserDefaults) and setting it as the font-size of my uiwebviews.