Code Diagnostics

RSS for tag

Enable runtime checks to detect and avoid bugs in your code using Code Diagnostics.

Posts under Code Diagnostics tag

44 Posts

Post

Replies

Boosts

Views

Activity

Crash Xcode 14 with Swift -> Objective-C framework; AutoreleasingUnsafeMutablePointer; -O Optimize for Speed
I am having a crash with a Swift -> Objective-C interoperability under Xcode 14 / Swift 5.7 but only when Optimize for Speed is part of the build. There was no issue with this under Xcode 13.4.1 / Swift 5.6 under the same conditions. Typically, this compiler option is disabled for Debug builds so this was only detected once we provided release builds to beta users using Test Flight.  The interoperability is with using a proprietary, third-party framework. I am not privy to the Objective-C code that makes up the public API for this framework. As the framework had worked with Xcode 13.4.1 (with and without the speed optimization) and also works in Debug mode with Xcode 14.x (I have tried 14.1 as well) but crashes with the speed optimization turned on, I suspect the optimization may be at fault. But it is hard to say. I am hoping someone with better knowledge than I of this can guide me as to why this is happening…and only now. Here is an example of the code. Note: there are multiple instances of this same pattern in the API. There are vendor supplied structures (as well as NSArray as in this example) that cause similar failure. The vendor has supplied only Objective-C sample code and documentation.     func listItems() {         var availableItems: NSMutableArray? = NSMutableArray()         let result = itemSDK.getAvailableItemList(&availableItems)     // ...     } The header file provides: - (ITEM_RESULT) getAvailableItemList:(NSMutableArray**)getAvailableItemList; The derived Swift interface for this is: func getAvailableItemList(_ availableItemsList: AutoreleasingUnsafeMutablePointer<NSMutableArray?>!) -> ITEM_RESULT The crash occurs when calling the API and/or attempting to use the value associated with the AutoreleasingUnsafeMutablePointer. I have turned on all memory management diagnostics for the run phase of the scheme. When I do so, I see the following in the console when I get a fatal Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1d66e8a88) presented in the caller to the listItems() method. *** -[__NSArrayM retain]: message sent to deallocated instance 0x28bd15200 My assumption is that this indicates the memory was released (aggressively?) and so this causes the crash. Again, only with the -O (Optimize for Speed) option is enabled. I have been able to code a potential solution to this issue. Maybe this should have been the solution for prior Swift versions…but I had no reason (as it had worked without issue up until Xcode 14).     func listItems() {         let itemsArray = NSMutableArray()          var availableItems: NSMutableArray? = itemsArray         let result = itemSDK.getAvailableItemList(&availableItems)     // ...     } This solution assigns the array to an immutable variable and then assigns that reference to an optional that is passed for the AutoreleasingUnsafeMutablePointer. My assumption is that adds an additional retain to keep the optimization from removing the memory for the array until the itemsArray is no longer referenced. I am reaching out to see if this is a known issue by others and/or expected (but new) behavior as I do not have much experience with AutoreleasingUnsafeMutablePointer. Also, if this is not a bug but is the new normal, is the potential solution the proper way to use the AutoreleasingUnsafeMutablePointer with Objective-C framework APIs? Or should I be doing something different? Thanks for any insight or pointers (even if unsafe).
5
0
2.6k
Nov ’22
Error Cannot find « » in scope XCODE
Hello I made an app and I have this error: Cannot find string in scope I post my code under the message please help me: Photo: ("https://developer.apple.com/forums/content/attachment/3253bf72-d034-475e-a69e-a73f32388f84" "title=Capture d’écran 2022-11-21 à 19.16.00.png;width=2036;height=1380") // //  AuthviewModel.swift //  iSpeak // //  Created by Sayan on 21.11.22. // import Foundation import Firebase class AuthViewModel: ObservableObject {     var manager = FirebaseManager.shared          @Published var isFinishedConnecting: Bool = false     @Published var isAuth: Bool = false     @Published var showError: Bool = false          var errorString: String = ""     var datas: [String: Any] = [:]          var auth: Auth {         return manager.auth     }          init() {         observeAuthentication()     }          func observeAuthentication() {         auth.addStateDidChangeListener(handleChangeListener)     }          func handleChangeListener(auth: Auth, user: User?) {         self.isFinishedConnecting = true         self.isAuth = user != nil     }          func signIn(email: String, password: String) {         guard checkValue(_string: email, value: "adresse email") else { return }         guard checkValue(_string: password, value: "Mot de passe") else { return }              }          func createUser() {              }          func checkValue(_string: String, value: String) -> Bool {       let isNotEmpty = string != "" Error : Cannot find « string » in scope          self.errorString = !isNotEmpty ? "" : "Merci d'entrer (value) pour continuer"         self.showError = !isNotEmpty         return isNotEmpty     } }
1
0
2k
Nov ’22
Is git already installed when buying a new Macbook?
Greetings, due to the current situation (Corona-Virus) I had to download Xcode, MS Visual Studio and Visual StudioCode on my personal MacBook Pro (2017; no Touch Bar). These applications were all asking for git (git-scm) and I have accepted. After some regrets I have decided to delete all applications again. I was able to delete Xcode, MS VS and VS Code but there was no program with the name git“, but hundreds of files with a big red „h“ on them, that I have never seen before. I used the function for a secured system restart and at the end I was reinstalling MacOS BigSur. Every time I logged in my entire display was black and my cursor in a neon blue I installed a new MacOS again and now everything seems to be fine (at least no black screen). I used some codes, I got from google, on my terminal (sudo rm -rf /usr/bin/git/), I am afraid that it has done more damage than it was helpful. Any idea how I can reverse the last 24 hours? Summary: Is Git already installed when I buy a new MacBook? If not, how can I delete all unnecessary files? Has „sudo rm -rf /usr/bin/git/„ changed anything? My terminal said that I was having Apple Git 128. After deleting XCodes there seems to be no git $ which git /usr/bin/git $ git --version xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun Sorry for all the questions, but I am totally unskilled when it is about using git. Kind Regards,
4
0
17k
Nov ’22
Xcode autocompletion doesn't show functions from Objective C headers Jump to Definition doesn't work either
I've just fixed very strange bug / error/ undocumented feature on my Xcode conf. When I was running the latest Xcode 13.4.1 and highlight / autocompletion stopped working as I believe since macOS Monterey upgrade (before I ran Xcode 12) since I "fixed" some conf values by running defaults write com.apple.dt.Xcode some keys. Now I fixed It by deleting that edited config and re-running Xcode again and now it shows me autocompletion suggestions and follows headers when I press @@ defaults delete com.apple.dt.Xcode I just prepared this post with the ending: What should I do to make it possible to work? Appreciate for any help (Show live issues is turned on). Since I solved it I leave these words to let anyone who needs it to fix the issue with this mini tutorial. It somehow doesn't affect Swift code. Here's the stripped version of my old broken conf produced by defaults read com.apple.dt.Xcode: { BuildSystemScheduleInherentlyParallelCommandsExclusively = 1; CurrentAlertPreferencesSelection = "Xcode.AlertEvent.BuildStart"; "DTDKCrashLogSortDescriptors4.5" = ( { NSAscending = 0; NSKey = processName; NSSelector = "compare:"; }, { NSAscending = 1; NSKey = type; NSSelector = "compare:"; }, { NSAscending = 0; NSKey = dateTime; NSSelector = "compare:"; } ); DVTTextAutoSuggestCompletions = 1; DVTTextCompletionRecentCompletions = ( NSString ); DVTTextIndentCase = 0; DVTTextIndentTabWidth = 2; DVTTextIndentWidth = 2; DVTTextShowMinimap = 0; DVTTextSoloBraceIndentWidth = 2; DVTTextWrappedLinesIndentWidth = 2; IBAppliesAutoResizingRulesWhileResizing = 0; IBDesktopImageCacheVersionKey = "12.4-13F17a"; IBGlobalLastEditorDocumentClassName = IBStoryboardDocument; IBGlobalLastEditorTargetRuntime = "IBCocoaTouchFramework-fifteenAndLater"; IBPreferencesMigrated = 1; IBShowingMinimapStoryboard = 0; IBViewSizeInspectorPreferredRectTypeName = frame; IDEActivityLogShowsAllBuildSteps = 1; IDEActivityLogShowsAnalyzerResults = 1; IDEActivityLogShowsErrors = 1; IDEActivityLogShowsWarnings = 1; "IDEAnalyticsMetricsNotifications.AnalyticsMetricsNotificationsController.lastRefreshAttemptDate" = "2022-06-08 04:27:07 +0000"; IDEAppearance = 0; IDEBuildLocationStyle = Unique; IDECopyFilesToTargetGroup = 0; IDECreateGroupsForFolders = 0; IDEDebugSessionShowDisassemblyWhenDebugging = 0; IDEDisableGitSupportForNewProjects = 1; IDEDisableStateRestoration = 1; IDEDocSearchSelectedReferenceIdentifier = occ; IDEExtensionsBuiltPriorToXcode12 = ( ); IDEFileExtensionDisplayMode = 1; "IDEFileTemplateChooserAssistantSelectedTemplateName_iOS" = "Source/Header File"; "IDEFileTemplateChooserAssistantSelectedTemplateName_macOS" = "Source/Header File"; IDEFileTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.macosx"; IDEHasConvertedXcode3BuildPrefs = 1; IDEIndexDisable = 1; IDEIndexShowLog = 0; IDEKeyBindingCurrentPreferenceSet = "Default.idekeybindings"; IDEKeyBindingExcludedPreferenceSet = ( Default ); IDELastBreakpointActionClassName = IDESoundBreakpointAction; IDELogNavigatorGroupByKey = 0; IDEMaxParallelTestingWorkersMac = 0; IDEOpenQuicklyPreferSwiftGeneratedInterface = 0; "IDEOpenQuicklyWindowController.width" = 454; IDEProductsViewControllerSourceListSplitPosition = 215; IDEProfileActionSelectedTab = Info; IDEProvisioningTeamManagerLastSelectedTeamID = XXXXXXXXXX; IDEProvisioningTeams = { "my@email.com" = ( { isFreeProvisioningTeam = 1; teamID = XXXXXXXXXX; teamName = "Larry Moore (Personal Team)"; teamType = "Personal Team"; } ); }; IDEShowPrebuildLogs = 0; IDESoundBreakpointActionDefaultNameKey = Pop; IDESourceControlPreferencesVersion = 201; IDESuppressStandardArchitecturesUpgrade = 0; IDESuppressStopExecutionWarning = 1; IDESuppressStopExecutionWarningTarget = "IDESuppressStopExecutionWarningTargetValue_Stop"; IDESwiftPackageAdditionAssistantRecentlyUsedPackages = ( ); IDESwiftPackageCollectionsAddedDefaultCollectionsDVTToolsVersion = "Xcode 13.3.1"; IDETestActionSelectedTab = Info; IDETouchBarSimulatorIsVisible = 0; IDEUserWantsToEnableDeveloperSystemPolicyMode = 0; LastProcessNameAttachedTo = Riot; NSColorPanelMode = 1; NSColorPickerPreferredRGBEntryMode = 2; NSColorPickerSlidersDefaults = 1; NSNavPanelExpandedStateForSaveMode = 1; PBXNumberOfParallelBuildSubtasks = 10; PMPrintingExpandedStateForPrint2 = 0; PegasusMultipleCursorsEnabled = 1; ShowBuildOperationDuration = 1; Xcode3BuildSettingsEditorDisplayMode = 0; Xcode3BuildSettingsEditorMode = 0; Xcode3ProjectEditorSourceListVisible = 1; "Xcode3ProjectTemplateChooserAssistantSelectedTemplateName_iOS" = "Application/App"; "Xcode3ProjectTemplateChooserAssistantSelectedTemplateName_macOS" = "Application/App"; Xcode3ProjectTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.iphoneos"; "Xcode3TargetTemplateChooserAssistantSelectedTemplateName_iOS" = "Application/App"; "Xcode3TargetTemplateChooserAssistantSelectedTemplateName_macOS" = "Application/Command Line Tool"; Xcode3TargetTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.macosx"; } The only suspicious key is DVTTextAutoSuggestCompletions = 1; in this old config that might have stopped autocompletion.
2
0
2.0k
Jun ’22
Receiving this error 'EXC_BREAKPOINT (code=1, subcode=0x1051904b8)' when trying to use a PhotoPicker.
I'm going insane over this, I'm using Xcode 13 beta 6 on the M1 MacBook Air. Every time I pick an image, I receive this error message. At this point I don't know what I can do because the message is so vague. Please help me.     @Binding var image: UIImage          func makeUIViewController(context: Context) -> UIImagePickerController {         let imagePicker = UIImagePickerController()         imagePicker.delegate = context.coordinator         return imagePicker     }          func updateUIViewController(_ uiViewController: UIImagePickerController, context: Context) {              }          func makeCoordinator() -> Coordinator {         Coordinator(parent: self)     }          final class Coordinator: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate {                   var parent: PhotoPicker                  init(parent: PhotoPicker){             self.parent = parent         }                  func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {             if let image = info[.originalImage] as? UIImage {                 parent.image = image             }else{                              }             picker.dismiss(animated: true, completion: nil)         }     } }          @State private var isPresented: Bool = false     @State private var avatarImage = UIImage(systemName: "person") ?? UIImage()          var body: some View {         VStack {             Image(uiImage: avatarImage)                 .resizable()                 .scaledToFill()                 .frame(width: 150, height: 150)                 .clipShape(Circle())                 .padding()                 .onTapGesture {                     isPresented = true                 }                          Spacer()         }         .navigationTitle("Profile")         .sheet(isPresented: $isPresented) {             PhotoPicker(image: $avatarImage)         }     } }
4
0
5.4k
May ’22
Failed to produce diagnostic for expression; please submit a bug report
i did " // customslidebar.swift // chatbot // // Created by AndrewLee on 2022/05/04. // import SwiftUI enum Tab: String, CaseIterable {     case house     case message     case person     case gearshape } struct customslidebar: View {   @Binding var selectedTab: Tab   private var fillimage: String {     selectedTab.rawValue + ".fill"   }       var body: some View {     VStack {       HStack {         ForEach(Tab.allCases, id: .rawValue) { tab in           Spacer()           image(systemName: selectedTab == tab ? fillimage : tab.rawValue)           Spacer()                                 }       }       .frame(width: nil, height: 60)       .background(.thinMaterial)       .cornerRadius(10)       .padding()             }   } } struct customslidebar_Previews: PreviewProvider {   static var previews: some View {     customslidebar(selectedTab: .constant(.house))   } } this but it says Failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project
1
0
964
May ’22
Integrating Fyber SKAdNetwork ID Auto Updater - Xcode
Hi I'm finding it really difficult to integrate this tool in my Xcode project. The Fyber SKAdNetwork ID auto-updater is a tool for publishers to integrate into their build system and manage SKAdnetwork IDs into their Info.plist with each build job automatically. This will allow them to keep the Info.plist file up to date, even if some partners make changes to their IDs. Here's the link to the instructions: https://developer.fyber.com/hc/en-us/articles/360015298038-SKAdNetwork-ID-Auto-Updater I have installed the tool using Terminal but the rest is very confusing to me as I am not very familiar with some of the instructions/commands I'm being asked to do. Any help would be greatly appreciated - thank you so much in advance :) Ermes
1
0
1.4k
May ’22
App auto-closes on launch
Hello. I have developed an app: Kedeo.es: https://apps.apple.com/us/app/kedeo-es/id1609942690 Use external libraries to connect to Google Firebase Auth and Notifications. Also use Storekit for in-app purchase. It works perfectly, and it has also passed the tests and is published in the store, however, my client says that there are between 20% and 40% of users who are automatically closed just by opening. Does anyone else have this bug? It doesn't happen to me, and that's why I can't get any log to know more about the problem. If anyone can help I'd appreciate it. Greetings.
4
0
1.8k
May ’22
"Failed to produce a diagnostic for expression; please file a bug report" error.
İ am getting "Failed to produce a diagnostic for expression; please file a bug report" error. import SwiftUI struct ContentView: View {     let lifeformanalyzer = Lifeformanalyzer()     @State var text = ""     @State var title = "Merhaba insan!"          var body: some View { ————> error is here         VStack {             Image(systemName: "face.smiling.fill")                 .imageScale(.large)                 .foregroundColor(.accentColor)                 .padding(.top, 50)             Text(title)                 .font(.largeTitle)                          Spacer()                          TextField("Birşey yazın", text: $text)                 .multilineTextAlignment(.center)                 .frame(width: 300)                          Spacer()                          Button("Gönder") {                 submit()             }                          Spacer()                      }                                   .padding()         .frame(maxWidth: .infinity, maxHeight: .infinity)         .background(Color(red: 0.024, green: 0.392, blue: 0.549))         .ignoresSafeArea()                  func submit() {                      }     var title = "Merhaba \(lifeformanalyzer.processLifeform(text: text))!"                       }                     } The other swift file Lifeformanalyzer: class Lifeformanalyzer {          func processLifeform(text: String) -> String{                  text.lowercased().contains("vak")         ? "ördek" : "insan"     } }
2
0
1k
Apr ’22
Xcode 13.2.1 - Simulator works, Preview doesn't
Curious to know if anyone understands why I'm getting the following error "Cannot preview in this file" - [appname] crashed" Running the code on my (wirelessly) attached iPhone XR works, but the in-Xcode Preview window doesn't. Here's the log produced by the Diagnostics option: <Well, I tried to attach the zip file created from the previews-diagnostics-##-## folder, but this text field wouldn't accept that file type. Is there a particular file within the folder that I should upload instead?> Here's the code from the ContentView file for my (very basic) project: import SwiftUI struct ContentView: View { @FocusState private var amountIsFocused: Bool @State private var checkAmount = 0.0 @State private var numberOfPeople = 0 @State private var tipPercentage = 0 let tipPercentages = [0, 10, 15, 20, 25] var totalPerPerson: Double { let peopleCount = Double(numberOfPeople + 2) let tipSelection = Double(tipPercentage) let tipValue = tipSelection / 100 * checkAmount let grandTotal = checkAmount + tipValue let amountPerPerson = grandTotal / peopleCount return amountPerPerson } var totalAmount: Double { let tipSelection = Double(tipPercentage) let tipValue = tipSelection / 100 * checkAmount let grandTotal = checkAmount + tipValue return grandTotal } var body: some View { NavigationView { Form { Section { TextField("Amount", value: $checkAmount, format: .currency(code: Locale.current.currencyCode ?? "USD")) .keyboardType(.decimalPad) .focused($amountIsFocused) Picker("Number of people", selection: $numberOfPeople) { ForEach(2 ..< 100) { Text("\($0) people") } } } Section { Picker("Tip percentage", selection: $tipPercentage) { ForEach(0 ..< 101) { Text($0, format: .percent) } } } header: { Text("Select tip percentage") } Section { Text("Grand total: \(totalAmount, format: .currency(code: Locale.current.currencyCode ?? "USD"))") } Section { Text(totalPerPerson, format: .currency(code: Locale.current.currencyCode ?? "USD")) } header: { Text("Amount per person") } .navigationTitle("WeSplit") .navigationBarTitleDisplayMode(.inline) } .toolbar { ToolbarItemGroup(placement: .keyboard) { Spacer() Button("Done") { amountIsFocused = false } } } } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
5
0
2k
Mar ’22
python grasshopper in Rhino crash
When I use python grasshopper in Rhino, it crashes like insane. Does anyone know the reason? I'm using the new mac book pro with M1 chip Translated Report (Full Report Below) Process: Rhinoceros [20538] Path: /Applications/Rhino 7.app/Contents/MacOS/Rhinoceros Identifier: com.mcneel.rhinoceros.7 Version: 7.12 (7.12.21313.06342) Code Type: X86-64 (Translated) Parent Process: launchd [1] User ID: 501 Date/Time: 2021-11-30 15:48:24.5855 -0500 OS Version: macOS 12.0.1 (21A559) Report Version: 12 Anonymous UUID: AC464397-1C9E-4BEB-4E85-83E599FD5779 Sleep/Wake UUID: AB02ED2A-4CB9-4E90-B21B-C8C7DF6FFAFC Time Awake Since Boot: 130000 seconds Time Since Wake: 9093 seconds System Integrity Protection: enabled Crashed Thread: 2 SGen worker Exception Type: EXC_CRASH (SIGSEGV) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: Rhinoceros [20538] Model: MacBookPro18,2, BootROM 7429.41.5, proc 10:8:2 processors, 64 GB, SMC Graphics: Apple M1 Max, Apple M1 Max, Built-In Display: Color LCD, 3456 x 2234 Retina, Main, MirrorOff, Online Memory Module: LPDDR5 AirPort: Wi-Fi, wl0: Sep 24 2021 15:49:44 version 20.10.853.23.8.7.106 FWID 01-78e271b2 Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports Network Service: Wi-Fi, AirPort, en0 USB Device: USB31Bus USB Device: USB31Bus USB Device: USB31Bus Thunderbolt Bus: MacBook Pro, Apple Inc. Thunderbolt Bus: MacBook Pro, Apple Inc. Thunderbolt Bus: MacBook Pro, Apple Inc.
1
0
1.3k
Dec ’21
MallocCheckHeap is stack address or symbol address ?
Target Platform: iphone xr XCode: 12.4 After setting "Enable Malloc Scribble" "Malloc Guard Edges" "Goard Malloc" in Diagnostics and "MallocCheckHeapEach=1" "MallocCheckHeapSleep=100" "MallocCheckHeapStart=100000" in Environment Variables Start up the app on iphone and I get the following information: xxxx(1394,0x16f933000) malloc: *** MallocCheckHeap: FAILED check at operation #7444968 Stack for last operation where the malloc check succeeded: 0x1aefaed70 0x1aefa2f94 0x112f20540 0x1e904e76c 0x1e905a5e8 0x1e9054bf4 0x1e9035fc0 0x1b5ec57c4 0x112f216c0 0x112f25000 0x112f24e7c 0x1b5ec5268 0x1b5ed1348 0x1b5ed0e40 0x1a0b103f8 0x1a0b0e9a4 0x1a07a751c 0x1a0aef310 0x1a07afb74 0x1a07b6d38 0x1a0b1511c 0x1a0b12b28 0x1a02c2cc8 0x1a02bbac4 0x1a02bc7b0 0x1a0336028 0x1a02bb3c0 0x1a0336b60 0x1a0335344 0x1a03354c0 0x112f1fbcc 0x112f216c0 0x112f29354 0x112f2a0f4 0x112f2b5e4 0x112f36644 0x1e901c804 0x1e902375c  (Use 'atos' for a symbolic stack) xxxx(1394,0x16f933000) malloc: *** Will sleep for 100 seconds to leave time to attach xxxx(1394,0x16f933000) malloc: *** check: incorrect tiny region 44, counter=28255155 *** invariant broken for tiny block 0x13628fea0 this msize=0 - size is too small xxxx(1394,0x16f933000) malloc: *** set a breakpoint in malloc_error_break to debug xxxx(1394,0x16f933000) malloc: *** sleeping to help debug Q.1 "Stack for last operation where the malloc check succeeded" means what ? Q.2 the address is 'stack address' ? e.g 0x1aefaed70. Following the hints "(Use 'atos' for a symbolic stack) ", I get nothing for 0x1aefaed70 $atos -o ./DerivedData/Build/Products/Debug-iphoneos/xxxx.app.dSYM/Contents/Resources/DWARF/xxxx -arch arm64 -l 0x10225c000 0x10225c000 0x0000000100000000 (in xxxx) $atos -o ./DerivedData/Build/Products/Debug-iphoneos/xxxx.app.dSYM/Contents/Resources/DWARF/xxxx -arch arm64 -l 0x10225c000 0x1aefaed70 0x1aefaed70 (nothing) 0x10225c000 is load adress getting from AppDelegate after app start up.   uint32_t numImages = _dyld_image_count();   for (uint32_t i = 0; i < numImages; i++) {     const struct mach_header *header = _dyld_get_image_header(i);     const char *name = _dyld_get_image_name(i);     const char *p = strrchr(name, '/');     if (p && (strcmp(p + 1, "xxxx") == 0 || strcmp(p + 1, "libXxx.dylib") == 0)) {       NSLog(@"module=%s, address=%p", p + 1, header);     }   }    ```
2
0
1.4k
Dec ’21
panic(cpu 1 caller 0xffffff80227fea25): userspace watchdog timeout: no successful checkins from com.apple.WindowServer
This happens more or less every 2nd day early in the morning when I try to start, the system was rebooted. Any idea how to fix this ? iMac Modellname: iMac  Modell-Identifizierung: iMac15,1  Prozessortyp: Quad-Core Intel Core i5  Prozessorgeschwindigkeit: 3.5 GHz  Anzahl der Prozessoren: 1  Gesamtanzahl der Kerne: 4  L2-Cache (pro Kern): 256 KB  L3-Cache: 6 MB  Speicher: 32 GB  Systemfirmwareversion: 431.140.6.0.0  SMC-Version (System): 2.22f16  **panic(cpu** 1 caller 0xffffff80227fea25): userspace watchdog timeout: no successful checkins from com.apple.WindowServer in 120 seconds service: com.apple.logd, total successful checkins since wake (1430 seconds ago): 144, last successful checkin: 0 seconds ago service: com.apple.WindowServer, total successful checkins since wake (1430 seconds ago): 132, last successful checkin: 120 seconds ago Backtrace (CPU 1), Frame : Return Address 0xffffffa0bce43670 : 0xffffff801f48cfdd 0xffffffa0bce436c0 : 0xffffff801f5d3fd3 0xffffffa0bce43700 : 0xffffff801f5c45ca 0xffffffa0bce43750 : 0xffffff801f431a2f 0xffffffa0bce43770 : 0xffffff801f48c7fd 0xffffffa0bce43890 : 0xffffff801f48caf3 0xffffffa0bce43900 : 0xffffff801fc9ce34 0xffffffa0bce43970 : 0xffffff80227fea25 0xffffffa0bce43980 : 0xffffff80227fe660 0xffffffa0bce439a0 : 0xffffff801fc1d67e 0xffffffa0bce439f0 : 0xffffff80227fda34 0xffffffa0bce43b20 : 0xffffff801fc2792b 0xffffffa0bce43c80 : 0xffffff801f57f7d1 0xffffffa0bce43d90 : 0xffffff801f49265d 0xffffffa0bce43e00 : 0xffffff801f468cd5 0xffffffa0bce43e60 : 0xffffff801f4801e2 0xffffffa0bce43ef0 : 0xffffff801f5a869d 0xffffffa0bce43fa0 : 0xffffff801f432216 Kernel Extensions in backtrace: com.apple.driver.watchdog(1.0)[4CFADD2A-613E-320D-AD14-9C9379E87CB7]@0xffffff80227fc000->0xffffff80227fefff Process name corresponding to current thread: watchdogd Mac OS version: 20G165 Kernel version: Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 Kernel UUID: C2591F4E-EE82-33CC-8C59-DB81D9AD80DD KernelCache slide: 0x000000001f200000 KernelCache base: 0xffffff801f400000 Kernel slide: 0x000000001f210000 Kernel text base: 0xffffff801f410000 __HIB text base: 0xffffff801f300000 System model name: iMac15,1 (Mac-42FD25EABCABB274) System shutdown begun: NO Panic diags file available: NO (0xe00002bc) Hibernation exit count: 0 System uptime in nanoseconds: 54871209471415 Last Sleep: absolute base_tsc base_nano Uptime : 0x000031e7b2f2f0c4 Sleep : 0x0000309891fa771f 0x00000000435d4b0d 0x00002e03047989b5 Wake : 0x000030989950595c 0x00000000433523b2 0x0000309898b759e9 last started kext at 50615930221912: @filesystems.smbfs 3.6.1 (addr 0xffffff7fbad40000, size 491520) last stopped kext at 271735750053: >!AFIVRDriver 4.1.0 (addr 0xffffff7fb8a51000, size 8192) loaded kexts: org.virtualbox.kext.VBoxNetAdp 6.1.18 org.virtualbox.kext.VBoxNetFlt 6.1.18 org.virtualbox.kext.VBoxUSB 6.1.18 org.virtualbox.kext.VBoxDrv 6.1.18 com.paragon-software.filesystems.ntfs 108.8.15 com.disc-soft.DAEMONTools.VirtualSCSIBus 1.0.2 @filesystems.smbfs 3.6.1 @fileutil 20.036.15ATfilesystems.autofs 3.0 !ATopCaseHIDEventDriver 4050.1 !A!BMultitouch 99 AudioAUUC 1.70 AGPM 122.1 !APlatformEnabler 2.7.0d0 X86PlatformShim 1.0.0 !AMikeyHIDDriver 131 !AUpstreamUserClient 3.6.8 @kext.AMDFramebuffer 4.0.6 !AMikeyDriver 283.15ATkext.AMDRadeonX4000 4.0.6 @kext.AMDRadeonServiceManager 4.0.6 !AGraphicsDevicePolicy 6.3.5 @AGDCPluginDisplayMetrics 6.3.5pmtelemetry 1 |IOUserEthernet 1.0.1 !AHDA 283.15 usb.!UUserHCI 1 |IO!BSerialManager 8.0.5d7 @Dont_Steal_Mac_OS_X 7.0.0 !AHV 1 !ADiskImages2 1 !A!IHD5000Graphics 16.0.5 !AThunderboltIP 4.0.3 !AMCCSControl 1.14 !A!IFramebufferAzul 16.0.5 eficheck 1 !ALPC 3.1 !ASMCLMU 212 @kext.AMD7000!C 4.0.6 !A!ISlowAdaptiveClocking 4.0.0 |IO!BUSBDFU 8.0.5d7 |SCSITaskUserClient 436.140.1 !AFileSystemDriver 3.0.1 @filesystems.tmpfs 1 @filesystems.hfs.kext 556.100.11 @BootCache 40 @!AFSCompression.!AFSCompressionTypeZlib 1.0.0 @!AFSCompression.!AFSCompressionTypeDataless 1.0.0d1 @filesystems.apfs 1677.141.2 AirPort.BrcmNIC 1400.1.1 !ASDXC 1.9.0ATprivate.KextAudit 1.0 |!ABCM5701Ethernet 11.0.0 !AAHCIPort 346.100.2 !ARTC 2.0 !AACPIButtons 6.1 !AHPET 1.8 !ASMBIOS 2.1 !AACPIEC 6.1 !AAPIC 1.7 @!ASystemPolicy 2.0.0 @nke.applicationfirewall 311 |IOKitRegistryCompatibility 1 |EndpointSecurity 1 |IOUSBUserClient 900.4.2Aplugin.IOAVBDiscoveryPlugin 940.4 @kext.triggers 1.0 !AHIDKeyboard 224 !AHS!BDriver 4050.1 IO!BHIDDriver 8.0.5d7 !AMultitouchDriver 4440.3 !AInputDeviceSupport 4400.35 @kext.AMDRadeonX4030HWLibs 1.0 @kext.AMDRadeonX4000HWServices 4.0.6 !AGraphicsControl 6.3.5 DspFuncLib 283.15 @kext.OSvKernDSPLib 529 |IOSerial!F 11 |IOAVB!F 940.4 |IOEthernetAVB!C 1.1.0 usb.IOUSBHostHIDDevice 1.2 !AThunderboltEDMSink 5.0.3 !ASMBus!C 1.0.18d1 |IOAccelerator!F2 442.9 |IONDRVSupport 585.1 X86PlatformPlugin 1.0.0 !AHDA!C 283.15|IOHDA!F 283.15 !ASMBusPCI 1.0.14d1 IOPlatformPlugin!F 6.0.0d8 !UAudio 405.39 |IOAudio!F 300.6.1 @vecLib.kext 1.2.0 @kext.AMDSupport 4.0.6 @!AGPUWrangler 6.3.5 @!AGraphicsDeviceControl 6.3.5 |IOGraphics!F 585.1 |IOSlowAdaptiveClocking!F 1.0.0 @plugin.IOgPTPPlugin 985.2 |Broadcom!BHost!CUSBTransport 8.0.5d7 |IO!BHost!CUSBTransport 8.0.5d7 |IO!BHost!CTransport 8.0.5d7 usb.cdc 5.0.0 usb.networking 5.0.0 usb.!UHostCompositeDevice 1.2 usb.!UHub 1.2 !AThunderboltDPOutAdapter 8.1.4 !AThunderboltDPInAdapter 8.1.4 !AThunderboltDPAdapter!F 8.1.4 !AThunderboltPCIDownAdapter 4.1.1 !ABSDKextStarter 3 |IOSurface 290.8.1 @filesystems.hfs.encodings.kext 1 !AXsanScheme 3 |IOAHCIBlock!S 332 !AThunderboltNHI 7.2.8 |IOThunderbolt!F 9.3.2 usb.!UHostPacketFilter 1.0 |IOUSB!F 900.4.2 |IO80211!F 1200.12.2b1 |IOSkywalk!F 1 corecapture 1.0.4 mDNSOffloadUserClient 1.0.1b8 usb.!UXHCIPCI 1.2 usb.!UXHCI 1.2 |IOAHCI!F 294.100.1 !A!ILpssGspi 3.0.60 !AEFINVRAM 2.1 !AEFIRuntime 2.1|IOSMBus!F 1.1 |IOHID!F 2.0.0 $!AImage4 3.0.0 |IOTimeSync!F 985.2 |IONetworking!F 3.4 DiskImages 493.0.0 |IO!B!F 8.0.5d7 |IOReport!F 47 |IO!BPacketLogger 8.0.5d7 $quarantine 4 $sandbox 300.0 @kext.!AMatch 1.0.0d1 |CoreAnalytics!F 1 !ASSE 1.0 !AKeyStore 2 !UTDM 511.141.1|IOUSBMass!SDriver 184.140.2 |IOSCSIBlockCommandsDevice 436.140.1 |IO!S!F 2.1 |IOSCSIArchitectureModel!F 436.140.1 !AMobileFileIntegrity 1.0.5 @kext.CoreTrust 1 !AFDEKeyStore 28.30 !AEffaceable!S 1.0 !ACredentialManager 1.0 KernelRelayHost 1 |IOUSBHost!F 1.2!UHostMergeProperties 1.2 usb.!UCommon 1.0 !ABusPower!C 1.0 !ASEPManager 1.0.1 IOSlaveProcessor 1 !AACPIPlatform 6.1 !ASMC 3.1.9 |IOPCI!F 2.9 |IOACPI!F 1.4 watchdog 1 @kec.pthread 1 @kec.corecrypto 11.1 @kec.Libm 1 —T
0
0
2.7k
Oct ’21
Crash Xcode 14 with Swift -> Objective-C framework; AutoreleasingUnsafeMutablePointer; -O Optimize for Speed
I am having a crash with a Swift -> Objective-C interoperability under Xcode 14 / Swift 5.7 but only when Optimize for Speed is part of the build. There was no issue with this under Xcode 13.4.1 / Swift 5.6 under the same conditions. Typically, this compiler option is disabled for Debug builds so this was only detected once we provided release builds to beta users using Test Flight.  The interoperability is with using a proprietary, third-party framework. I am not privy to the Objective-C code that makes up the public API for this framework. As the framework had worked with Xcode 13.4.1 (with and without the speed optimization) and also works in Debug mode with Xcode 14.x (I have tried 14.1 as well) but crashes with the speed optimization turned on, I suspect the optimization may be at fault. But it is hard to say. I am hoping someone with better knowledge than I of this can guide me as to why this is happening…and only now. Here is an example of the code. Note: there are multiple instances of this same pattern in the API. There are vendor supplied structures (as well as NSArray as in this example) that cause similar failure. The vendor has supplied only Objective-C sample code and documentation.     func listItems() {         var availableItems: NSMutableArray? = NSMutableArray()         let result = itemSDK.getAvailableItemList(&availableItems)     // ...     } The header file provides: - (ITEM_RESULT) getAvailableItemList:(NSMutableArray**)getAvailableItemList; The derived Swift interface for this is: func getAvailableItemList(_ availableItemsList: AutoreleasingUnsafeMutablePointer<NSMutableArray?>!) -> ITEM_RESULT The crash occurs when calling the API and/or attempting to use the value associated with the AutoreleasingUnsafeMutablePointer. I have turned on all memory management diagnostics for the run phase of the scheme. When I do so, I see the following in the console when I get a fatal Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1d66e8a88) presented in the caller to the listItems() method. *** -[__NSArrayM retain]: message sent to deallocated instance 0x28bd15200 My assumption is that this indicates the memory was released (aggressively?) and so this causes the crash. Again, only with the -O (Optimize for Speed) option is enabled. I have been able to code a potential solution to this issue. Maybe this should have been the solution for prior Swift versions…but I had no reason (as it had worked without issue up until Xcode 14).     func listItems() {         let itemsArray = NSMutableArray()          var availableItems: NSMutableArray? = itemsArray         let result = itemSDK.getAvailableItemList(&availableItems)     // ...     } This solution assigns the array to an immutable variable and then assigns that reference to an optional that is passed for the AutoreleasingUnsafeMutablePointer. My assumption is that adds an additional retain to keep the optimization from removing the memory for the array until the itemsArray is no longer referenced. I am reaching out to see if this is a known issue by others and/or expected (but new) behavior as I do not have much experience with AutoreleasingUnsafeMutablePointer. Also, if this is not a bug but is the new normal, is the potential solution the proper way to use the AutoreleasingUnsafeMutablePointer with Objective-C framework APIs? Or should I be doing something different? Thanks for any insight or pointers (even if unsafe).
Replies
5
Boosts
0
Views
2.6k
Activity
Nov ’22
Error Cannot find « » in scope XCODE
Hello I made an app and I have this error: Cannot find string in scope I post my code under the message please help me: Photo: ("https://developer.apple.com/forums/content/attachment/3253bf72-d034-475e-a69e-a73f32388f84" "title=Capture d’écran 2022-11-21 à 19.16.00.png;width=2036;height=1380") // //  AuthviewModel.swift //  iSpeak // //  Created by Sayan on 21.11.22. // import Foundation import Firebase class AuthViewModel: ObservableObject {     var manager = FirebaseManager.shared          @Published var isFinishedConnecting: Bool = false     @Published var isAuth: Bool = false     @Published var showError: Bool = false          var errorString: String = ""     var datas: [String: Any] = [:]          var auth: Auth {         return manager.auth     }          init() {         observeAuthentication()     }          func observeAuthentication() {         auth.addStateDidChangeListener(handleChangeListener)     }          func handleChangeListener(auth: Auth, user: User?) {         self.isFinishedConnecting = true         self.isAuth = user != nil     }          func signIn(email: String, password: String) {         guard checkValue(_string: email, value: "adresse email") else { return }         guard checkValue(_string: password, value: "Mot de passe") else { return }              }          func createUser() {              }          func checkValue(_string: String, value: String) -> Bool {       let isNotEmpty = string != "" Error : Cannot find « string » in scope          self.errorString = !isNotEmpty ? "" : "Merci d'entrer (value) pour continuer"         self.showError = !isNotEmpty         return isNotEmpty     } }
Replies
1
Boosts
0
Views
2k
Activity
Nov ’22
Is git already installed when buying a new Macbook?
Greetings, due to the current situation (Corona-Virus) I had to download Xcode, MS Visual Studio and Visual StudioCode on my personal MacBook Pro (2017; no Touch Bar). These applications were all asking for git (git-scm) and I have accepted. After some regrets I have decided to delete all applications again. I was able to delete Xcode, MS VS and VS Code but there was no program with the name git“, but hundreds of files with a big red „h“ on them, that I have never seen before. I used the function for a secured system restart and at the end I was reinstalling MacOS BigSur. Every time I logged in my entire display was black and my cursor in a neon blue I installed a new MacOS again and now everything seems to be fine (at least no black screen). I used some codes, I got from google, on my terminal (sudo rm -rf /usr/bin/git/), I am afraid that it has done more damage than it was helpful. Any idea how I can reverse the last 24 hours? Summary: Is Git already installed when I buy a new MacBook? If not, how can I delete all unnecessary files? Has „sudo rm -rf /usr/bin/git/„ changed anything? My terminal said that I was having Apple Git 128. After deleting XCodes there seems to be no git $ which git /usr/bin/git $ git --version xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun Sorry for all the questions, but I am totally unskilled when it is about using git. Kind Regards,
Replies
4
Boosts
0
Views
17k
Activity
Nov ’22
Bug in IOs16 update
Hi team in the recent update IOS 16 , the lockscreen notification look has been changed,but even if we delete those messages the next day the same notification appears to be present in the lockscreen ,if we open the message it will be empty .
Replies
2
Boosts
0
Views
1.2k
Activity
Oct ’22
Xcode autocompletion doesn't show functions from Objective C headers Jump to Definition doesn't work either
I've just fixed very strange bug / error/ undocumented feature on my Xcode conf. When I was running the latest Xcode 13.4.1 and highlight / autocompletion stopped working as I believe since macOS Monterey upgrade (before I ran Xcode 12) since I "fixed" some conf values by running defaults write com.apple.dt.Xcode some keys. Now I fixed It by deleting that edited config and re-running Xcode again and now it shows me autocompletion suggestions and follows headers when I press @@ defaults delete com.apple.dt.Xcode I just prepared this post with the ending: What should I do to make it possible to work? Appreciate for any help (Show live issues is turned on). Since I solved it I leave these words to let anyone who needs it to fix the issue with this mini tutorial. It somehow doesn't affect Swift code. Here's the stripped version of my old broken conf produced by defaults read com.apple.dt.Xcode: { BuildSystemScheduleInherentlyParallelCommandsExclusively = 1; CurrentAlertPreferencesSelection = "Xcode.AlertEvent.BuildStart"; "DTDKCrashLogSortDescriptors4.5" = ( { NSAscending = 0; NSKey = processName; NSSelector = "compare:"; }, { NSAscending = 1; NSKey = type; NSSelector = "compare:"; }, { NSAscending = 0; NSKey = dateTime; NSSelector = "compare:"; } ); DVTTextAutoSuggestCompletions = 1; DVTTextCompletionRecentCompletions = ( NSString ); DVTTextIndentCase = 0; DVTTextIndentTabWidth = 2; DVTTextIndentWidth = 2; DVTTextShowMinimap = 0; DVTTextSoloBraceIndentWidth = 2; DVTTextWrappedLinesIndentWidth = 2; IBAppliesAutoResizingRulesWhileResizing = 0; IBDesktopImageCacheVersionKey = "12.4-13F17a"; IBGlobalLastEditorDocumentClassName = IBStoryboardDocument; IBGlobalLastEditorTargetRuntime = "IBCocoaTouchFramework-fifteenAndLater"; IBPreferencesMigrated = 1; IBShowingMinimapStoryboard = 0; IBViewSizeInspectorPreferredRectTypeName = frame; IDEActivityLogShowsAllBuildSteps = 1; IDEActivityLogShowsAnalyzerResults = 1; IDEActivityLogShowsErrors = 1; IDEActivityLogShowsWarnings = 1; "IDEAnalyticsMetricsNotifications.AnalyticsMetricsNotificationsController.lastRefreshAttemptDate" = "2022-06-08 04:27:07 +0000"; IDEAppearance = 0; IDEBuildLocationStyle = Unique; IDECopyFilesToTargetGroup = 0; IDECreateGroupsForFolders = 0; IDEDebugSessionShowDisassemblyWhenDebugging = 0; IDEDisableGitSupportForNewProjects = 1; IDEDisableStateRestoration = 1; IDEDocSearchSelectedReferenceIdentifier = occ; IDEExtensionsBuiltPriorToXcode12 = ( ); IDEFileExtensionDisplayMode = 1; "IDEFileTemplateChooserAssistantSelectedTemplateName_iOS" = "Source/Header File"; "IDEFileTemplateChooserAssistantSelectedTemplateName_macOS" = "Source/Header File"; IDEFileTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.macosx"; IDEHasConvertedXcode3BuildPrefs = 1; IDEIndexDisable = 1; IDEIndexShowLog = 0; IDEKeyBindingCurrentPreferenceSet = "Default.idekeybindings"; IDEKeyBindingExcludedPreferenceSet = ( Default ); IDELastBreakpointActionClassName = IDESoundBreakpointAction; IDELogNavigatorGroupByKey = 0; IDEMaxParallelTestingWorkersMac = 0; IDEOpenQuicklyPreferSwiftGeneratedInterface = 0; "IDEOpenQuicklyWindowController.width" = 454; IDEProductsViewControllerSourceListSplitPosition = 215; IDEProfileActionSelectedTab = Info; IDEProvisioningTeamManagerLastSelectedTeamID = XXXXXXXXXX; IDEProvisioningTeams = { "my@email.com" = ( { isFreeProvisioningTeam = 1; teamID = XXXXXXXXXX; teamName = "Larry Moore (Personal Team)"; teamType = "Personal Team"; } ); }; IDEShowPrebuildLogs = 0; IDESoundBreakpointActionDefaultNameKey = Pop; IDESourceControlPreferencesVersion = 201; IDESuppressStandardArchitecturesUpgrade = 0; IDESuppressStopExecutionWarning = 1; IDESuppressStopExecutionWarningTarget = "IDESuppressStopExecutionWarningTargetValue_Stop"; IDESwiftPackageAdditionAssistantRecentlyUsedPackages = ( ); IDESwiftPackageCollectionsAddedDefaultCollectionsDVTToolsVersion = "Xcode 13.3.1"; IDETestActionSelectedTab = Info; IDETouchBarSimulatorIsVisible = 0; IDEUserWantsToEnableDeveloperSystemPolicyMode = 0; LastProcessNameAttachedTo = Riot; NSColorPanelMode = 1; NSColorPickerPreferredRGBEntryMode = 2; NSColorPickerSlidersDefaults = 1; NSNavPanelExpandedStateForSaveMode = 1; PBXNumberOfParallelBuildSubtasks = 10; PMPrintingExpandedStateForPrint2 = 0; PegasusMultipleCursorsEnabled = 1; ShowBuildOperationDuration = 1; Xcode3BuildSettingsEditorDisplayMode = 0; Xcode3BuildSettingsEditorMode = 0; Xcode3ProjectEditorSourceListVisible = 1; "Xcode3ProjectTemplateChooserAssistantSelectedTemplateName_iOS" = "Application/App"; "Xcode3ProjectTemplateChooserAssistantSelectedTemplateName_macOS" = "Application/App"; Xcode3ProjectTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.iphoneos"; "Xcode3TargetTemplateChooserAssistantSelectedTemplateName_iOS" = "Application/App"; "Xcode3TargetTemplateChooserAssistantSelectedTemplateName_macOS" = "Application/Command Line Tool"; Xcode3TargetTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.macosx"; } The only suspicious key is DVTTextAutoSuggestCompletions = 1; in this old config that might have stopped autocompletion.
Replies
2
Boosts
0
Views
2.0k
Activity
Jun ’22
Receiving this error 'EXC_BREAKPOINT (code=1, subcode=0x1051904b8)' when trying to use a PhotoPicker.
I'm going insane over this, I'm using Xcode 13 beta 6 on the M1 MacBook Air. Every time I pick an image, I receive this error message. At this point I don't know what I can do because the message is so vague. Please help me.     @Binding var image: UIImage          func makeUIViewController(context: Context) -> UIImagePickerController {         let imagePicker = UIImagePickerController()         imagePicker.delegate = context.coordinator         return imagePicker     }          func updateUIViewController(_ uiViewController: UIImagePickerController, context: Context) {              }          func makeCoordinator() -> Coordinator {         Coordinator(parent: self)     }          final class Coordinator: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate {                   var parent: PhotoPicker                  init(parent: PhotoPicker){             self.parent = parent         }                  func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {             if let image = info[.originalImage] as? UIImage {                 parent.image = image             }else{                              }             picker.dismiss(animated: true, completion: nil)         }     } }          @State private var isPresented: Bool = false     @State private var avatarImage = UIImage(systemName: "person") ?? UIImage()          var body: some View {         VStack {             Image(uiImage: avatarImage)                 .resizable()                 .scaledToFill()                 .frame(width: 150, height: 150)                 .clipShape(Circle())                 .padding()                 .onTapGesture {                     isPresented = true                 }                          Spacer()         }         .navigationTitle("Profile")         .sheet(isPresented: $isPresented) {             PhotoPicker(image: $avatarImage)         }     } }
Replies
4
Boosts
0
Views
5.4k
Activity
May ’22
Failed to produce diagnostic for expression; please submit a bug report
i did " // customslidebar.swift // chatbot // // Created by AndrewLee on 2022/05/04. // import SwiftUI enum Tab: String, CaseIterable {     case house     case message     case person     case gearshape } struct customslidebar: View {   @Binding var selectedTab: Tab   private var fillimage: String {     selectedTab.rawValue + ".fill"   }       var body: some View {     VStack {       HStack {         ForEach(Tab.allCases, id: .rawValue) { tab in           Spacer()           image(systemName: selectedTab == tab ? fillimage : tab.rawValue)           Spacer()                                 }       }       .frame(width: nil, height: 60)       .background(.thinMaterial)       .cornerRadius(10)       .padding()             }   } } struct customslidebar_Previews: PreviewProvider {   static var previews: some View {     customslidebar(selectedTab: .constant(.house))   } } this but it says Failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project
Replies
1
Boosts
0
Views
964
Activity
May ’22
Not sure why but my analytics data is not looking right. Please look this over and tell me if something is wrong.
photos are included please if anyone knows what this may be let me know. I really appreciate it thank you!
Replies
0
Boosts
0
Views
1.1k
Activity
May ’22
How many touches are supported by iphone 13 max pro
can't play fps game with 6 fingers
Replies
1
Boosts
0
Views
1k
Activity
May ’22
Integrating Fyber SKAdNetwork ID Auto Updater - Xcode
Hi I'm finding it really difficult to integrate this tool in my Xcode project. The Fyber SKAdNetwork ID auto-updater is a tool for publishers to integrate into their build system and manage SKAdnetwork IDs into their Info.plist with each build job automatically. This will allow them to keep the Info.plist file up to date, even if some partners make changes to their IDs. Here's the link to the instructions: https://developer.fyber.com/hc/en-us/articles/360015298038-SKAdNetwork-ID-Auto-Updater I have installed the tool using Terminal but the rest is very confusing to me as I am not very familiar with some of the instructions/commands I'm being asked to do. Any help would be greatly appreciated - thank you so much in advance :) Ermes
Replies
1
Boosts
0
Views
1.4k
Activity
May ’22
App auto-closes on launch
Hello. I have developed an app: Kedeo.es: https://apps.apple.com/us/app/kedeo-es/id1609942690 Use external libraries to connect to Google Firebase Auth and Notifications. Also use Storekit for in-app purchase. It works perfectly, and it has also passed the tests and is published in the store, however, my client says that there are between 20% and 40% of users who are automatically closed just by opening. Does anyone else have this bug? It doesn't happen to me, and that's why I can't get any log to know more about the problem. If anyone can help I'd appreciate it. Greetings.
Replies
4
Boosts
0
Views
1.8k
Activity
May ’22
"Failed to produce a diagnostic for expression; please file a bug report" error.
İ am getting "Failed to produce a diagnostic for expression; please file a bug report" error. import SwiftUI struct ContentView: View {     let lifeformanalyzer = Lifeformanalyzer()     @State var text = ""     @State var title = "Merhaba insan!"          var body: some View { ————> error is here         VStack {             Image(systemName: "face.smiling.fill")                 .imageScale(.large)                 .foregroundColor(.accentColor)                 .padding(.top, 50)             Text(title)                 .font(.largeTitle)                          Spacer()                          TextField("Birşey yazın", text: $text)                 .multilineTextAlignment(.center)                 .frame(width: 300)                          Spacer()                          Button("Gönder") {                 submit()             }                          Spacer()                      }                                   .padding()         .frame(maxWidth: .infinity, maxHeight: .infinity)         .background(Color(red: 0.024, green: 0.392, blue: 0.549))         .ignoresSafeArea()                  func submit() {                      }     var title = "Merhaba \(lifeformanalyzer.processLifeform(text: text))!"                       }                     } The other swift file Lifeformanalyzer: class Lifeformanalyzer {          func processLifeform(text: String) -> String{                  text.lowercased().contains("vak")         ? "ördek" : "insan"     } }
Replies
2
Boosts
0
Views
1k
Activity
Apr ’22
Xcode 13.2.1 - Simulator works, Preview doesn't
Curious to know if anyone understands why I'm getting the following error "Cannot preview in this file" - [appname] crashed" Running the code on my (wirelessly) attached iPhone XR works, but the in-Xcode Preview window doesn't. Here's the log produced by the Diagnostics option: <Well, I tried to attach the zip file created from the previews-diagnostics-##-## folder, but this text field wouldn't accept that file type. Is there a particular file within the folder that I should upload instead?> Here's the code from the ContentView file for my (very basic) project: import SwiftUI struct ContentView: View { @FocusState private var amountIsFocused: Bool @State private var checkAmount = 0.0 @State private var numberOfPeople = 0 @State private var tipPercentage = 0 let tipPercentages = [0, 10, 15, 20, 25] var totalPerPerson: Double { let peopleCount = Double(numberOfPeople + 2) let tipSelection = Double(tipPercentage) let tipValue = tipSelection / 100 * checkAmount let grandTotal = checkAmount + tipValue let amountPerPerson = grandTotal / peopleCount return amountPerPerson } var totalAmount: Double { let tipSelection = Double(tipPercentage) let tipValue = tipSelection / 100 * checkAmount let grandTotal = checkAmount + tipValue return grandTotal } var body: some View { NavigationView { Form { Section { TextField("Amount", value: $checkAmount, format: .currency(code: Locale.current.currencyCode ?? "USD")) .keyboardType(.decimalPad) .focused($amountIsFocused) Picker("Number of people", selection: $numberOfPeople) { ForEach(2 ..< 100) { Text("\($0) people") } } } Section { Picker("Tip percentage", selection: $tipPercentage) { ForEach(0 ..< 101) { Text($0, format: .percent) } } } header: { Text("Select tip percentage") } Section { Text("Grand total: \(totalAmount, format: .currency(code: Locale.current.currencyCode ?? "USD"))") } Section { Text(totalPerPerson, format: .currency(code: Locale.current.currencyCode ?? "USD")) } header: { Text("Amount per person") } .navigationTitle("WeSplit") .navigationBarTitleDisplayMode(.inline) } .toolbar { ToolbarItemGroup(placement: .keyboard) { Spacer() Button("Done") { amountIsFocused = false } } } } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
Replies
5
Boosts
0
Views
2k
Activity
Mar ’22
voiceover ile xcode kullanmak
merhaba. Ben körüm ve bir macbook kullanıcısıyım. Voiceover kullanıyorum. Kodlama yapmak istiyorum. Ama Voiceover ile nasıl xcode kullanılır bilmiyorum. Bu konu hakkında türkçe içerikler var mıdır? Nasıl erişebilirim? Teşekkürler.
Replies
1
Boosts
0
Views
850
Activity
Feb ’22
python grasshopper in Rhino crash
When I use python grasshopper in Rhino, it crashes like insane. Does anyone know the reason? I'm using the new mac book pro with M1 chip Translated Report (Full Report Below) Process: Rhinoceros [20538] Path: /Applications/Rhino 7.app/Contents/MacOS/Rhinoceros Identifier: com.mcneel.rhinoceros.7 Version: 7.12 (7.12.21313.06342) Code Type: X86-64 (Translated) Parent Process: launchd [1] User ID: 501 Date/Time: 2021-11-30 15:48:24.5855 -0500 OS Version: macOS 12.0.1 (21A559) Report Version: 12 Anonymous UUID: AC464397-1C9E-4BEB-4E85-83E599FD5779 Sleep/Wake UUID: AB02ED2A-4CB9-4E90-B21B-C8C7DF6FFAFC Time Awake Since Boot: 130000 seconds Time Since Wake: 9093 seconds System Integrity Protection: enabled Crashed Thread: 2 SGen worker Exception Type: EXC_CRASH (SIGSEGV) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: Rhinoceros [20538] Model: MacBookPro18,2, BootROM 7429.41.5, proc 10:8:2 processors, 64 GB, SMC Graphics: Apple M1 Max, Apple M1 Max, Built-In Display: Color LCD, 3456 x 2234 Retina, Main, MirrorOff, Online Memory Module: LPDDR5 AirPort: Wi-Fi, wl0: Sep 24 2021 15:49:44 version 20.10.853.23.8.7.106 FWID 01-78e271b2 Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports Network Service: Wi-Fi, AirPort, en0 USB Device: USB31Bus USB Device: USB31Bus USB Device: USB31Bus Thunderbolt Bus: MacBook Pro, Apple Inc. Thunderbolt Bus: MacBook Pro, Apple Inc. Thunderbolt Bus: MacBook Pro, Apple Inc.
Replies
1
Boosts
0
Views
1.3k
Activity
Dec ’21
MallocCheckHeap is stack address or symbol address ?
Target Platform: iphone xr XCode: 12.4 After setting "Enable Malloc Scribble" "Malloc Guard Edges" "Goard Malloc" in Diagnostics and "MallocCheckHeapEach=1" "MallocCheckHeapSleep=100" "MallocCheckHeapStart=100000" in Environment Variables Start up the app on iphone and I get the following information: xxxx(1394,0x16f933000) malloc: *** MallocCheckHeap: FAILED check at operation #7444968 Stack for last operation where the malloc check succeeded: 0x1aefaed70 0x1aefa2f94 0x112f20540 0x1e904e76c 0x1e905a5e8 0x1e9054bf4 0x1e9035fc0 0x1b5ec57c4 0x112f216c0 0x112f25000 0x112f24e7c 0x1b5ec5268 0x1b5ed1348 0x1b5ed0e40 0x1a0b103f8 0x1a0b0e9a4 0x1a07a751c 0x1a0aef310 0x1a07afb74 0x1a07b6d38 0x1a0b1511c 0x1a0b12b28 0x1a02c2cc8 0x1a02bbac4 0x1a02bc7b0 0x1a0336028 0x1a02bb3c0 0x1a0336b60 0x1a0335344 0x1a03354c0 0x112f1fbcc 0x112f216c0 0x112f29354 0x112f2a0f4 0x112f2b5e4 0x112f36644 0x1e901c804 0x1e902375c  (Use 'atos' for a symbolic stack) xxxx(1394,0x16f933000) malloc: *** Will sleep for 100 seconds to leave time to attach xxxx(1394,0x16f933000) malloc: *** check: incorrect tiny region 44, counter=28255155 *** invariant broken for tiny block 0x13628fea0 this msize=0 - size is too small xxxx(1394,0x16f933000) malloc: *** set a breakpoint in malloc_error_break to debug xxxx(1394,0x16f933000) malloc: *** sleeping to help debug Q.1 "Stack for last operation where the malloc check succeeded" means what ? Q.2 the address is 'stack address' ? e.g 0x1aefaed70. Following the hints "(Use 'atos' for a symbolic stack) ", I get nothing for 0x1aefaed70 $atos -o ./DerivedData/Build/Products/Debug-iphoneos/xxxx.app.dSYM/Contents/Resources/DWARF/xxxx -arch arm64 -l 0x10225c000 0x10225c000 0x0000000100000000 (in xxxx) $atos -o ./DerivedData/Build/Products/Debug-iphoneos/xxxx.app.dSYM/Contents/Resources/DWARF/xxxx -arch arm64 -l 0x10225c000 0x1aefaed70 0x1aefaed70 (nothing) 0x10225c000 is load adress getting from AppDelegate after app start up.   uint32_t numImages = _dyld_image_count();   for (uint32_t i = 0; i < numImages; i++) {     const struct mach_header *header = _dyld_get_image_header(i);     const char *name = _dyld_get_image_name(i);     const char *p = strrchr(name, '/');     if (p && (strcmp(p + 1, "xxxx") == 0 || strcmp(p + 1, "libXxx.dylib") == 0)) {       NSLog(@"module=%s, address=%p", p + 1, header);     }   }    ```
Replies
2
Boosts
0
Views
1.4k
Activity
Dec ’21
Wakeups diagnostics
Is it normal for an app to try and wake my phone up 45,000 times over less than 300 seconds
Replies
1
Boosts
0
Views
775
Activity
Nov ’21
Enable Malloc Scribble 0x55 0xAA change it ?
Following the page MallocDebug After Enable Malloc Scribble, free buffer will be set to 0x55, malloc buffer will be set to 0xAA. would I change 0x55 and 0xAA to another value ? e.g 0xFF ?
Replies
2
Boosts
0
Views
1.7k
Activity
Nov ’21
Screen time at 100%
Just yesterday a new app that is not searchable or on my phone started showing 100% usage, advisors.technologyadvise.com any insight as to what this could be?
Replies
1
Boosts
0
Views
1.4k
Activity
Nov ’21
panic(cpu 1 caller 0xffffff80227fea25): userspace watchdog timeout: no successful checkins from com.apple.WindowServer
This happens more or less every 2nd day early in the morning when I try to start, the system was rebooted. Any idea how to fix this ? iMac Modellname: iMac  Modell-Identifizierung: iMac15,1  Prozessortyp: Quad-Core Intel Core i5  Prozessorgeschwindigkeit: 3.5 GHz  Anzahl der Prozessoren: 1  Gesamtanzahl der Kerne: 4  L2-Cache (pro Kern): 256 KB  L3-Cache: 6 MB  Speicher: 32 GB  Systemfirmwareversion: 431.140.6.0.0  SMC-Version (System): 2.22f16  **panic(cpu** 1 caller 0xffffff80227fea25): userspace watchdog timeout: no successful checkins from com.apple.WindowServer in 120 seconds service: com.apple.logd, total successful checkins since wake (1430 seconds ago): 144, last successful checkin: 0 seconds ago service: com.apple.WindowServer, total successful checkins since wake (1430 seconds ago): 132, last successful checkin: 120 seconds ago Backtrace (CPU 1), Frame : Return Address 0xffffffa0bce43670 : 0xffffff801f48cfdd 0xffffffa0bce436c0 : 0xffffff801f5d3fd3 0xffffffa0bce43700 : 0xffffff801f5c45ca 0xffffffa0bce43750 : 0xffffff801f431a2f 0xffffffa0bce43770 : 0xffffff801f48c7fd 0xffffffa0bce43890 : 0xffffff801f48caf3 0xffffffa0bce43900 : 0xffffff801fc9ce34 0xffffffa0bce43970 : 0xffffff80227fea25 0xffffffa0bce43980 : 0xffffff80227fe660 0xffffffa0bce439a0 : 0xffffff801fc1d67e 0xffffffa0bce439f0 : 0xffffff80227fda34 0xffffffa0bce43b20 : 0xffffff801fc2792b 0xffffffa0bce43c80 : 0xffffff801f57f7d1 0xffffffa0bce43d90 : 0xffffff801f49265d 0xffffffa0bce43e00 : 0xffffff801f468cd5 0xffffffa0bce43e60 : 0xffffff801f4801e2 0xffffffa0bce43ef0 : 0xffffff801f5a869d 0xffffffa0bce43fa0 : 0xffffff801f432216 Kernel Extensions in backtrace: com.apple.driver.watchdog(1.0)[4CFADD2A-613E-320D-AD14-9C9379E87CB7]@0xffffff80227fc000->0xffffff80227fefff Process name corresponding to current thread: watchdogd Mac OS version: 20G165 Kernel version: Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 Kernel UUID: C2591F4E-EE82-33CC-8C59-DB81D9AD80DD KernelCache slide: 0x000000001f200000 KernelCache base: 0xffffff801f400000 Kernel slide: 0x000000001f210000 Kernel text base: 0xffffff801f410000 __HIB text base: 0xffffff801f300000 System model name: iMac15,1 (Mac-42FD25EABCABB274) System shutdown begun: NO Panic diags file available: NO (0xe00002bc) Hibernation exit count: 0 System uptime in nanoseconds: 54871209471415 Last Sleep: absolute base_tsc base_nano Uptime : 0x000031e7b2f2f0c4 Sleep : 0x0000309891fa771f 0x00000000435d4b0d 0x00002e03047989b5 Wake : 0x000030989950595c 0x00000000433523b2 0x0000309898b759e9 last started kext at 50615930221912: @filesystems.smbfs 3.6.1 (addr 0xffffff7fbad40000, size 491520) last stopped kext at 271735750053: >!AFIVRDriver 4.1.0 (addr 0xffffff7fb8a51000, size 8192) loaded kexts: org.virtualbox.kext.VBoxNetAdp 6.1.18 org.virtualbox.kext.VBoxNetFlt 6.1.18 org.virtualbox.kext.VBoxUSB 6.1.18 org.virtualbox.kext.VBoxDrv 6.1.18 com.paragon-software.filesystems.ntfs 108.8.15 com.disc-soft.DAEMONTools.VirtualSCSIBus 1.0.2 @filesystems.smbfs 3.6.1 @fileutil 20.036.15ATfilesystems.autofs 3.0 !ATopCaseHIDEventDriver 4050.1 !A!BMultitouch 99 AudioAUUC 1.70 AGPM 122.1 !APlatformEnabler 2.7.0d0 X86PlatformShim 1.0.0 !AMikeyHIDDriver 131 !AUpstreamUserClient 3.6.8 @kext.AMDFramebuffer 4.0.6 !AMikeyDriver 283.15ATkext.AMDRadeonX4000 4.0.6 @kext.AMDRadeonServiceManager 4.0.6 !AGraphicsDevicePolicy 6.3.5 @AGDCPluginDisplayMetrics 6.3.5pmtelemetry 1 |IOUserEthernet 1.0.1 !AHDA 283.15 usb.!UUserHCI 1 |IO!BSerialManager 8.0.5d7 @Dont_Steal_Mac_OS_X 7.0.0 !AHV 1 !ADiskImages2 1 !A!IHD5000Graphics 16.0.5 !AThunderboltIP 4.0.3 !AMCCSControl 1.14 !A!IFramebufferAzul 16.0.5 eficheck 1 !ALPC 3.1 !ASMCLMU 212 @kext.AMD7000!C 4.0.6 !A!ISlowAdaptiveClocking 4.0.0 |IO!BUSBDFU 8.0.5d7 |SCSITaskUserClient 436.140.1 !AFileSystemDriver 3.0.1 @filesystems.tmpfs 1 @filesystems.hfs.kext 556.100.11 @BootCache 40 @!AFSCompression.!AFSCompressionTypeZlib 1.0.0 @!AFSCompression.!AFSCompressionTypeDataless 1.0.0d1 @filesystems.apfs 1677.141.2 AirPort.BrcmNIC 1400.1.1 !ASDXC 1.9.0ATprivate.KextAudit 1.0 |!ABCM5701Ethernet 11.0.0 !AAHCIPort 346.100.2 !ARTC 2.0 !AACPIButtons 6.1 !AHPET 1.8 !ASMBIOS 2.1 !AACPIEC 6.1 !AAPIC 1.7 @!ASystemPolicy 2.0.0 @nke.applicationfirewall 311 |IOKitRegistryCompatibility 1 |EndpointSecurity 1 |IOUSBUserClient 900.4.2Aplugin.IOAVBDiscoveryPlugin 940.4 @kext.triggers 1.0 !AHIDKeyboard 224 !AHS!BDriver 4050.1 IO!BHIDDriver 8.0.5d7 !AMultitouchDriver 4440.3 !AInputDeviceSupport 4400.35 @kext.AMDRadeonX4030HWLibs 1.0 @kext.AMDRadeonX4000HWServices 4.0.6 !AGraphicsControl 6.3.5 DspFuncLib 283.15 @kext.OSvKernDSPLib 529 |IOSerial!F 11 |IOAVB!F 940.4 |IOEthernetAVB!C 1.1.0 usb.IOUSBHostHIDDevice 1.2 !AThunderboltEDMSink 5.0.3 !ASMBus!C 1.0.18d1 |IOAccelerator!F2 442.9 |IONDRVSupport 585.1 X86PlatformPlugin 1.0.0 !AHDA!C 283.15|IOHDA!F 283.15 !ASMBusPCI 1.0.14d1 IOPlatformPlugin!F 6.0.0d8 !UAudio 405.39 |IOAudio!F 300.6.1 @vecLib.kext 1.2.0 @kext.AMDSupport 4.0.6 @!AGPUWrangler 6.3.5 @!AGraphicsDeviceControl 6.3.5 |IOGraphics!F 585.1 |IOSlowAdaptiveClocking!F 1.0.0 @plugin.IOgPTPPlugin 985.2 |Broadcom!BHost!CUSBTransport 8.0.5d7 |IO!BHost!CUSBTransport 8.0.5d7 |IO!BHost!CTransport 8.0.5d7 usb.cdc 5.0.0 usb.networking 5.0.0 usb.!UHostCompositeDevice 1.2 usb.!UHub 1.2 !AThunderboltDPOutAdapter 8.1.4 !AThunderboltDPInAdapter 8.1.4 !AThunderboltDPAdapter!F 8.1.4 !AThunderboltPCIDownAdapter 4.1.1 !ABSDKextStarter 3 |IOSurface 290.8.1 @filesystems.hfs.encodings.kext 1 !AXsanScheme 3 |IOAHCIBlock!S 332 !AThunderboltNHI 7.2.8 |IOThunderbolt!F 9.3.2 usb.!UHostPacketFilter 1.0 |IOUSB!F 900.4.2 |IO80211!F 1200.12.2b1 |IOSkywalk!F 1 corecapture 1.0.4 mDNSOffloadUserClient 1.0.1b8 usb.!UXHCIPCI 1.2 usb.!UXHCI 1.2 |IOAHCI!F 294.100.1 !A!ILpssGspi 3.0.60 !AEFINVRAM 2.1 !AEFIRuntime 2.1|IOSMBus!F 1.1 |IOHID!F 2.0.0 $!AImage4 3.0.0 |IOTimeSync!F 985.2 |IONetworking!F 3.4 DiskImages 493.0.0 |IO!B!F 8.0.5d7 |IOReport!F 47 |IO!BPacketLogger 8.0.5d7 $quarantine 4 $sandbox 300.0 @kext.!AMatch 1.0.0d1 |CoreAnalytics!F 1 !ASSE 1.0 !AKeyStore 2 !UTDM 511.141.1|IOUSBMass!SDriver 184.140.2 |IOSCSIBlockCommandsDevice 436.140.1 |IO!S!F 2.1 |IOSCSIArchitectureModel!F 436.140.1 !AMobileFileIntegrity 1.0.5 @kext.CoreTrust 1 !AFDEKeyStore 28.30 !AEffaceable!S 1.0 !ACredentialManager 1.0 KernelRelayHost 1 |IOUSBHost!F 1.2!UHostMergeProperties 1.2 usb.!UCommon 1.0 !ABusPower!C 1.0 !ASEPManager 1.0.1 IOSlaveProcessor 1 !AACPIPlatform 6.1 !ASMC 3.1.9 |IOPCI!F 2.9 |IOACPI!F 1.4 watchdog 1 @kec.pthread 1 @kec.corecrypto 11.1 @kec.Libm 1 —T
Replies
0
Boosts
0
Views
2.7k
Activity
Oct ’21