Post

Replies

Boosts

Views

Activity

Reply to How to prevent singleton base class getting re-initialised
Thanks for working through this @ssmith_c. Your last paragraph in your first reply about 'is a' and 'need access to' is spot on. As you implicitly say, the answer to the question heading is that the singleton class (BLEManager) should never subsequently be instantiated with a new instance BLEManager(), but should always be referred to as BLEManager.shared. This means that it can never be subclassed, so the access within another class can be achieved by pointing to it with let bleManager = BLEManager.shared within my device model (In my full code there are lots of other places where I refer to it).
Jan ’24
Reply to Landmarks Tutorial. Preview doesn't work
I also could not get Preview to work at this point, and wasted days investigating. Now (July 2023) there have been 1.6k views of this so it must be a common problem. I have managed to resolve it, by loading the finished sample code and going through in detail. I found that landmarkData.json was missing from the bundle, causing the load error. I went back to the root of the code (the top item in the Navigation pane), which opens the .xcodeproject file, and chose Landmarks in the TARGETS section on the left, then across the top chose the Build Phases. Scroll to the very bottom to view the Copy Bundle Resources. landmarkData.json was missing from that list, so it wasn't being copied into the Bundle. Click the +, and select landmarkData.json in the Navigation tree, then click Add and it should now be in the list. That immediately resolved my problem - Preview worked everywhere its shown.
Jul ’23
Reply to How to identify macOS version by looking in directories
Found an easy way! Since the disk is connected to the Mac, go in to System Preferences and choose Startup Disk. Click the lock to make changes, and put the computer's password in. Then all the bootable disks will be shown, and below each one is the version of macOS installed. Find the one you want to know about and note the version, then just cancel out of changing the Startup Disk.
Aug ’22