iphone:Kal日历不运行在xcode 4.2 [英] iphone: Kal calendar not running in xcode 4.2

查看:108
本文介绍了iphone:Kal日历不运行在xcode 4.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已从 Kal calendar 的演示-4.0rel =nofollow>源代码API在github ,并尝试在我的xcode4.2中运行演示代码,但它只是建立不运行它。





它不会给出任何警告或错误。

$ b $



集成Kal进入您的项目 - XCode早于4



Kal编译为静态库,将其添加到项目的建议方法是使用Xcode的依赖项目设施按照这些分步说明:


  1. 克隆git存储库:git clone git: /github.com/klazuka/Kal.git。


  2. 找到Kal.xcodeproj文件夹,文件在Kal / src /下。拖动Kal.xcodeproj并将其放置在您的Xcode项目的组和文件侧边栏的根。将出现一个对话框 - 在点击添加之前,确保复制项目未选中,参考类型为相对于项目。


  3. 您需要将Kal静态库链接到您的项目。选择刚刚添加到侧边栏的Kal.xcodeproj文件。在详细信息表下,您将看到libKal.a。选中此文件最右侧的复选框。这将告诉Xcode在构建你的应用程序时链接到Kal。


  4. 现在你需要添加Kal作为项目的依赖项,你编译你的项目。展开侧边栏的目标部分,然后双击应用程序的目标。在常规选项卡下,您将看到一个直接依赖关系部分。点击+按钮,选择Kal并点击添加目标。


  5. 现在您需要添加一组由Kal UI。在Kal / src下找到Kal.bundle,并将其拖放到您的项目中。将出现一个对话框 - 单击添加之前,请确保选中创建文件夹引用,取消选中复制项目,并且引用类型为相对于项目。

    $ b
  6. 最后,我们需要告诉你的项目在哪里找到Kal头。打开项目设置并转到构建选项卡。查找标题搜索路径,然后双击它。


  7. 在项目设置中,转到其他链接器标记 链接器部分,并将-all_load添加到标记列表。


  8. 只要#importKal.h你想在你的项目中使用KalViewController的任何地方。




$ b

将Kal整合到您的项目中b

在XCode 4中,它的工作方式与之前不同。



首先,在使用静态库之前,需要了解这些东西是如何集成的。
clint harris提供了一个非常好的介绍: 在iPhone应用程序之间轻松,模块化代码共享:静态库和跨项目引用
我建议您阅读他的指南。


  1. 要将Kal库放入您的项目,请忘记XCode 3的旧指南。
    在XCode 4中,在项目导航器中单击项目。说添加文件到项目,并找到Kal.xcodeproj。


  2. 现在再次在项目导航器中选择您的项目,然后进入build设置。搜索链接器并填写其他链接器标志:-Objc和-all_load,还在库搜索路径中插入到Kal目录的路径以及从项目到kal项目的相对路径:标题搜索路径。


  3. 现在转到构建阶段:
    将Kal静态库添加到目标依赖项, libKal.a到Link Binary with Libraries,最后将Kal.bundle添加到Copy Bundle Resources中。



I have downloaded demo for Kal calendar from source code API at github and try running demo code in my xcode4.2 but it just builds not running it.

I want to try it out with enabling/disabling dates into it and all other operations.

It is not giving any warning or errors.

解决方案

Have you gone through the integration steps as given with it?

Integrating Kal into Your Project - XCode prior than 4

Kal is compiled as a static library, and the recommended way to add it to your project is to use Xcode's "dependent project" facilities by following these step-by-step instructions:

  1. Clone the Kal git repository: git clone git://github.com/klazuka/Kal.git. Make sure you store the repository in a permanent place because Xcode will need to reference the files every time you compile your project.

  2. Locate the "Kal.xcodeproj" file under "Kal/src/". Drag Kal.xcodeproj and drop it onto the root of your Xcode project's "Groups and Files" sidebar. A dialog will appear -- make sure "Copy items" is unchecked and "Reference Type" is "Relative to Project" before clicking "Add".

  3. Now you need to link the Kal static library to your project. Select the Kal.xcodeproj file that you just added to the sidebar. Under the "Details" table, you will see libKal.a. Check the checkbox on the far right for this file. This will tell Xcode to link against Kal when building your app.

  4. Now you need to add Kal as a dependency of your project so that Xcode will compile it whenever you compile your project. Expand the "Targets" section of the sidebar and double-click your application's target. Under the "General" tab you will see a "Direct Dependencies" section. Click the "+" button, select "Kal" and click "Add Target".

  5. Now you need to add the bundle of image resources internally used by Kal's UI. Locate "Kal.bundle" under "Kal/src" and drag and drop it into your project. A dialog will appear -- make sure "Create Folder References" is selected, "Copy items" is unchecked, and "Reference Type" is "Relative to Project" before clicking "Add".

  6. Finally, we need to tell your project where to find the Kal headers. Open your "Project Settings" and go to the "Build" tab. Look for "Header Search Paths" and double-click it. Add the relative path from your project's directory to the "Kal/src" directory.

  7. While you are in Project Settings, go to "Other Linker Flags" under the "Linker" section, and add "-all_load" to the list of flags.

  8. You're ready to go. Just #import "Kal.h" anywhere you want to use KalViewController in your project.

I have recently integrated this calendar and its working fine at my side.

Integrating Kal into Your Project - XCode 4

In XCode 4 it works a lil bit different then before.

First of all before using a static library you need to understand how this stuff is integrated. A very good introduction is given by clint harris at: Easy, Modular Code Sharing Across iPhone Apps: Static Libraries and Cross-Project References I recommend you to read his guide. After that many things are more clear.

  1. To get the Kal library into your project forget the old guide for XCode 3. In XCode 4 click on your project in the project navigator. Say add files to project and find the Kal.xcodeproj. file and add it.When you see the Kal Project under your project you are almost there.

  2. Now again select your project in the project navigator and go to build settings. there search for "Linker" and fill in Other Linker Flags: "-Objc and -all_load", also insert the path to the Kal directory in the Library Search Paths and the relative path from your project to the kal project under: "Header Search Paths". Thats it for Build settings.

  3. Now go to Build Phases: Add the Kal static library to the target dependencies, also add the libKal.a to Link Binary with Libraries and at the end add the Kal.bundle to "Copy Bundle Resources".

这篇关于iphone:Kal日历不运行在xcode 4.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