现在的位置: 首页 > 综合 > 正文

aboutxcodeaboutobjcaboutiphone

2018年02月14日 ⁄ 综合 ⁄ 共 482字 ⁄ 字号 评论关闭

 

presentModalViewController可以用来弹出一个模态对话框

 

[[self parentViewController]
dismissModalViewControllerAnimated:YES];用这个来取消对话框


获取资源文件路径
[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:(fileName)]

 

这样就可以识别.摇动了,真诡异:  

- (BOOL)canBecomeFirstResponder {

return
YES;

}

- (void)viewDidAppear:(BOOL)animated

{

[self
becomeFirstResponder];

}

- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event {

    if ( event.subtype ==
UIEventSubtypeMotionShake ) {

// Do something

NSLog(@"Don't shake me!!");

    }

}

【上篇】
【下篇】

抱歉!评论已关闭.