<div dir="ltr">Ok, filed a new bug for the encodeInt:forKey issue: rdar://problem/27425997<div><br></div><div>Ensured it reproduces in xcode beta 3, swift version 3.0 (swiftlang-800.0.34.6 clang-800.0.33)</div><div><br></div><div>Is there anything I can do in the meantime as a swift-only workaround to fix my custom NSCoder?</div><div><br></div><div>Thanks,</div><div>- john</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 18, 2016 at 10:52 PM, Tony Parker <span dir="ltr"><<a href="mailto:anthony.parker@apple.com" target="_blank">anthony.parker@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We renamed some of these methods for Swift 3 in an attempt to remove some of the confusion surrounding which of these did what - they were really named for C types and not Swift ones.<br>
<br>
encodeInt:forKey: and decodeInt:forKey: are the two missing ones, since they were easily confused with the Swift Int type. I think we’ll have to figure out a different approach here. John, please file a bug at <a href="http://bugreport.apple.com" rel="noreferrer" target="_blank">bugreport.apple.com</a> and let me know the radar number, and we’ll look into it.<br>
<br>
Thanks,<br>
- Tony<br>
<div class="HOEnZb"><div class="h5"><br>
> On Jul 18, 2016, at 6:33 PM, Brent Royal-Gordon <<a href="mailto:brent@architechies.com">brent@architechies.com</a>> wrote:<br>
><br>
>> Hi Tony - when I add that attribute, I get an error at compile-time:<br>
>> Objective-C method has a different selector from the method it overrides ('encodeInt:forKey:' vs. 'encodeInteger:forKey:')<br>
>><br>
>> If I update to encodeInteger:forKey as the fix describes, it compiles, but I'm getting the same original problem at runtime. i.e. "encodeInt:forKey: only defined for abstract class"<br>
>><br>
>> Any other ideas? See the same thing over there? You should be able to paste that into a new swift 3 test.<br>
><br>
> If you look at the NSCoder documentation, you'll see 25 methods in the Swift version of the "Encoding General Data" section, and 27 (non-deprecated) in the Objective-C version. `-encodeInt:forKey:` has no Swift equivalent. I'm not sure what the other missing method is.<br>
><br>
> I think this is probably a bug or design oversight, and I'd recommend you file a radar against Foundation. If this is a primitive method for NSCoding, it needs to be accessible from Swift.<br>
><br>
> --<br>
> Brent Royal-Gordon<br>
> Architechies<br>
><br>
<br>
</div></div></blockquote></div><br></div>