Post

Replies

Boosts

Views

Activity

Reply to My app is crashing at launch in Test Flight in iPad. Can anyone help me understand where the problem is?
From the log I am guessing you app is called CardScanner, and the first step you should perform is getting the log 'symbolicated', it will be more apparent where the crash is occurring: 3 CardScanner         0x100485c2c 0x1001d0000 + 2841644 4 CardScanner         0x100436e10 0x1001d0000 + 2518544 When symbolicated, those numbers (0x100485c2c 0x1001d0000 + 2841644) will turn into method names, which will help. You should be able to symbolicate from Xcode -> Window -> Organiser and selecting Crashes, or on the device by selecting the device in Devices and Simulators, then view logs, then right click on your app name and selecting re-symbolicate From the top of the log I can see that the thread that crashed was Thread 3: Triggered by Thread: 3 So, check you're not updating the UI off that thread? (UI updates should be Dispatched onto main thread). The exception is: EXC_CRASH (SIGABRT) So check there's not a nil somewhere that shouldn't be there, eg: inserting nil into an array or a dictionary, or setting something that is not an optional to nil ( or you've force unwrapped an optional using '!' )
Jun ’21
Reply to Newest version of xcode
Which version of Xcode are you using? Only Xcode 12.5 and later have support for iOS 14.6. Also, Xcode 12.5 only installs on Big Sur and later. If you're using Xcode 12.5 navigate to Xcode -> Window -> Devices and Simulators. You will need to connect your device via USB and wait for the device support files to be downloaded and installed. Once the support files are downloaded, you should see some folders names for the iOS version off your home folder in ~/Library/Developer/Xcode/iOS DeviceSupport. Additionally, you should see a Developer section in the Device in Settings on the device, just after Game Center. Earlier versions of Xcode include device support files bundled within the Xcode app (but only for the devices that version of Xcode directly supported). Xcode 12.5 includes bundled device support files - but not for iOS 14.6, it must be downloaded. You can see what device support is bundled in Xcode by right clicking on the Xcode app (in Finder) -> 'Show Package Contents' and navigate to /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport. You'll see a list of the bundled device support files. If you're on Catalina or earlier, and Xcode 12.4 or earlier you can still run and test on iOS 14.6, but you need to get the developer support files onto the actual device first, using the Xcode 12.5 method.
Jun ’21
Reply to How to get current time
Date() includes current date and time all in one package. You just need to extract the time parts from it. Have a look at Calendar class DateComponents method to get hour and minute as variables, or DateFormat() to just format them as a string. Examples: import UIKit // current date and time let date = Date() // Calender dateComponents let components = Calendar.current.dateComponents([.hour,.minute], from: date) let hour = components.hour let minute = components.minute // DateFormatter let dateFormatter = DateFormatter() dateFormatter.dateFormat = "hh:mm" let hoursMinutesString = dateFormatter.string(from: date)
Jun ’21