Problem while including custom framework in Project

夙愿已清 提交于 2019-12-08 05:27:08

问题


I am trying to learn how to create custom frameworks and use them in a project in cocoa, so I began with a simple custom framework named - SimpleFramework.

It contains one class with only one class method:

// class name: SimpleClass, role: Public

+ (void)displayMessage{
    NSLog(@"Hello World");
}

I also set its Installation Directory path to - @executable_path/../Frameworks then compiled it.

I included it in another project - SimpleTest, using following steps-

  1. Dragged SimpleFramework.framework into Frameworks folder in project. Also selected Copy items to destination group's folder and Add To Targets check box.

  2. Created a New Copy Files Build Phase. Selected its destination as Frameworks.

  3. Dragged SimpleFramework.framework into it.

Problem is, when I am trying to import SimpleClass.h in SimpleTestAppDelegate class, it is giving this error message on compilation-

SimpleClass.h: No such file or directory.

Can anyone suggest me if I am doing anything wrong?

Code for application can be found here- Sample code link

Thanks,

Miraaj


回答1:


I found its solution. I was missing this line:

#import "SimpleFramework/SimpleClass.h"


来源:https://stackoverflow.com/questions/5297643/problem-while-including-custom-framework-in-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!