I am having trouble accessing classes from the main app in my widget extension.
I have tried selecting widget in target membership of the class I want to access, but for some reason I get a lot of Undefined errors from widget. I want to share API classes and Models. The error occurs exactly when I share API classes, and not when I share models only. I have no idea what's wrong:(
CodePudding user response:
The errors is telling you that some part of the class you are using are including libraries that are written in C . To fix it:
- Select the widget target in the project area.
- Select the "Build Settings" tab.
- Type "linker" in the search box.
- Find the "Other Linker Flags".
- Double click on the right side of the "Other Linker Flags" row.
- Press " " and type "-lc "
See screen shot below: