19

Just updated my project to Xcode 8 and I find this errors in multiple external frameworks my app includes. Is there a workaround, maybe touching settings, to avoid this compilation errors?

This is an error example: (That I'm not able to modify because it's an imported framework)

const void * ivarPtr = objc_unretainedPointer(self) + ivar_getOffset(ivar);
[decoder decodeValueOfObjCType:[ivarInfo[@"encoding"] UTF8String] at:(void *)ivarPtr];
Codo
  • 75,595
  • 17
  • 168
  • 206
tonik12
  • 613
  • 1
  • 7
  • 25
  • Show the lines causing the errors and the complete error messages. – Droppy Jun 14 '16 at 08:48
  • What is `ivar`? Can you provide some more context please? – JAL Jun 14 '16 at 17:13
  • ivar is Ivar ivar = class_getInstanceVariable(ivarInfo[@"class"], [ivarName UTF8String]); but I believe this is not relevant since there is little I can modify in there due we are talking about code that it's inside of an external framework from an external party. – tonik12 Jun 15 '16 at 14:24

2 Answers2

17

For Xcode 8, it should be:

const void * ivarPtr = (__bridge void *)(self) + ivar_getOffset(ivar);
Jin
  • 1,671
  • 1
  • 14
  • 13
  • This doesn't solve the issue, since this is happening in an external framework I have not the ability to modify. – tonik12 Jun 15 '16 at 07:54
  • @user2461338 So you are seeking a solution that requires no code changes? – Droppy Jun 15 '16 at 08:03
  • I believe that's the only way. If not, I'll be delighted to hear. – tonik12 Jun 15 '16 at 08:06
  • @user2461338 You got this compiling error while compiling the code. So you have the code, not some binary stuff, why can't modify it? – Jin Jun 16 '16 at 05:08
  • It's a pod, so every time I'd do update I'll need to remake the changes. I believe... – tonik12 Jun 21 '16 at 16:04
  • 1
    @user2461338 So the question changes to "how to use the fork of a cocoa pod repo". You can take a look at http://stackoverflow.com/questions/12393470/use-a-fork-of-restkit-on-github-via-cocoapod . Or just send pull requests to them. – Jin Jun 22 '16 at 09:59
2

You can Simply Replace objc_unretainedPointer(self) to (__bridge void *)(self)

Dheeraj D
  • 4,386
  • 4
  • 20
  • 34