views:

58

answers:

3

I'm using the Three20 library in my app, I am seeing this error during linking of the app:

"_UIApplicationDidEnterBackgroundNotification", referenced from: _UIApplicationDidEnterBackgroundNotification$non_lazy_ptr in libThree20UINavigator.a(TTBaseNavigator.o) (maybe you meant: _UIApplicationDidEnterBackgroundNotification$non_lazy_ptr) ld: symbol(s) not found

I have seen that this problem happens when I try to build for BASE SDK IOS 3.2 Simulator but not on IOS 4.1 Simulator. I have tried the following settings to no avail:

Architecture for my project and ALL Three20 projects set to Optimized
Project Settings/Active Target - BaseSDK for my project and ALL Three20 projects set to IOS 3.2 Simulator

Architecture for my project and ALL Three20 projects set to Standard
Project Settings/Active Target - BaseSDK for my project and ALL Three20 projects set to IOS 3.2 Simulator

Architecture for my project and ALL Three20 projects set to Standard
Active Target - BaseSDK for my project and ALL Three20 projects set to IOS 3.2 Simulator
Project Settings - BaseSDK for my project set to IOS 4.1 Simulator

The following are the settings that work:

Architecture for my project and ALL Three20 projects set to Standard (or Optimized)
Active Target/Project Settings BaseSDK for ALL Three20 projects set to IOS 3.2 Simulator
Active Target/Project Settings BaseSDK for my project set to IOS 4.1 Simulator

I am tired of trying these permutations. Really want to understand wth is going on - but haven't been able to find any meaningful logs. Thanks for any comments/answers.

+1  A: 

that symbol is declared in the 4.0 SDK. you can't use that function on iOS 3.x. you have 2 choices:

1) target iOS 4.0 or greater

2) use an earlier release of three20, which was built to work with the sdk you target

Justin
That is correct. I used option 3, which is commenting lines of code in TTBaseNavigator that were causing this compile time issue to occur. I understand that it is a hack, but I consciously decided to do so as I was only using very limited functionality from Three20.
amehta
yes - that's also an option (but i try to avoid maintaining a distinct branch where possible). it helps in this case to add an assertion at the call site, to verify that you never execute in that block.
Justin
A: 

The best way to work around this problem is to weak link against UIKit. You can do this in your project/target settings in the general tab. In the Linked Libraries section find UIKit and set the type from Required to Weak.

lyonanderson
A: 

Weak-leaking UIKit unnecessarily slows down your app considerably-- don't do it.

Set your Base SDK to the highest possible and then set your Deployment Target to be the lowest OS you want to support. The compiler will automatically weak-link only the APIs not available in the lower SDK.

Remember that if you need to check for new classes before using them if you wish to run on an older OS.

Michael Grinich