I'm storing font preferences for a WebView in my shared user defaults. I have a WebView set up in my XIB, but it isn't possible to bind a WebView's font properties in IB, so I'm wondering if I can do it in code instead. I've tried this:
WebPreferences *webPrefs = [WebPreferences standardPreferences];
[webPrefs bind:@"fixedFontFamily"
      toObject:[NSUserDefaultsController sharedUserDefaultsController]
   withKeyPath:@"values.webViewMonospaceFontFamily"
 开发者_如何学Go      options:nil];
[myWebView setPreferences:webPrefs];
and it doesn't work.
If this is not going to work, what would be a working strategy for changing my WebView's font when the user selects a new font in my preferences window? Do I have to manually set it in my changeFont: method?
Update. This does work. WebPreferences has more font properties than I thought, and fixedFontFamily was the wrong one for the page I was viewing.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论