<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Actually partially related. The /*@NSCopying*/ comments are hints that we left when initially importing that the return value should be copied. It is again a export from it’s objc nature. In this case having a property with copy.</div><div class=""><br class=""></div><div class="">e.g.</div><div class=""><br class=""></div><div class="">@property (copy) NSData *data;</div><div class=""><br class=""></div><div class="">exports as</div><div class=""><br class=""></div><div class="">@NSCopying public var data: NSData!</div><div class=""><br class=""></div><div class="">This is mainly there to preserve the copy nature when subclasses are implemented.</div><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 17, 2016, at 7:48 AM, Pushkar N Kulkarni <<a href="mailto:pushkar.nk@in.ibm.com" class="">pushkar.nk@in.ibm.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><font face="Verdana,Arial,Helvetica,sans-serif" size="2" class=""><div class="">Sorry for intruding!</div><div class=""><br class=""></div><div class="">I have the same question about /*@NSCopying*/ <br class=""><font face="Verdana,Arial,Helvetica,sans-serif" size="2" class=""><font class=""><font class=""><div class="socmaildefaultfont" dir="ltr"><div class="socmaildefaultfont" dir="ltr"><div class="socmaildefaultfont" dir="ltr"><div dir="ltr" style="font-style: normal;" class=""><br class=""><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" class="">Pushkar N Kulkarni,</font></div>
<div dir="ltr" style="font-style: normal;" class=""><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" class="">IBM Runtimes</font></div><div dir="ltr" style="font-style: normal;" class=""><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" class=""><br class=""></font></div><div dir="ltr" class=""><font face="serif, Times New Roman, Times, serif" class=""><i class="">Simplicity is prerequisite for reliability - Edsger W. Dijkstra</i></font></div>
<div dir="ltr" style="font-style: normal; font-size: 10.5pt; font-family: Arial;" class=""><br class=""></div></div></div></div></font></font></font></div><br class=""><br class=""><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2" class=""><font color="#990099" class=""><a href="mailto:-----swift-corelibs-dev-bounces@swift.org" target="_blank" class="">-----swift-corelibs-dev-bounces@swift.org</a> wrote: -----</font><div class="iNotesHistory" style="padding-left:5px;"><div style="padding-right:0px;padding-left:5px;border-left:solid black 2px;" class="">To: Daniel Eggert <<a href="mailto:danieleggert@me.com" target="_blank" class="">danieleggert@me.com</a>><br class="">From: Philippe Hausler via swift-corelibs-dev <swift-corelibs-dev@swift.org class=""><br class="">Sent by: <a href="mailto:swift-corelibs-dev-bounces@swift.org" target="_blank" class="">swift-corelibs-dev-bounces@swift.org</a><br class="">Date: 03/17/2016 08:12PM<br class="">Cc: Swift corelibs dev <<a href="mailto:swift-corelibs-dev@swift.org" target="_blank" class="">swift-corelibs-dev@swift.org</a>><br class="">Subject: Re: [swift-corelibs-dev] non-inherited init<br class=""><br class=""><div class=""><font face="Courier New,Courier,monospace" size="3" class="">That is a comment emitted by the importer, unfortunately it is impossible for non objc to mimic that behavior 100% because it is an init method that is constructed from a class method.<br class=""><br class="">@interface Foo : NSObject<br class="">+ (Foo *)fooNamed:(NSString *)name; // this is not an inherited init method in that it will always return an instance of a Foo no matter the subclass it is called from<br class="">@end<br class=""><br class="">@interface Bar : Foo<br class="">@end<br class=""><br class="">// in objc it is like this:<br class="">Foo *f = [Bar fooNamed:@“test”];<br class=""><br class="">// in swift it is like this:<br class="">let f = Bar(named:”test”)<br class=""><br class="">but obviously by the method fooNamed always returns a Foo instead of an instancetype because it actually looks up Foo objects from a table.<br class=""><br class="">> On Mar 17, 2016, at 7:35 AM, Daniel Eggert via swift-corelibs-dev <<a href="mailto:swift-corelibs-dev@swift.org" target="_blank" class="">swift-corelibs-dev@swift.org</a>> wrote:<br class="">> <br class="">> There're some initializers (namely in NSURLSession) that have a comment:<br class="">> <br class="">> public /*not inherited*/ init(...<br class="">> <br class="">> What is this “not inherited” comment trying to convey, and how would one go about implementing this in Swift?<br class="">> <br class="">> /Daniel<br class="">> <br class="">> _______________________________________________<br class="">> swift-corelibs-dev mailing list<br class="">> <a href="mailto:swift-corelibs-dev@swift.org" target="_blank" class="">swift-corelibs-dev@swift.org</a><br class="">> <a href="https://lists.swift.org/mailman/listinfo/swift-corelibs-dev" class="">https://lists.swift.org/mailman/listinfo/swift-corelibs-dev</a><br class=""><br class="">_______________________________________________<br class="">swift-corelibs-dev mailing list<br class=""><a href="mailto:swift-corelibs-dev@swift.org" target="_blank" class="">swift-corelibs-dev@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-corelibs-dev" class="">https://lists.swift.org/mailman/listinfo/swift-corelibs-dev</a><br class=""></font></div></swift-corelibs-dev@swift.org></div></div></font></font><br class="">
</div></blockquote></div><br class=""></body></html>