Difficulties with launching iOS 5 application on iOS 4

I have an iPhone app that is for deployment 4.0 and basic sdk 5.0. The application works fine on the iOS 5 simulator, but when I install the 4.3 application simulator, I get the following:

dyld: unsuccessful lazy character binding: Symbol not found: _objc_retainAutoreleasedReturnValue Link: / Users / joakim / Library / Application Support / iPhone Simulator / 4.3.2 / Applications / F6CE76EA-DA7E-4BAC-A3AC-3CE2B51C0CD9 / PingPalARCALCap / Waiting for : /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Foundation

dyld: Symbol not found: _objc_retainAutoreleasedReturnValue
Link from: / Users / joakim / Library / Application Support / iPhone Simulator / 4.3.2 / Applications / F6CE76EA-DA7E-4BAC-A3AC-3CE2B51C0CD9 / PingPalARC.app / PingPalARC Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer /SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Foundation

sharedlibrary apply-load-rules all (gdb)

The project does not use ARC by default, however there are several classes so that I enable ARC with the -fobjc-arc flag in compilation sources

I don’t use weak links and I don’t use storyboards, so I can’t understand why my application should not work on iOS 4.x. Can someone tell me what I missed so that my application works both on iOS 4 and 5.

Added Structures: System Configuration CFNetwok Card Set Kernel Location

+4
source share
3 answers

You are using ARC, which is not built into iOS 4. Have you set the deployment target to 4, so the arclite library is included for you? https://devforums.apple.com/message/588316

(Ah, it looks like you did it, but you are not telling the IDE that you are using ARC. Therefore, you will have to enable it yourself.)

+3
source

Not quite an answer, but some more information if it helps someone more recognizable than me ...

objc_retainAutoreleasedReturnValue(obj) is new to iOS 5 and pretty much does what that name says. Conceptually, if the assigned object is in the auto-resource pool, then it is retrieved from there, implicitly saving it, and the appropriate issue is added later. Thus, this is a way to avoid the memory bottleneck problem that can occur when conceptually temporary objects accumulate in the autorun pool. So this is optimization, not a new part of behavior.

The ARC compiler will be inserted into one of your ARC files, where some method receives an object with auto-implementation. As you say, this is not connected with weak links or folding boards, and it’s logical that you simply cannot do this in order to maintain compatibility with iOS 4.

Having said all this, I’m not completely sure of a workaround that is different from the obvious, but probably very hard in the stomach - change your ARC classes so that they never receive objects with auto-implementation or completely disable ARC. Apple does not allow the deployment of dynamically linked libraries, so I cannot think of a safe way to offer an alternative to objc_retainAutoreleasedReturnValue for iOS 4 devices.

+2
source

Add all temporary variable declarations inside the autoreleasepool block inside the function.

+1
source

Source: https://habr.com/ru/post/1388624/


All Articles