<font face="Verdana,Arial,Helvetica,sans-serif" size="2"><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;">I am trying to implement some of the methods and properties in NSOrderedSet. </div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;"><br></div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;">The read-only property "reversedOrderedSet" has the @NSCopying attribute according to the NSOrderedSet class reference. </div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;"><br></div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;">So, I tried to do this: </div><div><p style="font-family: Menlo; font-size: 14px; line-height: normal;"><font color="#bb2ca2">@NSCopying</font> <font color="#bb2ca2">public</font> <font color="#bb2ca2">var</font> reversedOrderedSet: <font color="#4f8187">NSOrderedSet</font> {</p><p style="font-family: Menlo; font-size: 14px; line-height: normal;"> <font color="#bb2ca2">return</font><font color="#000000"> </font><font color="#4f8187">NSOrderedSet</font><font color="#000000">.</font><font color="#bb2ca2">init</font><font color="#000000">(array: </font><font color="#4f8187">_orderedStorage</font><font color="#000000">.</font><font color="#3d1d81">reverse</font><font color="#000000">())</font></p><p style="font-family: Menlo; font-size: 14px; line-height: normal;">}</p><p style="font-family: Menlo; font-size: 14px; line-height: normal;"><br></p><p style="line-height: normal;"><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;">The compiler says "@NSCopying requires the property to be mutable"</span><font face="Verdana, Arial, Helvetica, sans-serif" size="2">. When inherited by NSMutableOrderedSet, doesn't this property qualify to be mutable? </font></p><p style="line-height: normal;"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><br></font></p><p style="line-height: normal;"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Does @NSCopying not apply here? Is my understanding of "mutable (stored) property" flawed? </font><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;">Or is there a problem with the implementation?</span></p><p style="line-height: normal;"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><br></font></p><p style="line-height: normal;"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Nowhere in Foundation is @NSCopying being used currently. So don't have a "reference implementation" :)</font></p><p style="line-height: normal;"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><br></font></p><p style="font-family: Menlo; font-size: 14px; line-height: normal;"><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;"><br></span></p></div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;"><font face="Verdana,Arial,Helvetica,sans-serif" size="2"><font><font><div class="socmaildefaultfont" dir="ltr"><div class="socmaildefaultfont" dir="ltr"><div class="socmaildefaultfont" dir="ltr"><div dir="ltr" style="font-style: normal;"><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif">Pushkar N Kulkarni,</font></div>
<div dir="ltr" style="font-style: normal;"><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif">IBM Runtimes</font></div><div dir="ltr" style="font-style: normal;"><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif"><br></font></div><div dir="ltr"><font face="serif, Times New Roman, Times, serif"><i>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;"><br></div></div></div></div></font></font></font></div></font><BR>