Shouldn't NSUInteger always become UInt in swift?
On Thu, Feb 2, 2017 at 12:07 AM Freak Show via swift-evolution <
swift-evolution@swift.org> wrote:

> I have a framework I wrote that maps Objective C objects to sqlite records
> - deriving sqlite schema definitions from property definitions.  You simply
> derive model classes from my base class Model and the base class will
> introspect the properties and handle all the sql for you.  A little like
> CoreData but the property definitions are used for the meta model instead
> of an external model file and it is a lot leaner and natural feeling.
>
> I picked NSUInteger for the auto incremented primary key because, after
> all, it would never go negative.
>
> However, when I tried to import this framework into Swift and use Model as
> a base class for a Swift class, I found it nearly impossible to satisfy the
> compiler about mixed mode comparisons and ultimately changed the type to
> NSInteger.
>
> I was not happy about it and if I wasn't the framework author I would have
> thought harder about changing it.
>
>
>
>
> On Feb 1, 2017, at 17:29, Jordan Rose via swift-evolution <
> swift-evolution@swift.org> wrote:
>
> *find out how Objective-C projects are using NSUInteger in their headers:*
>
> - Do they have no NSUIntegers at all?
> - Are they using NSUInteger because they’re overriding something that used
> NSUInteger, or implementing a protocol method that used NSUInteger?
> - Are they using NSUInteger as an opaque value, where comparisons and
> arithmetic are uninteresting?
> - Are they using NSUInteger as an index or count of something held in
> memory?
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution@swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to