Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Many classes in CocoaTouch implement the NSCopying protocol, but this protocol is not exposed in any way by the C# wrappers provided by MonoTouch. In order to get around this I had to write code like this:
var object = GetSomeObject();
var objectCopy = new ObjectType(Messaging.IntPtr_objc_msgSend(object, selCopy.Handle));
I'm assuming this isn't implemented because you usually don't need it, but when you do need it it can be a pain working around it.
The specific class I was trying to use it on was CAAnimation.
This was added to our internal "improvements" board for discussions, Thanks.
any updates on this? It still doesn't seems to be implemented.
Right now the `NS[Mutable]Copying` protocol(s) are not directly exposed in our API. They involve a lot of small changes in the class libraries for something that are not commonly used.
OTOH `NSObject` already provide a `Copy` method , which returns the result of `NSCopying` `copyWithZone:` and has the advantage of being part of `NSObject` itself (i.e. not re-declared in several subclasses).
p.s. If this does not solve your use case(s) could you share more details about it/them ?
My particular use case was an experiment that ultimately failed for other reasons, but I believe the Copy method you described would have been sufficient for what I was trying to do.
Thanks for the feedback.
Future versions of Xamarin.iOS and Xamarin.Mac will have support for NS[Mutable]Copying (piggybacked with the similar NS[Secure]Coding changes).
QA: automated testing for protocol conformance added
This fix is planned to be released with Xamarin.iOS 7.0.6, which should hit the beta channel before December 23rd.
I have verified the issue and found that mutable copy method is implemented in NSObject class
refer screen shot:
XS 4.2.3 (build 23)
X iOS 188.8.131.52