Objective-C Runtime

RSS for tag

The Objective-C runtime is a runtime library that supports the dynamic properties of the Objective-C language.

Posts under Objective-C Runtime tag

25 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Xcode 15 Beta 6 objc @try @catch runtime error
I was migrating from Xcode 14 -> 15, and noticed that my code was failing with dyld[46534]: Symbol not found: _OBJC_CLASS_$_NSError I was able to debug the problem to some old objective c code, as documented in this thread: https://github.com/RonRadtke/react-native-blob-util/issues/273 The error seems to stem from this particular try catch block @try { // Some code } @catch(NSError *er) { // handle error } When I convert the code to catch an NSException instead, the runtime error goes away. Understandably, according to the apple docs, it should be throwing an NSException in the first place, but the documents do say Important: Although you can throw and catch objects other than NSException objects, the Cocoa frameworks themselves might only catch NSException objects for some conditions. So if you throw other types of objects, the Cocoa handlers for that exception might not run, with undefined results. (Conversely, non-NSException objects that you throw could be caught by some Cocoa handlers.) For these reasons, it is recommended that you throw NSException objects only, while being prepared to catch exception objects of all types. So it seems like this should not have produced a runtime error. I wanted to flag this in case the underlying code behind the @try @catch changed unintentionally.
4
0
1.8k
Oct ’23
iOS 17 Beta app crash when using [obj valueForKey:@"copy"]
I ran across the following crash while using one of our apps. The app crashes since the recent iOS 17 beta builds. The code crashes when using valueForKey on an NSArray with objects that implement NSCopying. like: [@[[Sample new]] valueForKey:@"copy"]; or: [[Sample new] valueForKey:@"copy"]; header: @interface Sample : NSObject<NSCopying> - (Sample *)copy; - (Sample *)copyWithZone:(nullable NSZone *)zone; @end implementation: @implementation Sample - (Sample *)copy { return [super copy]; } - (Sample *)copyWithZone:(nullable NSZone *)zone { return self; } @end Any idea why this might be happening? I have created a feedback too: FB12819891
4
0
1.4k
Aug ’23
The application crashes in the App Store when launch on iPhone with iOS 15.3.1.
My application is currently crashing in production in iPhone devices running iOS 15.x. The app will work as normal while running developer mode, enterprise builds and Test Flight builds. Unfortunately, I am unable to reproduce this issue even app is downloaded from the app store. I observed crash is happening at main.m. Can someone help me to reproduce this issue? How to read this crash log file? Please find the crash log details attached. 2022-03-04_14-15-23.6227_+0900-a1899fd803a4ed683466702be71b9d224b4cd5bc.crash
3
1
2.4k
3w
Errors running with ASAN when targeting iOS Devices
I'm unable to run my app with ASAN enabled when targeting a physical iOS device. Simulator targets do work. With Xcode 12 and an iPad mini 4 running iOS 14 beta 1 I get the following error during app launch ==750==ERROR: AddressSanitizer failed to allocate 0xffffffffff9fc000 (-6307840) bytes at address 2db624000 (errno: 22) ==750==ReserveShadowMemoryRange failed while trying to map 0xffffffffff9fc000 bytes. Perhaps you're using ulimit -v With Xcode 11.5 and an iPad Air 2 running OS 12.4.1 the error is ==2177==Unable to find a memory range after restricting VM. ==2177==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clangcompilerrt/clang-1103.0.32.62/compiler-rt/lib/asan/asanmac.cc:92 "((0 &amp;amp;&amp;amp; "cannot place shadow after restricting vm")) != (0)" (0x0, 0x0) &amp;lt;empty stack&amp;gt;==2177==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clangcompilerrt/clang-1103.0.32.62/compiler-rt/lib/asan/../sanitizercommon/sanitizermallocmac.inc:143 "((!asaninitisrunning)) != (0)" (0x0, 0x0) warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available. AddressSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report. (lldb) thread info -s thread #1: tid = 0x1076c2, 0x000000011531e984 libclangrt.asaniosdynamic.dylib`__asan::AsanDie() My coworker is able to use ASAN with the same App using iPad Pro 10.5, iPadOS 13.5.1, Xcode 11.5 Are there any configuration changes I need to make to be able to use ASAN on my devices?
10
1
7.2k
May ’24