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.
encodeInt:forKey: and decodeInt:forKey: are the two missing ones, since they
were easily confused with the Swif
> On Jul 18, 2016, at 11:44 AM, Karl via swift-users
> wrote:
>
> Also, as interesting as that may be, I’m also curious what to do in the
> general case for types without magic compiler optimisations.
Wait for Swift 4, apparently:
https://github.com/apple/swift-evolution/blob/master/proposals
> Hi Tony - when I add that attribute, I get an error at compile-time:
> Objective-C method has a different selector from the method it overrides
> ('encodeInt:forKey:' vs. 'encodeInteger:forKey:')
>
> If I update to encodeInteger:forKey as the fix describes, it compiles, but
> I'm getting the s
Hi Tony - when I add that attribute, I get an error at compile-time:
Objective-C method has a different selector from the method it overrides
('encodeInt:forKey:' vs. 'encodeInteger:forKey:')
If I update to encodeInteger:forKey as the fix describes, it compiles, but
I'm getting the same original p
Probably, but there could be a compiler bug or importer bug lurking here.
- Tony
> On Jul 18, 2016, at 5:29 PM, Jacob Bandes-Storch wrote:
>
> Shouldn't that be implicit, since the function is `override`?
>
> On Mon, Jul 18, 2016 at 5:25 PM, Tony Parker via swift-users
> mailto:swift-users@sw
Shouldn't that be implicit, since the function is `override`?
On Mon, Jul 18, 2016 at 5:25 PM, Tony Parker via swift-users <
swift-users@swift.org> wrote:
> Hi John,
>
> Can you try this?
>
> @objc(encodeInt:forKey:)
> override func encode(_ intv: Int, forKey key: String) {
> print("\
Hi John,
Can you try this?
@objc(encodeInt:forKey:)
override func encode(_ intv: Int, forKey key: String) {
print("\(key) \(intv)") // never called
}
- Tony
> On Jul 18, 2016, at 12:11 AM, John Spurlock via swift-users
> wrote:
>
> Minimal repro case below. I'm creating a custom
> On 16 Jul 2016, at 22:16, Andrew Trick wrote:
>
> I don’t know what the recommended idiom is or if the syntax has changed from
> Swift 2 to 3, but I would do something like this:
>
> withExtendedLifetime(data) {
> let dataStart = UnsafePointer(data.bytes)
> myProcessdata1(dataStart,data.le
> On 18 Jul 2016, at 14:51, Martin R wrote:
>
> This is not an answer to your question, but note that you can pass a Swift
> String to functions expecting an UnsafePointer (C String) parameter,
> and the compiler will generate a temporary NUL-terminated UTF-8
> representation for you:
>
> l
Thank Lukas. I applied that patch and it did not work for me, at for the
incremental build. I will do a complete clean kick off the build process with
this patch to see if that resolves the issue.
Best,
Farhan
> On Jul 17, 2016, at 10:48 PM, Lukas Stabe wrote:
>
> I ran into the same error a
This is not an answer to your question, but note that you can pass a Swift
String to functions expecting an UnsafePointer (C String) parameter, and
the compiler will generate a temporary NUL-terminated UTF-8 representation for
you:
let io = DispatchIO(type: .stream, path: "/path/to/file", ...
Minimal repro case below. I'm creating a custom NSCoder, but the
"encodeInt:forKey" call is not dispatched properly to my overridden method
when encoding an NSCalendar instance.
What am I missing here? Without source code for any of this, I'm at a dead
end.
Thanks,
- john
=
> On Jul 17, 2016, at 12:58 PM, Farhan Ahmed via swift-users
> wrote:
>
> Thanks Kyle for the help and link to the swiftenv. I didn’t know it was
> available, and was wondering if there was one available… saves me the trouble
> of writing one ;)
>
> I have all dependencies installed. The err
13 matches
Mail list logo