ShareKit 中SHK.m中的编译错…
来源:互联网 发布:批处理图片的软件 编辑:程序博客网 时间:2024/06/06 10:02
ShareKit
转自:http://blog.csdn.net/wave_1102/article/details/6081253
ShareKit has recently become one of my favorite iPhone open sourceprojects. Just add a few lines of code to your app and you caninstantly share text, URLs and other data via Email, Twitter,Facebook and a whole slew of other services.
I’ve found a couple of minor issues with the current release(version 0.2.1) of ShareKit, and I thought I’d share them to saveyou a couple of hours of debugging.
Error when building for device
This seems to be a known issue, that may depend on your Xcodeinstall.
If you get 12 compiler errors when building for a device, startingwith:
ShareKit/Core/SHK.m:35:28: error: objc/objc-class.h: No such fileor directory
Then the solution is to change this import statement inSHK.m:
#import <objc/objc-class.h>
to:
#import</usr/include/objc/objc-class.h>
or:
#import<objc/runtime.h>(这个是解决方案)
Hardcoding the path to something outside of Xcode or your projectdirectories seems like bad idea. So I went with the secondsolution.
Conflicting Localizable.strings
The ShareKit project contains its own Localizable.strings filesin the ShareKit / Localization directory. If your project is alsolocalized there will be a conflict over which Localizable.stringsfile will be used at runtime.
There are a couple of ways to resolve this conflict:
Remove the ShareKit files from your build target. This is thequickest solution, but you will lose the localizations provided inShareKit (currently only German).
Copy the contents of the Localizable.strings files from ShareKit toyour Localizable.strings files. And then remove the ShareKit filesfrom your build target. This works well when you have correspondinglocalizations.
Rename the ShareKit files to ShareKitLocalizable.strings and thenreplace the NSLocalizedString macros in the ShareKit code withNSLocalizedStringFromTab
From: http://iphoneincubator.com/blog/open-source/sharekit
这个#import<objc/runtime.h> 主要是关于ObjC里面底层的用法,类似这些:
Method origMethod = class_getInstanceMethod(c, orig);
MethodnewMethod = class_getInstanceMethod(c, newClassName);
if(class_addMethod(c, orig, method_getImplementation(newMethod),method_getTypeEncoding(newMethod)))
class_replaceMethod(c, newClassName,method_getImplementation(origMethod),method_getTypeEncoding(origMethod));
else
method_exchangeImplementations(origMethod, newMethod);
- ShareKit 中SHK.m中的编译错…
- Shk
- ShareKit 分享到FaceBook, Twitter…
- iOS sharekit分享
- ShareKit编译错误的处理
- ShareKit
- ShareKit
- ShareKit
- shareKit
- Linux中的 TOMCAT 7 配置问题访问m…
- oracle startup m…
- MQL4函数 Print M…
- 在PHP中如何实现国际化支持 使用M…
- 衡阳八中 1856 数论 C(n,m) % p
- Lesson 91 Three m…
- 对于一个N x M 的…
- 编译报错LINK : fatal&n…
- ShareKit教程1-怎么将ShareKit加到你的App中
- 在iOS中使用重定向,把控制台内容…
- SQLibs iOS开发常用代码库
- iOS 开发常用尺寸
- "/usr/include/sqlite3.h" …
- git笔记--基础
- ShareKit 中SHK.m中的编译错…
- Object_c底层细节
- TortoiseSVN切换登录用户
- iOS 拨打电话相关知识总结
- 进程名字的赋值
- iOS 播放流媒体 服务端配置备份
- 一行代码,在 iPhone 应用中…
- 用UIWebView,JS获取视频链接
- iPhone app 内嵌httpserver