Bug 29104 - NSXMLParserDelegate not bound
Summary: NSXMLParserDelegate not bound
Status: RESOLVED FEATURE
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 8.10
Hardware: Macintosh Mac OS
: Normal enhancement
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-04-14 20:46 UTC by David Hathaway
Modified: 2015-04-15 14:00 UTC (History)
3 users (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 FEATURE

Description David Hathaway 2015-04-14 20:46:58 UTC
NSXMLParserDelegate is not bound as of 

https://developer.apple.com/library/ios/documentation/Cocoa/Reference/NSXMLParserDelegate_Protocol/
Comment 1 Sebastien Pouliot 2015-04-15 08:30:46 UTC
Yes, this's was a known, deliberate design decision not to expose both:

* NSXMLParser; and
* NSXMLParserDelegate

as .NET provides several much better alternatives that also are cross platforms with our other products.

What's the use cases where this is required ?
Comment 2 David Hathaway 2015-04-15 12:14:03 UTC
Use case here is that a binding library implements the interface.  The case at hand is AirWatch.  Here is the binding:

// @interface AWSession : NSObject <NSURLConnectionDelegate, NSURLConnectionDataDelegate, NSXMLParserDelegate>
	[BaseType (typeof(NSObject))]
	interface AWSession : INSUrlConnectionDelegate, INSUrlConnectionDataDelegate INSXmlParserDelegate
	{
		// -(id)initWithAccount:(AWEnrollmentAccount *)account;
		[Export ("initWithAccount:")]
		IntPtr Constructor (AWEnrollmentAccount account);

		// -(BOOL)requestToken;
		[Export ("requestToken")]
		//[Verify (MethodToProperty)]
		bool RequestToken { get; }

		// -(BOOL)invalidateToken;
		[Export ("invalidateToken")]
		//[Verify (MethodToProperty)]
		bool InvalidateToken { get; }

		// -(BOOL)tokenIsValid;
		[Export ("tokenIsValid")]
		//[Verify (MethodToProperty)]
		bool TokenIsValid { get; }

		// @property (copy, nonatomic) NSString * token;
		[Export ("token")]
		string Token { get; set; }

		[Wrap ("WeakDelegate")]
		AWSessionDelegate Delegate { get; set; }

		// @property (nonatomic, unsafe_unretained) id<AWSessionDelegate> delegate;
		[NullAllowed, Export ("delegate", ArgumentSemantic.Assign)]
		NSObject WeakDelegate { get; set; }

		// @property (readonly, nonatomic) BOOL isRequestingToken;
		[Export ("isRequestingToken")]
		bool IsRequestingToken { get; }

		// @property (readonly, nonatomic) BOOL isInvalidatingToken;
		[Export ("isInvalidatingToken")]
		bool IsInvalidatingToken { get; }

		// @property (nonatomic, strong) AWEnrollmentAccount * account;
		[Export ("account", ArgumentSemantic.Strong)]
		AWEnrollmentAccount Account { get; set; }

		// @property (assign, nonatomic) AWAuthenticationType authenticationType;
		[Export ("authenticationType", ArgumentSemantic.Assign)]
		AWAuthenticationType AuthenticationType { get; set; }

		// @property (nonatomic, strong) NSString * authenticationGroup;
		[Export ("authenticationGroup", ArgumentSemantic.Strong)]
		string AuthenticationGroup { get; set; }

		// @property (nonatomic, strong) NSString * authorizationCode;
		[Export ("authorizationCode", ArgumentSemantic.Strong)]
		string AuthorizationCode { get; set; }
	}
Comment 3 Sebastien Pouliot 2015-04-15 12:36:12 UTC
Is `AWSession` something you must subclass (and implement the delegate) ? or

requires you to set XML delegate members ? (I don't see such an API); or

or something that requires the customer to call some of that delegate's methods ?



If not then simply change:

> interface AWSession : INSUrlConnectionDelegate, INSUrlConnectionDataDelegate, INSXmlParserDelegate

to

> interface AWSession : INSUrlConnectionDelegate, INSUrlConnectionDataDelegate



That should not have any effect on the final bindings uses (as it really looks like this is purely an internal details, but I could be wrong).

IOW not everything needs (or should) be bound. In fact if it's not meant to be user callable then it's better/safer not to expose it in the bindings.

note: that's not something any tools can tell you (only the documentation of what's being bound).
Comment 4 David Hathaway 2015-04-15 13:52:35 UTC
In this case, it's not subclassing, but it would seem like it would be a good reason to add this to the APIs that should be bound anyways just in case the scenario you described does come up in the future.
Comment 5 Miguel de Icaza [MSFT] 2015-04-15 14:00:24 UTC
If we ever find a scenario where this is the case, we will bind it.

For now, we are happy with the decision that we have made about deliberately not binding it.

People from the future: if you have a use case, feel free to add the information to this bug and reopen.