小编Dav*_*tín的帖子

在Mac上运行nodejs服务器时出错,"找不到合适的图像"

unknown406c8f2d5ecb:proves airrider3$ node tronServer.js
[Error: dlopen(/Users/airrider3/Documents/proves/node_modules/now/node_modules/node-proxy/build/Release/nodeproxy.node, 1): no suitable image found.  Did find:
    /Users/airrider3/Documents/proves/node_modules/now/node_modules/node-proxy/build/Release/nodeproxy.node: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00]
Error: dlopen(/Users/airrider3/Documents/proves/node_modules/now/node_modules/node-proxy/build/Release/nodeproxy.node, 1): no suitable image found.  Did find:
    /Users/airrider3/Documents/proves/node_modules/now/node_modules/node-proxy/build/Release/nodeproxy.node: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00
    at Object.Module._extensions..node (module.js:485:11)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/Users/airrider3/Documents/proves/node_modules/now/node_modules/node-proxy/lib/node-proxy.js:1:90)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at …
Run Code Online (Sandbox Code Playgroud)

javascript macos webserver node.js nowjs-sockets

16
推荐指数
2
解决办法
9142
查看次数

找不到Availability.h,UIKit.h等

我在这里遇到了很大的问题.

我最近从Mac App Store下载了Xcode 4.3,因为它具有Lion的全屏功能.然后,我的项目停止编译.它说:

Availability.h未找到词法或预处理器问题文件.

//
// Prefix header for all source files of the 'TRGame' target in the 'TRGame' project
//

#import <Availability.h>

#ifndef __IPHONE_3_0
#warning "This project uses features only available in iPhone SDK 3.0 and later."
#endif


#ifdef __OBJC__
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
#endif
Run Code Online (Sandbox Code Playgroud)

那是在xxxx-Prefix.pch文件中.

如果我发表评论#import Availability.h,它会告诉我它找不到UIKit.h,依此类推......

帮助将非常感谢!

iphone import xcode objective-c

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

尴尬的arc4random结果

我正在使用此代码,其中'length'值为'50'.

newX = (arc4random()%(lenght+1)) - (lenght/2);
newY = (arc4random()%(lenght+1)) - (lenght/2);
NSLog(@"Creature Move X:%f, Y:%f", newX, newY);
Run Code Online (Sandbox Code Playgroud)

但在调试器中我得到的结果如下:

2012-01-02 21:10:50.794 Kipos[28833:207] Creature Move X:4294967296.000000, Y:4294967296.000000
2012-01-02 21:10:50.896 Kipos[28833:207] Creature Move X:4294967296.000000, Y:12.000000
Run Code Online (Sandbox Code Playgroud)

怎么了?

newX并且newY是浮点数:

float newX;
float newY;
Run Code Online (Sandbox Code Playgroud)

random objective-c arc4random

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