|
Re: qsort_b in Swift
My guess is that this is not a compiler-related difference, but rather the effect of different algorithms. The performance depends on the initial ordering of the array. My recollection of this subject
My guess is that this is not a compiler-related difference, but rather the effect of different algorithms. The performance depends on the initial ordering of the array. My recollection of this subject
|
By
Quincey Morris
·
#307
·
|
|
Re: qsort_b in Swift
I tried this in Xcode Version 8.3.3 (8E3004b) (Swift 3) and:
1. it works: thank you very much. I never would have figured this out from the documentation alone.
2. qsort_b is about 2.25 times slower
I tried this in Xcode Version 8.3.3 (8E3004b) (Swift 3) and:
1. it works: thank you very much. I never would have figured this out from the documentation alone.
2. qsort_b is about 2.25 times slower
|
By
Gerriet M. Denkmann
·
#306
·
|
|
Re: qsort_b in Swift
Yikes, this is masochistic!
This is the prototype:
So I think the code looks like this (syntax-checked in Xcode 9 but not tested):
The “&sortedArray” relies on the compiler auto-bridging to the
Yikes, this is masochistic!
This is the prototype:
So I think the code looks like this (syntax-checked in Xcode 9 but not tested):
The “&sortedArray” relies on the compiler auto-bridging to the
|
By
Quincey Morris
·
#305
·
|
|
qsort_b in Swift
I have an array:
var sortedArray = [UInt32]()
for _ in 0 ..< limit { sortedArray.append( arc4random() ) }
sortedArray.sort()
This works fine.
I would like to compare the efficiency of “sort”
I have an array:
var sortedArray = [UInt32]()
for _ in 0 ..< limit { sortedArray.append( arc4random() ) }
sortedArray.sort()
This works fine.
I would like to compare the efficiency of “sort”
|
By
Gerriet M. Denkmann
·
#304
·
|
|
Problem deriving custom object from UIScrollView
macOS 10.12.6 / Xcode 8.3ß6 / Swift 4 / developing for iOS
I am working on a custom object which derives from UIScrollView (at least for now...see below). For initial testing, I am placing it on a
macOS 10.12.6 / Xcode 8.3ß6 / Swift 4 / developing for iOS
I am working on a custom object which derives from UIScrollView (at least for now...see below). For initial testing, I am placing it on a
|
By
Rick Aurbach
·
#303
·
|
|
Re: NSAllowsArbitraryLoads
Thanks, that’s what I suspected
love this Group!!!
cheers
Bill Pitcher
bill@...
Thanks, that’s what I suspected
love this Group!!!
cheers
Bill Pitcher
bill@...
|
By
Bill Pitcher
·
#302
·
|
|
Re: NSAllowsArbitraryLoads
You can't edit your Info.plist, or change settings like these; the app bundle is immutable.
At WWDC this year Apple said that they're getting stricter about App Transport Security exemptions like
You can't edit your Info.plist, or change settings like these; the app bundle is immutable.
At WWDC this year Apple said that they're getting stricter about App Transport Security exemptions like
|
By
Jens Alfke
·
#301
·
|
|
Re: NSAllowsArbitraryLoads
At my last company, we used it in our iOS apps and they shipped.
At my last company, we used it in our iOS apps and they shipped.
|
By
Alex Zavatone
·
#300
·
|
|
NSAllowsArbitraryLoads
Great list,
Provided the App Store review allowed it, would having a Preference that adds and sets the info.plist NSAppTransportSecurity/NSAllowsArbitraryLoads to true break my App Store
Great list,
Provided the App Store review allowed it, would having a Preference that adds and sets the info.plist NSAppTransportSecurity/NSAllowsArbitraryLoads to true break my App Store
|
By
Bill Pitcher
·
#299
·
|
|
Re: isFlipped??
It is actually the property flipped on NSView. isFlipped is the getter function.
The doc says: "If you want your view to use a flipped coordinate system, override this property and return
It is actually the property flipped on NSView. isFlipped is the getter function.
The doc says: "If you want your view to use a flipped coordinate system, override this property and return
|
By
Jack Brindle
·
#298
·
|
|
Re: isFlipped??
https://developer.apple.com/documentation/appkit/nsview/1483532-isflipped
No, of course not. `isFlipped` does not exist on UIView.
-b
https://developer.apple.com/documentation/appkit/nsview/1483532-isflipped
No, of course not. `isFlipped` does not exist on UIView.
-b
|
By
Ben Kennedy
·
#297
·
|
|
isFlipped??
Hi,
I’m trying to find some docs on isFlipped. When I search for it in the XCode docs, it only brings up a reference in NSImage and that’s deprecated.
I’m overriding this on some Classes on
Hi,
I’m trying to find some docs on isFlipped. When I search for it in the XCode docs, it only brings up a reference in NSImage and that’s deprecated.
I’m overriding this on some Classes on
|
By
Dave
·
#296
·
|
|
Re: Difference between NSPoint, NSSize, NSRect and the CG Versions
Thanks a lot Quincey and Jens for your through explanation - I had imported some Mac code from another project which uses NSRect’s and as my original project was iOS this caused compile errors, so
Thanks a lot Quincey and Jens for your through explanation - I had imported some Mac code from another project which uses NSRect’s and as my original project was iOS this caused compile errors, so
|
By
Dave
·
#295
·
|
|
Re: Difference between NSPoint, NSSize, NSRect and the CG Versions
Opening up a macOS project and looking at the definition of NSPoint, I see:
So, it was the same size as CGPoint, but a different struct name, which was enough to create an ABI incompatibility. You
Opening up a macOS project and looking at the definition of NSPoint, I see:
So, it was the same size as CGPoint, but a different struct name, which was enough to create an ABI incompatibility. You
|
By
Quincey Morris
·
#294
·
|
|
Re: Getting class when instantiating a singleton
Sure, why not, at least for Obj-C? The method description says, "Allocates a new instance of the receiving class, sends it an init message, and returns the initialized object."
And I checked out
Sure, why not, at least for Obj-C? The method description says, "Allocates a new instance of the receiving class, sends it an init message, and returns the initialized object."
And I checked out
|
By
Steve Christensen <punster@...>
·
#293
·
|
|
Re: Difference between NSPoint, NSSize, NSRect and the CG Versions
Here are the definitions copied from my iOS SDK headers. The types/sizes for CGFloat and NS[U]Integer track the 32-/64-bit architecture used to build a particular executable.
typedef CGFLOAT_TYPE
Here are the definitions copied from my iOS SDK headers. The types/sizes for CGFloat and NS[U]Integer track the 32-/64-bit architecture used to build a particular executable.
typedef CGFLOAT_TYPE
|
By
Steve Christensen <punster@...>
·
#292
·
|
|
Re: Difference between NSPoint, NSSize, NSRect and the CG Versions
I don’t remember the exact details either, but one issue is that there are places in the Obj-C runtime/metadata/whatever where the @encode string of a method signature matters, and some similar
I don’t remember the exact details either, but one issue is that there are places in the Obj-C runtime/metadata/whatever where the @encode string of a method signature matters, and some similar
|
By
Quincey Morris
·
#291
·
|
|
Re: Difference between NSPoint, NSSize, NSRect and the CG Versions
I don't see how they could be incompatible if they're the same size. The only 4-byte floating point type is 'float', so if the CG and NS types are using the same-size values, how can they be different
I don't see how they could be incompatible if they're the same size. The only 4-byte floating point type is 'float', so if the CG and NS types are using the same-size values, how can they be different
|
By
Jens Alfke
·
#290
·
|
|
Re: Difference between NSPoint, NSSize, NSRect and the CG Versions
There are “really” four different SDKs:
— 32-bit macOS
— 64-bit macOS
— 32-bit iOS
— 64-bit iOS
They are different in the sense that certain basic C types (such as int and float) are
There are “really” four different SDKs:
— 32-bit macOS
— 64-bit macOS
— 32-bit iOS
— 64-bit iOS
They are different in the sense that certain basic C types (such as int and float) are
|
By
Quincey Morris
·
#289
·
|
|
Re: Difference between NSPoint, NSSize, NSRect and the CG Versions
Historical reasons. AppKit predates Core Graphics (it predates Apple's acquisition of NeXT.)
—Jens
Historical reasons. AppKit predates Core Graphics (it predates Apple's acquisition of NeXT.)
—Jens
|
By
Jens Alfke
·
#288
·
|