SOLVED Xcode 8.2.1 DatePicker Bug


Joined
Mar 2, 2016
Messages
64
Reaction score
1
I've been following a coding book learning how to write code with Xcode on my Mac. I'm using Xcode 8.2.1 because I believe that is the latest version that will run on El Capitan (10.11.6). I've noticed that there is a bug with the graphical datepicker (NSDatePicker): if you pick January 1, 2021, it returns "2021-01-02"; if you pick January 31, 2021, it returns "2021-02-01" - always a day later than what you selected.

Is there a fix for this - perhaps a download of an update version of NSDatePicker? I can resolve this issue programmatically, now that I know it exists, but I shouldn't have to.
 
Last edited:
Ad

Advertisements

Joined
Mar 2, 2016
Messages
64
Reaction score
1
Actually I do, I just haven't used it in so long I forgot I had it. I first started playing with Xcode back when it was version 3 or 4, and I got a developer account at that time. But, I couldn't spend time playing with Xcode consistently, and at the time I had no idea about object-oriented coding concepts (I'm an old mainframe VM guy). But now that I've got an intermediate level of experience with OOP on Windows using Visual Studio and C#, plus I'm retired now so I have more time, I'm trying to get back into developing for the Mac. I'm following Wallace Wang's "macOS Programming for Absolute Beginners" (c) 2017, which is an excellent reference for someone who wants to learn programming with Xcode, and, that edition of the book uses Xcode 8, which is what I'm using. The fact that I got my OOP experience on Windows at work helped me understand the concepts that Mr. Wang uses in his book, and although the names of things are different, I can recognize similarities between Swift and C#, such as with Swift "protocols" and C# "interfaces".

Why did you ask about the Apple developer account?
 

Cory Cooper

Moderator
Joined
May 19, 2004
Messages
9,928
Reaction score
414
Hi,

I asked about the account, because the Apple Developer Forums are an excellent resource for questions about Xcode and Swift. I am sure we have members that have experience with Xcode, but may not be able to answer your question. Just thought that might be an additional place to research the issue and post for support.

C
 
Joined
Mar 2, 2016
Messages
64
Reaction score
1
Well, I asked the question on Apple Development account and was told that I needed to be on at least El Cap 10.11 (which I am) and Swift 5 or later, which I don't know. When I installed Xcode 8.2.1, I got whatever Swift it brought along with it, but I can't seem to find out from Xcode what version of Swift it is using, nor can I find a directory in which the Swift compiler is installed.

So: how do I find out what version of Swift is installed on my Mac?
 
Ad

Advertisements

Joined
Mar 2, 2016
Messages
64
Reaction score
1
Having found the answer on the Apple Development forum unhelpful, I did a global web search and found out the following:

To discover the release of Swift that one is running, you open Terminal and type "xcrun swift -version". From that, I find that the version of Swift I'm running is 3.0.2.

Now: the highest release of Xcode that runs on El Cap 10.11.6 is 8.2.1.
The highest release of Swift that runs on Xcode 8.2.1 is 3.0.2.

The doc for NMDatePicker requires Swift 5.0 or later and El Cap 10.11 or later, so it won't work on my system.

Well, why don't I upgrade? I will eventually, but when I migrate to a new release, I follow these steps:

1) make a point-in-time (PIT) bootable backup of my current system using SuperDuper on an external drive
2) perform a clean install of the new OS on the hard-disk of my MAC
3) make a PIT bootable backup of the clean install on the external drive
4) restore the PIT backup of my original system back to the hard disk of my MAC
5) boot the clean install off of the external hard drive when I want to work on it

Of course, if it's a ".1" version of the OS, I don't upgrade. This is the only way I've found to move to a new release safely and without issues, in that I now have my original known working system back on the hard disk of my MAC, and I can work on resolving bugs, problems, INOPs or whatever on the new system at my leisure. BTW, this is the same procedure I follow when I do Windows upgrades. Burnt once, twice shy.

As you can see, the upgrade process I follow is non-trivial, so I don't upgrade unless I need to, especially with Apple releasing new versions of its OS every 6 months or so. Of course, if I'm going to continue learning to do development on the MAC, I guess I need to upgrade now.

Anyhow, thanks for listening.
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top