Objective-C

Objective-C is a programming language for writing iOS, iPad OS, and macOS apps.

Posts under Objective-C tag

114 results found
Post marked as unsolved
99 Views

Call to AXIsProcessTrustedWithOptions does not work after change setting manually

Hello all I am testing accessibility permissions using AXIsProcessTrustedWithOptions When app starts value is correctly returned. However if I change the setting in System Preferences -> Security &amp; Privacy while app is running call to API is still returning the previous value. Is that bug? Here is example code: bool checkIfAccessibilityEnabledAndDisplayPopup() {   // Method to check if accessibility is enabled   // Passing YES to kAXTrustedCheckOptionPrompt forces showing popup   NSDictionary *options = @{(__bridge id)kAXTrustedCheckOptionPrompt: @YES};   Boolean accessibilityEnabled = AXIsProcessTrustedWithOptions((CFDictionaryRef)options);   return (!!accessibilityEnabled); } int main(int argc, const char * argv[]) {   @autoreleasepool {     NSLog(@"Starting");     for (int i=0;i<100;++i) {        checkIfAccessibilityEnabledAndDisplayPopup();        [NSThread sleepForTimeInterval:20.0f];        NSDictionary *options = @{(__bridge id)kAXTrustedCheckOptionPrompt: @NO};        Boolean b = AXIsProcessTrustedWithOptions((CFDictionaryRef)options);        Boolean b1 = AXIsProcessTrusted();        NSLog(@"accessibility AXIsProcessTrustedWithOptions--> %d AXIsProcessTrusted ---> %d", b, b1);     } }
Asked
by Rulovic.
Last updated .
Post marked as unsolved
11 Views

About notification of application launch and registration to "LaunchDaemons"

I've created an app that uses "NSNotificationCenter" to get app launch notifications. I registered it in LaunchDaemons and started it when macOS started, but I cannot get the notification. We have confirmed that the application has started up from the log and ps command. I was able to get notifications when I debug in Xcode or launch the app directly. Is it possible to get notifications by launching from LaunchDaemon?
Asked
by TSawano.
Last updated .
Post marked as unsolved
18 Views

my app crash in second launch on iOS 13 and above

my app crash in second launch on iOS 13 and above Need help take a look the log : 2020-08-04 14:33:45.464576+0000 ExMessager[13501:1547907] CFURLSetResourcePropertyForKey failed because it was passed an URL which has no scheme 2020-08-04 14:33:45.695751+0000 ExMessager[13501:1548827] [CoreBluetooth] XPC connection invalid 2020-08-04 14:33:45.842033+0000 ExMessager[13501:1548811] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.} 2020-08-04 14:33:45.842033+0000 ExMessager[13501:1548827] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.} 2020-08-04 14:33:45.842313+0000 ExMessager[13501:1548811] [Client] Updating selectors after delegate addition failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.} 2020-08-04 14:33:45.844058+0000 ExMessager[13501:1548827] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.} 2020-08-04 14:33:45.844129+0000 ExMessager[13501:1548811] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.} 2020-08-04 14:33:45.845094+0000 ExMessager[13501:1548827] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.} 2020-08-04 14:33:45.845355+0000 ExMessager[13501:1548811] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.} 2020-08-04 14:33:46.068121+0000 ExMessager[13501:1547907] [plugin] AddInstanceForFactory: No factory registered for id &lt;CFUUID 0x600001900100&gt; F8BB1C28-BAE8-11D6-9C31-00039315CD46 2020-08-04 14:33:46.104115+0000 ExMessager[13501:1547907] viewWillAppear 2020-08-04 14:33:50.974105+0000 ExMessager[13501:1548687] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.} 2020-08-04 14:33:50.977251+0000 ExMessager[13501:1548910] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.} 2020-08-04 14:33:50.981911+0000 ExMessager[13501:1548687] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.} 2020-08-04 14:33:50.989947+0000 ExMessager[13501:1548910] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.} 2020-08-04 14:33:50.992180+0000 ExMessager[13501:1548687] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.} 2020-08-04 14:33:50.993119+0000 ExMessager[13501:1548910] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
Asked
Last updated .
Post marked as unsolved
15k Views

What is the future of Objective-C?

