我想在山狮(os x 10.8)上的xcode 4.4中安装SDK 4.3,但是当我从xcode 4.1安装4.3 sdk软件包并从xcode 4.4启动模拟器时,模拟器只是告诉我ios模拟器找不到SDK.
可能需要重新安装sdk,这意味着它无法运行!xcode 4.4 GM出了什么问题?
有没有关于如何解决这类问题的想法?
我将以下代码添加到appDelegate.m中
- (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
}
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
if (motion == UIEventSubtypeMotionShake )
{
// User was shaking the device. Post a notification named "shake".
[[NSNotificationCenter defaultCenter] postNotificationName:@"shake" object:self];
}
}
- (void)motionCancelled:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
}
- (void)shakeSuccess
{
// do something...
}
Run Code Online (Sandbox Code Playgroud)
然后我补充说:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
// INIT THE BACKGROUND PATH STRING
[self refreshFields];
[self.window addSubview:navController.view];
[self.window makeKeyAndVisible];
***[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(shakeSuccess) name:@"shake" …
Run Code Online (Sandbox Code Playgroud) 现在我想传递一个void*
指向Lua 的指针,使用userdata?这该怎么做?
顺便说一下,我用过luabind,但是它无法通过一个void*
指向Lua堆栈的指针,这很烦人!你们能帮助我吗?
struct Event
{
A* a;
B* b;
...
};
Event *e;
void* instance = (void*)e;
// param is a parameter that is passed from Lua script. param is a Event object. And I cast it into a void* type
string Answer(void* param)
{
WorkEvent *pWorkEvent = static_cast<WorkEvent*>(param);
ASSERT_RET(pWorkEvent, NULL);
string call_id = pWorkEvent->GetCallId();
CCmThreadManager::TType thrd_id = pWorkEvent->GetHandleThrdID();
Coroutine *pco = pWorkEvent->m_pco;
Run Code Online (Sandbox Code Playgroud)