Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios - Parse Issues in NSObjCRuntime, NSZone, and NSObject

I'm using AddThis to add sharing options in my iOS app.

I have imported the classes and added the -fno-objc-arc flag to all the imported classes since they don't use ARC.

However, when I try to run the app I get a slew of Parse Issues such as:

Expected identifier or '(' Unknown type name 'NSString' Unknown type name 'Protocol' ... 

These errors occur in NSObjCRuntime, NSZone, and NSObject. I have the requisite frameworks included as well. Any ideas?

Including this image if it helps: image

like image 739
soleil Avatar asked Aug 08 '12 04:08

soleil


2 Answers

I had the same issue on my project when I was trying to mix C code (.h and .c) with Objective-C code. Found the reason of the issue:

Check your .pch file to make sure every Objective-C framework #import (such as #import <UIKit/UIKit.h>) is enclosed in:

#ifdef __OBJC__  #endif 

If they're outside of this conditional scope, the compiler will try to import Objective-C frameworks into C source code.

Hope that helps.

like image 133
horacex Avatar answered Sep 21 '22 05:09

horacex


I just changed the filename of Base64Transcoder.c to Base64Transcoder.m, and now the project compiles. I have no idea why this fixes the problem, but it works.

like image 26
soleil Avatar answered Sep 19 '22 05:09

soleil