Bug 33523 - Bindings reference documentation is wrong for categories
Summary: Bindings reference documentation is wrong for categories
Status: RESOLVED FIXED
Alias: None
Product: Documentation
Classification: Xamarin
Component: MonoTouch (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: CraigD
URL:
Depends on:
Blocks:
 
Reported: 2015-08-31 19:18 UTC by Adam Kemp
Modified: 2017-05-25 23:39 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Adam Kemp 2015-08-31 19:18:24 UTC
The documentation here: https://developer.xamarin.com/guides/ios/advanced_topics/binding_objective-c/binding_objc_libs/#Binding_Class_Extensions

has outdated information. The new way to do this for unified projects is something like this:

    [Category, BaseType (typeof (NSString))]
    interface NSStringDrawingExtensions {
            [Export ("drawAtPoint:withFont:")]
            CGSize DrawString (CGPoint point, UIFont font);
    }

There should also probably be an example of binding a property. Example:

@interface UIView (MyIn)
@property (nonatomic, strong) NSString *name;
@end

Would need two separate methods:

  [Category, BaseType(typeof(UIView))]
  interface UIView_MyIn
  {        
    [Export ("name")]
    string Name();

    [Export("setName:")]
    void SetName(string name);
  }
Comment 1 CraigD 2017-05-25 23:39:01 UTC
this _seems_ like it was addressed (the unified fix, at least). the engineering team has added additional examples to the page.