小编Kex*_*Kex的帖子

CocoaPods podspec lint失败 - 找不到文件

我正在尝试分发我的pod,但我遇到了验证问题.

当我想要对付我的.podspec时,我得到了:

- ERROR | [iOS] [xcodebuild]  path/to/my/source/file.m:14:9: fatal error: 'KeyValueObjectMapping/DCKeyValueObjectMapping.h' file not found
Run Code Online (Sandbox Code Playgroud)

我尝试使用不同的变体来保留其框架的路径

 s.preserve_paths = 'KeyValueObjectMapping.framework/*'
Run Code Online (Sandbox Code Playgroud)

要么

 s.preserve_paths = '${PODS_ROOT}/Vendor/KeyValueObjectMapping/KeyValueObjectMapping.framework'
Run Code Online (Sandbox Code Playgroud)

和其他变化,但这样我又得到一个错误:

    - ERROR | [iOS] The `preserve_paths` pattern did not match any file.
Run Code Online (Sandbox Code Playgroud)

我还尝试过其他一些其他问题,比如:

  s.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Vendor/KeyValueObjectMapping/KeyValueObjectMapping.framework"','FRAMEWORK_SEARCH_PATHS' => '"$(PODS_ROOT)/Vendor/KeyValueObjectMapping/*"' }
  s.framework = 'KeyValueObjectMapping'
Run Code Online (Sandbox Code Playgroud)

该项目使用Xcode5和xcodebuild以及它的默认设置构建良好,我只有在为Cocoapods验证时才会遇到此问题.

objective-c xcodebuild ios cocoapods

7
推荐指数
1
解决办法
2439
查看次数

究竟为什么onFreeze()用于?

在一个Android教程中,我看到了这个功能的用法.在那里,他使用它来恢复我认为的应用程序的上一个会话,但问题是我不能在我的类中使用这个函数,并且这两个类(我和他的)从ListActivity扩展.

@Override
    protected void onFreeze(Bundle outState) {
        super.onFreeze(outState);
        outState.putLong("feed_id", feed.feedId);
        outState.putString("title", feed.title);
        outState.putString("url", feed.url.toString());
    }
Run Code Online (Sandbox Code Playgroud)

另外我之前遇到了一些函数调用的问题,就像操作ArrayLists一样,他调用list.next()并且我没有这样的函数所以我使用了list.MoveToNext().可能是因为Android的不同版本(我使用1.6)以及用什么作为此功能的替代品?

android function

3
推荐指数
1
解决办法
4766
查看次数

JavaScriptCore + Socket.IO

我正在尝试使用iOS应用程序连接到Node.JS服务器,但我没有使用第三方本机库,而是尝试将其与JavaScript Socket.IO客户端连接并传递我所拥有的数据收到我的原生代码.我正在将Socket.IO模块加载到JSContext中并加载得很好,我可以在io对象中看到所有可用的对象/函数.

但是当它到达连接到我的Node.JS服务器的行时,我的JavaScript代码的执行停止了,我找不到原因.

如果我暂停应用程序,我没有看到任何其他线程打开连接.JavaScriptCore是否可能不支持Web套接字?

我的Objective-C代码:

JSContext *context = [JSContext new];

NSString *filePath = [[NSBundle mainBundle] pathForResource:@"socket.io" ofType:@"js"];
NSString *socketIO = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:&error];;


filePath = [[NSBundle mainBundle] pathForResource:@"client" ofType:@"js"];
NSString *client = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:&error];
context[@"socket_url"] = @"http://192.168.1.128:8080";
context[@"log"] = ^(NSString *string){

    NSLog(@"JavaScript:\n\t%@", string);
};
context[@"iOSBlock"] = ^(id deviceState) {

    id JSON = [NSJSONSerialization JSONObjectWithData:deviceState options:NSJSONReadingMutableLeaves error:nil];
    // I'll do something here if I get reach this part :)
};

[context evaluateScript:socketIO];
[context evaluateScript:client];
Run Code Online (Sandbox Code Playgroud)

我的JavaScript代码:

var socket = …
Run Code Online (Sandbox Code Playgroud)

javascript objective-c socket.io javascriptcore ios7

2
推荐指数
1
解决办法
1102
查看次数

设备上的Cocos2d 2.x ARC问题

我正在开发一款带有ARC的cocos2d的游戏.游戏在模拟器中构建和运行良好,但是当我构建设备时,我得到了Apple Mac-O Linker Errors,说我错过了libcocos2d.a等的库.

clang: error: no such file or directory: '/Users/aleksandartrpeski/Library/Developer/Xcode/DerivedData/jellyfish-fsomqwhqasishxcfzhgvccrdvzpt/Build/Products/Debug-iphoneos/libcocos2d.a'
clang: error: no such file or directory: '/Users/aleksandartrpeski/Library/Developer/Xcode/DerivedData/jellyfish-fsomqwhqasishxcfzhgvccrdvzpt/Build/Products/Debug-iphoneos/libCocosDenshion.a'
clang: error: no such file or directory: '/Users/aleksandartrpeski/Library/Developer/Xcode/DerivedData/jellyfish-fsomqwhqasishxcfzhgvccrdvzpt/Build/Products/Debug-iphoneos/libkazmath.a'
clang: error: no such file or directory: '/Users/aleksandartrpeski/Library/Developer/Xcode/DerivedData/jellyfish-fsomqwhqasishxcfzhgvccrdvzpt/Build/Products/Debug-iphoneos/liblibpng.a'
Run Code Online (Sandbox Code Playgroud)

当我去文件丢失的文件夹时,我只看到了jellyfish.app.

我在这类问题上没有多少经验,我不清楚为什么会这样,我检查了如何从TinyTimGames和LearnCocos2D启动项目,仍然不清楚我做错了什么.

xcode mach-o linker-errors cocos2d-iphone automatic-ref-counting

1
推荐指数
1
解决办法
930
查看次数