Will Apple continue to support it, or will we wake up one day to find that Swift is the only viable language?It's a serious question. Careers depend on it. I don't accept the "No comment" approach that Apple usually takes. It's cruel.I'm willing to put the time into learning Swift if I have to. I'm not going to do it if I don't. I want to know.Frank
Asked
by flarosa.
Last updated .
Post marked as unsolved
18 Views

How to convert items of NSArray to UTF-16 (char16_t)?

I have a function that gets all contents of directory whether files or directories and I am using contentsOfDirectoryAtPath to collect the content of a directory then I save the names of files/directories into a container called contentsStore which accepts key&amp;value items of UTF-16 string char16_t. look at the following code to make your vision clear: NSArray *dirContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:_dirPath error:nil]; for(unsigned int i= 0; i< [dirContents count]; i++){ &#9;&#9;if(isDir){ &#9;&#9;&#9;&#9;// `contentsStore` is key&amp;value container that accepts utf-16 string (char16_t) &#9;&#9;&#9;&#9;contentsStore.Add([[dirContents objectAtIndex:i] UTF8String], "directory"); &#9;&#9;} else { &#9;&#9;&#9;&#9;contentsStore.Add([[dirContents objectAtIndex:i] UTF8String], "file"); &#9;&#9;} } Note that I don't post the entire code because it's big but I just added the important parts that related to the problem. Also, I am using Objective-Cpp just as a bridge to achieve my goal to use Cocoa in mac OS but the main language that I use is Cpp , so, the entire code is a combination of Cpp/Objective-Cpp . How to make the objectAtIndex method to output the item's content as UTF-16 char16_t?
Asked
by prmigo.
Last updated .
Post marked as solved
151 Views

cannot find type 'ConfigurationIntent' in scope

In the OC project, iOS14 WidgetKit target was added, but consistent error Cannot find type "ConfigurationIntent" in scope, type 'Provider' does not conform to protocol 'IntentTimelineProvider' What is strange is that after adding a new OC project, the compilation is successful, Tool: Xcode12-beta &amp; Simulator How to get access to old projects?
Asked
by zhangkk.
Last updated .
Post marked as solved
1.2k Views

'sharedApplication' is unavailable: not available iOS (App Extension)

My app has been running good 20mins ago.But when I build it again just after I removed and updated some pods, my app could not complied rightly.It raise some errors like:1. 'sharedApplication' is unavailable: not available iOS (App Extension)2. UIActionSheet 'initWithTitle:delegate:cancelButtonTitle:destructiveButtonTitle:otherButtonTitles:' is unavailable: not avaliable on iosbut I did not change anything about app settingThen I rebuild my history code, which was days or months ago, it raised the same error.Confused.Need help.Thanks for all attentions.
Asked
by wakary.
Last updated .
Post marked as unsolved
20 Views

Open NSAlert in a Smart Card Extension

Hi, I would like to know if its possible to open an NSAlert or some kind of customized window to ask for pin in a smartcard extension in macos. I'm developing an cryptotoken kit smartcard extension and i would like to open a customized pin window to ask the pin or OTP for a user. But when i try to open a simple nsalert, the console informs me the following error: NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!' To this simple code: NSAlert* msgBox1 = [[NSAlert alloc] init];       [msgBox1 setMessageText: @"Welcome !"];   [msgBox1 addButtonWithTitle : @"OK"];   [msgBox1 runModal]; This is in the tokensession.m, signData method.
Asked
Last updated .
Post marked as unsolved
61 Views

Obtaining CPU usage by process

Hi there, I'm working on an app that contains a mini system monitoring utility. I would like to list the top CPU-using processes. As Quinn “The Eskimo!” has repeatedly cautioned, relying on private frameworks is just begging for maintenance effort in the future. Ideally, I want to go through public headers/frameworks. I've gone to great lengths to try to find this information myself, and at this point I'm just struggling. I detail my research below. Any pointers in the right direction would be much appreciated! Attempts Libproc First I looked at libproc. Using proc_pidinfo with PROC_PIDTHREADINFO, I'm able to get each thread of an app, with its associated CPU usage percentage. Summing these, I could get the total for an app. Unfortunately, this has two downsides: Listing a table of processes now takes O(proces_count) rather than just O(process_count), and causes way more syscalls to be made It doesn't work for processes owned by other users. Perhaps running as root could alleviate that, but that would involve making a priviliedged helper akin to the existing sysmond that Activity Monitor.app uses. I'm a little scared of that, because I don't want to put my users at risk. Sysctl Using the keys [CTL_KERN, KERN_PROC, KERN_PROC_PID, someProcessID], I'm able to get a kinfo_proc - https://github.com/apple-opensource/xnu/blob/24525736ba5b8a67ce3a8a017ced469abe101ad5/bsd/sys/sysctl.h#L750-L776 instance. Accessing its .kp_proc - https://github.com/apple-opensource/xnu/blob/24525736ba5b8a67ce3a8a017ced469abe101ad5/bsd/sys/proc.h#L96-L150.p_pctcpu - https://github.com/apple-opensource/xnu/blob/24525736ba5b8a67ce3a8a017ced469abe101ad5/bsd/sys/proc.h#L123 looked really promising, but that value is always zero. Digging deeper, I found the kernel code that fills this struct in (fill_user64_externproc - https://github.com/apple-opensource/xnu/blob/c76cff20e09b8d61688d1c3dfb8cc855cccb93ad/bsd/kern/kern_sysctl.c#L1121-L1168). The assignment of p_pctcpu - https://github.com/apple-opensource/xnu/blob/c76cff20e09b8d61688d1c3dfb8cc855cccb93ad/bsd/kern/kern_sysctl.c#L1149 is in a conditional region, relying on the _PROC_HAS_SCHEDINFO_ flag. Disassembling the kernel on my mac, I could confirm that the assignment of that field never happens (thus _PROC_HAS_SCHEDINFO_ wasn't set during compilation, and the value will always stay zero) Reverse engineering Activity Monitor.app Activity Monitor.app makes proc_info and sysctl system calls, but from looking at the disassembly, it doesn't look like that's where its CPU figures come from. From what I can tell, it's using private functions from /usr/lib/libsysmon.dylib. That's a user library which wraps an XPC connection to sysmond (/usr/libexec/sysmond), allowing you to create requests (sysmon_request_create), add specific attributes you want to retrieve (sysmon_request_add_attribute), and then functions to query that data out (sysmon_row_get_value). Getting the data "striaght from the horses mouth" like this sounds ideal. But unfortunately, the only documentation/usage I can find of sysmond is from bug databases demonstrating a privilege escalation vulnerability lol. There are some partial reverse engineered header files floating around, but they're incomplete, and have the usual fragility/upkeep issues associated with using private APIs. On one hand, I don't want to depend on a private API, because that takes a lot of time to reverse engineer, keep up with changes, etc. On the other, making my own similar privileged helper would be duplicating effort, and expose a bigger attack surface. Needless to say, I have no confidence in being able to make a safer privileged helper than Apple's engineers lol Reverse engineering iStat Menus Looks like they're using proc_pid_rusage - https://github.com/apple-opensource/xnu/blob/24525736ba5b8a67ce3a8a017ced469abe101ad5/libsyscall/wrappers/libproc/libproc.h#L103-L108 . However, I don't know how to convert the cpu_*_time fields of the resulting struct rusage_info_v4 - https://github.com/apple-opensource/xnu/blob/24525736ba5b8a67ce3a8a017ced469abe101ad5/bsd/sys/resource.h#L306-L343 to compute a "simple" percentage. Even if I came up with some formula that produces plausible looking results, I have no real guarantee it's correct or equivalent to what Activity Monitor shows.
Asked
Last updated .
Post marked as unsolved
96 Views

Mac app(ProcessMonitor) crashing with EXC_CRASH (Code Signature Invalid)

When I build and run the source code of "ProcessMonitor", I get the following error. Certificate and provisioning profiles are created for this app. The results will not change even if you download and execute the notarized app. Please tell me how to run the app. ProcessMonitor: objective-see - products utilities - ProcessMonitor Exception Type:       EXCCRASH (Code Signature Invalid) Exception Codes:    0x0000000000000000, 0x0000000000000000 Exception Note:      EXCCORPSE_NOTIFY Termination Reason:  Namespace CODESIGNING, Code 0x1 XCode:11.5(11E608c) MacOS:10.15.5(19F101)
Asked
by TSawano.
Last updated .
Post marked as unsolved
18 Views

UIPrintInteractionController crashed in iOS 14

When presented in a standalone single view application the following code works a treat. But when I try to load the same code on UISplitViewController the application crashed,But this code works like a charm in iOS 13 application.But In iOS 14 it is going to crash and following exception occur: Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:&amp;lt;UIPrintPreviewViewController: 0x10394fa00&amp;gt; should have parent view controller:&amp;lt;CXSTransactionSelectionViewController: 0x10389e400&amp;gt; but actual parent is:&amp;lt;UIPrintPanelTableViewController: 0x103808200&amp;gt;' (UIViewController *)printInteractionControllerParentViewController: (UIPrintInteractionController *)printInteractionController { return [CXSCommon getParentController_iPhone]; } (void)Print { UIPrintInteractionController *controller = [UIPrintInteractionController&amp;#9; sharedPrintController]; &amp;#9;&amp;#9; if(!controller){ &amp;#9;&amp;#9;&amp;#9;&amp;#9; NSLog(@"Couldn't get shared UIPrintInteractionController!"); &amp;#9;&amp;#9;&amp;#9;&amp;#9; return; &amp;#9;&amp;#9; } &amp;#9;&amp;#9; &amp;#9;&amp;#9; UIPrintInteractionCompletionHandler completionHandler = &amp;#9;&amp;#9; ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) { &amp;#9;&amp;#9;&amp;#9;&amp;#9; if(!completed &amp;amp;&amp;amp; error){ &amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9; NSLog(@"FAILED! due to error in domain %@ with error code %ld", error.domain, (long)error.code); &amp;#9;&amp;#9;&amp;#9;&amp;#9; } &amp;#9;&amp;#9;&amp;#9;&amp;#9; else &amp;#9;&amp;#9;&amp;#9;&amp;#9; { &amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9; NSLog(@"complete"); &amp;#9;&amp;#9;&amp;#9;&amp;#9; } &amp;#9;&amp;#9; }; &amp;#9;&amp;#9; UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController]; &amp;#9;&amp;#9; pic.delegate&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;= self; &amp;#9;&amp;#9; UIPrintInfo *printInfo&amp;#9;= [UIPrintInfo printInfo]; &amp;#9;&amp;#9; printInfo.outputType&amp;#9;&amp;#9;= UIPrintInfoOutputGeneral; &amp;#9;&amp;#9; printInfo.jobName&amp;#9;&amp;#9;&amp;#9; = @"My Job"; &amp;#9;&amp;#9; printInfo.duplex&amp;#9;&amp;#9;&amp;#9;&amp;#9;= UIPrintInfoDuplexLongEdge; &amp;#9;&amp;#9; pic.printInfo&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9; = printInfo; &amp;#9;&amp;#9; &amp;#9;&amp;#9; UIMarkupTextPrintFormatter *textPrint = [[UIMarkupTextPrintFormatter alloc] initWithMarkupText:[NSString stringWithFormat:@"&amp;lt;!DOCTYPE html&amp;gt;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;p&amp;gt;&amp;lt;h1&amp;gt;Hello World&amp;lt;/h1&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;h2&amp;gt;Hello World&amp;lt;/h2&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;h3&amp;gt;Hello World&amp;lt;/h3&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;h4&amp;gt;Hello World&amp;lt;/h4&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;h5&amp;gt;Hello World&amp;lt;/h5&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;h6&amp;gt;Hello World&amp;lt;/h6&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;"]]; &amp;#9;&amp;#9; pic.printFormatter = textPrint; &amp;#9;&amp;#9; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { &amp;#9;&amp;#9;&amp;#9;&amp;#9;// [controller presentFromBarButtonItem:self.addressButton animated:YES completionHandler:completionHandler]; &amp;#9;&amp;#9;&amp;#9;&amp;#9; &amp;#9;&amp;#9;&amp;#9;&amp;#9; [controller presentAnimated:YES completionHandler:completionHandler]; &amp;#9;&amp;#9; } &amp;#9;&amp;#9; else { &amp;#9;&amp;#9;&amp;#9;&amp;#9; [controller presentAnimated:YES completionHandler:completionHandler]; &amp;#9;&amp;#9; } }
Asked
Last updated .
Post marked as unsolved
99 Views

Can an Objective-C implementation be defined in a header file and also be imported by multiple source files?

I have a header file that defines the interface and implementation of an Objective-C class. Person.h #ifndef Person_h #define Person_h @interface Person : NSObject(void)speak; @end @implementation Person(void)speak { &#9;&#9;// Say something } @end #endif /* Person_h */ I also have two source files that both include the header file. Main.mm @import Foundation; #import "Person.h" int main(int argc, const char * argv[]) { &#9;&#9;// Do nothing } Test.mm @import Foundation; #import "Person.h" When the project is built, I get duplicate symbol errors. duplicate symbol '_OBJC_CLASS_$_Person' in: &#9;&#9;/Debug/TestBox.build/Objects-normal/x86_64/main.o &#9;&#9;/Debug/TestBox.build/Objects-normal/x86_64/test.o duplicate symbol '_OBJC_METACLASS_$_Person' in: &#9;&#9;/Debug/TestBox.build/Objects-normal/x86_64/main.o &#9;&#9;/Debug/TestBox.build/Objects-normal/x86_64/test.o ld: 2 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) I want to be able to include the same header file in multiple source files. In C++, I can inline the implementation into the header file like this: #ifndef Person_h #define Person_h class Person { public: &#9;&#9;void speak() { // Say something } }; #endif /* Person_h */ However, I haven't been able to find a way to do that with Objective-C. I'm using Objective-C so I can subclass events from NSWindowDelegate and NSResponder. I tried searching for solutions. Most of them said to separate the implementation into a source file, but that would break the single-header architecture. One suggestion is to use the Objective-C runtime library - https://developer.apple.com/documentation/objectivec/objective-c_runtime and create my classes at runtime. This appears to give me the results I'm looking for, but I'm wondering if there is a simpler way. Is there some way to implement an Objective-C class in a header file so that can be included by multiple source files? Or is dynamically creating the classes at runtime my best option?
Asked
by ahzeee.
Last updated .
Post marked as unsolved
34 Views

Collection view bulk animation crash

Hi, we are experiencing an issue with the latest BETA of iOS 14 (BETA 2). In our app we make use of a collection view and perform animations to move/insert/delete cells int eh collection view. Since iOS 14 our app is experiencing severe crashes when performing such updates. Here is the relevant part of code: NSMutableArray&amp;lt;NSIndexPath *&amp;gt; *toInsert = [NSMutableArray new]; NSMutableArray&amp;lt;NSIndexPath *&amp;gt; *toRemove = [NSMutableArray new]; NSMutableArray&amp;lt;NSIndexPath *&amp;gt; *toMoveFrom = [NSMutableArray new]; NSMutableArray&amp;lt;NSIndexPath *&amp;gt; *toMoveTo = [NSMutableArray new]; /* FILL THE ARRAYS */ [self.collectionView performBatchUpdates:^{ /* &lt;-- CRASH HERE */ &amp;#9;&amp;#9;if (toInsert.count &gt; 0) &amp;#9;&amp;#9;&amp;#9;&amp;#9;[self.collectionView insertItemsAtIndexPaths:toInsert]; &amp;#9;&amp;#9;if (toRemove.count &gt; 0) &amp;#9;&amp;#9;&amp;#9;&amp;#9;[self.collectionView deleteItemsAtIndexPaths:toRemove]; &amp;#9;&amp;#9;if (toMoveFrom.count &gt; 0 &amp;amp;&amp;amp; toMoveFrom.count == toMoveTo.count) { &amp;#9;&amp;#9;&amp;#9;&amp;#9;for (NSInteger i = 0; i &lt; toMoveFrom.count; i++) { &amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;[self.collectionView moveItemAtIndexPath:toMoveFrom[i] toIndexPath:toMoveTo[i]]; &amp;#9;&amp;#9;&amp;#9;&amp;#9;} &amp;#9;&amp;#9;} } completion:nil]; And the crash: Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000008e70aa1b0 We monitor our crash reports with Firebase and it's reported that the crashes happen only on iOS 14 devices. We also received feedback from our BETA testers through TestFlight reporting the same issue. Any advice?
Asked
Last updated .