如何在Mac App捆绑包中将ParseKit嵌入为私有框架 [英] How to embed ParseKit as a private framework in a Mac App bundle

查看:92
本文介绍了如何在Mac App捆绑包中将ParseKit嵌入为私有框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要安装ParseKit才能在Mac OS X下与可可一起编译,我使用的是xcode 4. 我已经在网上搜索过,但是只有安装iPhone解析套件的指南. 在哪里可以找到Mac Os X的下载文件和/或指南?

I need to install ParseKit to compile with cocoa under Mac Os X, I use xcode 4. I have searched online but there is only a guide for installing parse kit for iPhone. Where do I find the download for Mac Os X and/or a guide?

推荐答案

ParseKit的开发人员在这里.

Developer of ParseKit here.

好,通过

OK, after working through a tricky issue in Xcode 4, I have figured out my preferred way to do this: Create a new Workspace ("MySuite") which contains two sub-Projects

  • 您的Mac Cocoa应用程序项目("MyApp")
  • ParseKit框架项目("ParseKit")

您可以选择与"MyApp"和"MySuite"不同的名称.

You can choose different names than "MyApp" and "MySuite" of course.

有几种不同的方法可以实现这一目标.这是一种方法:

There's a few different ways to make this happen. Here's one way:

  1. 首先,请确保您已从Google Code主干更新到最新版本的ParseKit.我最近对Xcode 4.3.1的Xcode项目进行了现代化改造.

  1. First, make sure you update to the very latest version of the ParseKit from the Google Code trunk. I have recently modernized the Xcode project for Xcode 4.3.1.

svn checkout http://parsekit.googlecode.com/svn/trunk/ parsekit-trunk

确保没有打开ParseKit Xcode Project窗口.这是Xcode中的问题直到版本4.3.1 (可能稍后再不确定).

Make sure you do not have the ParseKit Xcode Project window open. This is an issue in Xcode up to version 4.3.1 (and maybe later, not sure).

MyAppDelegate.m中,导入ParseKit标头:

In MyAppDelegate.m, import the ParseKit header:

#import <ParseKit/ParseKit.h>

-[MyAppDelegate applicationDidFinishLaunching:]中执行:

NSString *g = @"@start = Word+;";
PKParser *p = [[PKParserFactory factory] parserFromGrammar:g assembler:self error:nil];
NSError *err = nil;
id result = [p parse:@"foo bar baz" error:&err];
NSLog(@"%@", result);


有关此主题的更多信息,请参阅:


For more info on this topic, see:

  • Apple's docs
  • Chapter 16 of Mastering Xcode 4 by Joshua Nozzi

这篇关于如何在Mac App捆绑包中将ParseKit嵌入为私有框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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