Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

compiler errors - 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

question from:https://stackoverflow.com/questions/11857765/ios-parse-issues-in-nsobjcruntime-nszone-and-nsobject

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...