Nik*_*iko 10 iphone static-libraries ios
我开发了自己的框架,其中包含我经常在我的应用程序中使用的有用的类/方法.最近,我为NSString添加了一个类扩展"NSString + Extensions.h/m"来添加我自己的方法.示例:
Run Code Online (Sandbox Code Playgroud)@interface NSString (Extensions) - (NSString *)removeDiacritics; @end
Run Code Online (Sandbox Code Playgroud)#import "NSString+Extensions.h" @implementation NSString (Extensions) - (NSString *)removeDiacritics { return [[[NSString alloc] initWithData:[self dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES] encoding:NSASCIIStringEncoding] autorelease]; } @end
我成功编译了我的框架.但是当我尝试在任何应用程序中使用此类扩展的一个函数时:
Run Code Online (Sandbox Code Playgroud)// CUtils is the name of the framework. CUtils.h contains #import of all header files // contained in my framework #import <CUtils/CUtils.h> @implementation AppDelegate ... - (void)applicationDidBecomeActive:(UIApplication *)application { /* Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previouslyin the background, optionally refresh the user interface. */ NSString *toto = @"Je suis une chaîne avec des caractères spéciaux"; NSLog(@"%@", toto); NSLog(@"%@", [toto removeDiacritics]); }...
我收到以下错误:
2012-01-31 17:01:09.921 TestCUtils [4782:207] Je suisunechaîneavecdescaractèresspéciaux2012-01-3117:01:09.924 TestCUtils [4782:207] - [__ NSCFConstantString removeDiacritics]:无法识别的选择器发送给实例0x340c
但是,如果我直接在应用程序中添加我的类扩展(在我的框架之外),它工作正常...
任何提示?
**编辑**
正如你们有些人问过的那样,我在"其他链接标志"中添加了-all_load和-ObjC选项,但问题仍然存在.

| 归档时间: |
|
| 查看次数: |
1976 次 |
| 最近记录: |