摘要: [[textfieldwindow]makeFirstResponder:textfield];设置window 的位置。windowWillLoad:中设置在 windowDidBecomeMain: 方法中设定 window 现实的位置。[self.window setFrameOrigin:N... 阅读全文
posted @ 2016-01-25 14:25 Qingyun_Qearl 阅读(763) 评论(0) 推荐(0) 编辑
摘要: - (void)drawRect:(NSRect)dirtyRect { [super drawRect:dirtyRect]; [[NSColor clearColor] setFill]; NSRectFill(self.bounds); self.wantsLayer = YES;... 阅读全文
posted @ 2016-01-25 11:48 Qingyun_Qearl 阅读(929) 评论(0) 推荐(0) 编辑
摘要: Mac开发 - 使用CCMenu和CCMenuItem添加菜单、右击菜单、Dock菜单1、添加一个Dock右击菜单 NSMenu *appDockMenu= [[NSMenualloc]initWithTitle:@"DockMenu"];[appDockMenusetAutoenablesI... 阅读全文
posted @ 2016-01-25 11:24 Qingyun_Qearl 阅读(1149) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/zhyl8157121/article/details/48780897将编译模式调整为debug模式。 阅读全文
posted @ 2016-01-25 11:16 Qingyun_Qearl 阅读(1915) 评论(0) 推荐(0) 编辑
摘要: 1 (1)设置 文本框的 失去选中的焦点。比如我点击按钮的时候,这个焦点应该不显示 了。2 3 [self.textfield.window makeFirstResponder:nil];4 5 http://pinkstone.co.uk/how-to-remove-focus-from-an-... 阅读全文
posted @ 2016-01-25 11:15 Qingyun_Qearl 阅读(2725) 评论(0) 推荐(0) 编辑
摘要: 1 swift 2 3 varalert:NSAlert=NSAlert() 4 alert.messageText="警告"alert.addButtonWithTitle("好") 5 alert.alertStyle=NSAlertStyle.CriticalAlertStyle 6 7... 阅读全文
posted @ 2016-01-25 11:12 Qingyun_Qearl 阅读(3212) 评论(0) 推荐(0) 编辑
摘要: 从iPhone转到mac的开发者,会自然而然的以为NSView的subview(或控件)是有z轴顺序的,但实际上apple并不保证subview是按照添加的顺序显示。NSView也不存在类似于UIView的bringSubviewToFront方法。应该避免subview之间有交集。但由于我是把我的... 阅读全文
posted @ 2016-01-25 11:10 Qingyun_Qearl 阅读(694) 评论(0) 推荐(0) 编辑
摘要: 在mac中实现删除按钮的抖动效果,使用核心动画注意!注意!注意!!!这里在代理里面设置是关键啊!! [self.window.contentView setWantsLayer:YES];必须设置setWantsLayer为YES- (void)applicationDidFinishLaunchi... 阅读全文
posted @ 2016-01-25 11:00 Qingyun_Qearl 阅读(472) 评论(0) 推荐(0) 编辑
摘要: 在iphone开发我们可以通过对layer设置阴影,从而实现UIView的阴影效果。我cocoa中,有一个很方便的阴影效果的类叫做NSShadow,并且实现的方式也十分简单。1 NSShadow *shadow = [[NSShadow alloc] init];2 3 //设置阴... 阅读全文
posted @ 2016-01-25 10:53 Qingyun_Qearl 阅读(1635) 评论(0) 推荐(0) 编辑
摘要: 1 +(UIImage *)getImage:(NSString *)videoURL 2 3 { 4 5 AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:[NSURL fileURLWithPath:videoURL] opt... 阅读全文
posted @ 2016-01-25 10:51 Qingyun_Qearl 阅读(477) 评论(0) 推荐(0) 编辑