Character not found: _objc_retainAutoreleasedReturnValue works with compiled ARC code on iOS 4.3

My code is built with the base SDK 5.1 and deployment 4.0 and built using ARC.

I had no problems earlier when running on a test device 4.3, however it just crashed for the first time.

Any idea how to fix this?

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x00000001, 0xe7ffdefe
Crashed Thread:  0

Dyld Error Message:
  Symbol not found: _objc_retainAutoreleasedReturnValue
  Referenced from: /var/mobile/Applications/6AD37C1A-9642-4F0A-87E9-ED33EE45729D/Interactive Messages.app/Interactive Messages
  Expected in: /usr/lib/libobjc.A.dylib
  Dyld Version: 191.3

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   dyld                            0x2fe01080 dyld_fatal_error + 0
1   dyld                            0x2fe02a40 dyld::halt(char const*) + 48
2   dyld                            0x2fe02b00 dyld::fastBindLazySymbol(ImageLoader**, unsigned long) + 172
3   libdyld.dylib                   0x351d544e _dyld_fast_stub_entry(void*, long) + 30
4   libdyld.dylib                   0x351d5374 dyld_stub_binder + 12
5   Interactive Messages            0x00036aee 0x1000 + 219886
6   libobjc.A.dylib                 0x350af5d4 call_load_methods + 96
7   libobjc.A.dylib                 0x350af446 load_images + 50
8   dyld                            0x2fe03d7c _ZN4dyldL12notifySingleE17dyld_image_statesPK11ImageLoader + 64
9   dyld                            0x2fe0a6a8 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 236
10  dyld                            0x2fe0aaaa ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 34
11  dyld                            0x2fe020dc dyld::initializeMainExecutable() + 324
12  dyld                            0x2fe06ffe dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**) + 1446
13  dyld                            0x2fe01286 dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*) + 506
14  dyld                            0x2fe01058 _dyld_start + 48
+4
source share
3 answers

Where did the crash happen? I had the same thing that suddenly started with a new compiler.

For me, I had code inside the override +(void) loadthat seemed to be called before the arclite code was correctly linked. I'm not sure if this is possible, but moving the same code in +(void) initializeworks fine.

+1
source

[ 4.3, , iOS 4.]

EDIT: Grrr. ARC . 4.3 , , . , . , SDK 4,3, , , . , 4.3 ( WWDC), , , , . , , , - 4.3, . - , .

0

@Paul de Lange, .

100%, , Xcode 4.4, ARC libarclite_xxx.a( iOS4) + (void) ( ).

Xcode <= 4.3:

  • LINKING libarclite_xxx.a
  • +
  • +
  • int main()
  • class + initialize

Xcode >= 4.4:

  • +
  • LINKING libarclite_xxx.a
  • +
  • int main()
  • class + initialize

My application crashed on its first launch due to the addition of @autoreleasepool directly in the class + load, and, moving its implementation to either class + initialize or class category + load, everything went fine.

0
source

All Articles