Domanda

I have a project that uses the face detection as provided in CoreImage that was originally developed in Xcode 4.6.3 using the iOS6 SDK with a deployment target of 5.1. With the release of iOS7 I updated to Xcode5 and the iOS7 SDK keeping the deployment target as 5.1.

This was fine until I added a new class, in Xcode5, that references properties in a CIFaceFeature object, specifically hasLeftEyePosition. The code builds and runs just fine on an iPhone5S running iOS7.02 and an iPod 5th gen running iOS7.02, however when I try to run it in debug on an iPhone4 running iOS6.1 I get the splash screen on the device and then the following output in the console:

dyld: Symbol not found: _OBJC_IVAR_$_CIFaceFeature.hasLeftEyePosition
  Referenced from: /var/mobile/Applications/...
  Expected in: /System/Library/Frameworks/CoreImage.framework/CoreImage
 in /var/mobile/Applications/...

I have verified that the CoreImage.framework is included to be linked against. The weird thing about this error is that I access properties of CIFaceFeature objects elsewhere in the code base in files that were added in Xcode 4.6.3.

I have also verified that if I comment out the newly added code accessing hasLeftEyePosition the app runs just fine on the iOS6.1 iPhone4.

Does anyone have experience with this type of error? Is there a setting for the newly added files I need to change to have it link against the correct frameworks? I'm kind of grasping at straws here as I don't see what the problem is and the fact that I access the exact same property elsewhere in the code with no problems.

È stato utile?

Soluzione

Are you sure you're referencing the property and not the instance variable? The error you're seeing is due to a missing instance variable in the iOS 6 version of Core Image. I can see in the iOS 7 headers there is a declared ivar for this which is absent in iOS 6.

If you're doing feature->hasLeftEyePosition or similar, you're accessing the instance variable, which should generally be considered an implementation detail you shouldn't use directly. If you're making a subclass and just saying hasLeftEyePosition, ditto. You need to be using either [feature hasLeftEyePosition] or feature.hasLeftEyePosition to use the property.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top