简体   繁体   English

我无法使用静态库

[英]I am not able to use static library

I just started learning iPhone development and i am stuck at this point. 我刚刚开始学习iPhone开发,而现在我陷入了困境。 My problem is as follows: 我的问题如下:

I need a text box with autocomplete functionality several times in my project. 我在项目中多次需要一个具有自动完成功能的文本框。 So i created a static library which contains a viewController and in it a text box and a table(hidden, but shown when user types). 因此,我创建了一个静态库,其中包含一个viewController以及一个文本框和一个表(已隐藏,但在用户键入时显示)。 I have added the text-box and table manually through coding. 我已经通过编码手动添加了文本框和表格。 And just connect the view to Files Owner. 只需将视图连接到文件所有者。 The xib contains nothing else but view. xib除视图外仅包含其他内容。 Now i want to use it in my project at many places. 现在,我想在许多地方的项目中使用它。 So I created a simple view-based application project and included my static library in it. 因此,我创建了一个简单的基于视图的应用程序项目,并在其中包含了我的静态库。 But i dont know how do i use the text box or view on my new project's view. 但是我不知道如何在新项目的视图中使用文本框或视图。 Please help me out of this. 请帮助我。

Here are simple steps: 以下是简单的步骤:

  1. Drag drop the static lib to your project. 将静态库拖放到您的项目中。
  2. Remember to check Relative to project while copying. 记住在复制时选中相对于项目。
  3. Import classes in header files. 在头文件中导入类。
  4. Write name of your class in Target settings/Header Search Path. 在“目标设置/标题搜索路径”中输入您的班级名称。
  5. Add some flags like -ObjC and -all_Load if needed. 如果需要,添加一些标志,例如-ObjC和-all_Load。
  6. Instantiate the necessary objects. 实例化必要的对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM