quick-cocos2d-x 2.2.4
self.sprite = display.newSprite("bg.png")
self:addChild(self.sprite)
self.sprite:setTouchEnabled(true)
-- 设置触摸模式
-- self.sprite:setTouchMode(cc.TOUCH...
分类:
其他好文 时间:
2014-07-18 22:32:49
阅读次数:
257
AppDelegate.m部分- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWin...
分类:
其他好文 时间:
2014-07-18 21:16:44
阅读次数:
213
1. 退出键盘 // 不想当第一响应者(退出键盘) [self.qqField resignFirstResponder]; [self.pwdField resignFirstResponder];// 直接退出键盘(条件:叫出键盘的控件必须是它的子控件或者它本身) [s...
分类:
其他好文 时间:
2014-07-17 00:11:04
阅读次数:
293
#import "MJcostom.h"@implementation MJcostom- (id)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self) { self.backgroundColor=[U...
分类:
其他好文 时间:
2014-07-16 16:03:21
阅读次数:
196
今天在编写model时,突然发现了“Cannot assign to 'self' outside of a method in the init family”问题。后通过搜索解决了此问题,记录之。有时候我们重写父类的init方法时不注意将init后面的第一个字母写成了小写,在这个方法里面又调用父...
分类:
其他好文 时间:
2014-07-16 15:44:36
阅读次数:
193
- (id)initWithFrame:(CGRect)frame{ if(self= [superinitWithFrame:frame]) { // Important here, rotate THIS UIView [selfsetCenter:CGPointMake(160...
分类:
其他好文 时间:
2014-07-16 15:26:52
阅读次数:
149
1. 访问对象的属性class MyClass(): a='1' b='2' def __init__(self): pass def write(self): print self.a,self.bmyClass=MyClass()print d...
分类:
编程语言 时间:
2014-07-16 15:15:04
阅读次数:
302
function(){}();(function(){})();这两个是self-invoking anonymous 自调匿名函数,用这类的方法,能强制使匿名函数成为表达式,把不合法变成合法。()是对函数赋值,所以function($){}(window.jQuery) 就是指把window.jQ...
#coding:utf8try: import qrcodeexcept ImportError: qrcode = Noneclass MakeQr: def onUseQrcode(self, value): qr = qrcode.QRCode(version=1,...
分类:
编程语言 时间:
2014-07-16 15:07:18
阅读次数:
214
*.location.href 用法:
top.location.href=”url” 在顶层页面打开url(跳出框架)
self.location.href=”url” 仅在本页面打开url地址
parent.location.href=”url” 在父窗口打开Url地址
this.location.href=”url” ...
分类:
其他好文 时间:
2014-07-16 14:30:03
阅读次数:
171