构造方法:用来初始化对象的;首先分解一下创建对象的过程:Person *p = [Person
new]; // new方法是alloc 和 init 这两个方法的组合;完整的创建可用对象的过程: 1:分配存储空间; 就是调用的 +alloc
方法,这个方法是类方法,返回的是一个分配好存储空间的 ....
分类:
其他好文 时间:
2014-05-12 04:47:22
阅读次数:
237
// 创建NSDate对象 NSDate *nowDate1 = [NSDate date];
NSDate *nowDate2 = [[NSDate alloc]init]; NSDate *nowDate3 =
[[NSDatealloc]initWithTimeInte...
分类:
其他好文 时间:
2014-05-11 00:49:23
阅读次数:
266
Undefined symbol assert_failed (referred from
dma.o).链接过程中出现assert_param函数未定义的错误解决方法: 在Options->C/C++->preprocessor
Symboles有Define:项中输入USE_STDPER...
分类:
其他好文 时间:
2014-05-10 20:41:56
阅读次数:
465
Hello
WorldLinux设备驱动的第一个例子。一.源程序(hello.c)#include#includeMODULE_LICENSE("DualBSD/GPL");staticinthello_init(void){printk(KERN_ALERT"Hello,world/n");ret...
分类:
系统相关 时间:
2014-05-10 07:40:47
阅读次数:
408
现在又很多工具能将文字转换成图片,这样就可以发送长微博,其实python实现这很容易的,主要就是用到了pygame模块
import os
import pygame
from pygame.locals import *
pygame.init()
text = u"这是一段测试文本,test 123。"
font = pygame.font.SysFont('SimHei', 14)
...
分类:
编程语言 时间:
2014-05-10 04:25:52
阅读次数:
620
在执行/etc/init.d/ndbd--initial出现下列错误[root@ndbd1~]#/etc/init.d/ndbd--initialUnabletoconnectwithconnectstring:nodeid=0,localhost:1186Retryingevery5seconds.Attemptsleft:121110987654321,failed.解决办法1.查看/etc/my.cnf文件配置[root@ndbd1~]#cat/etc/my.cnf..
分类:
数据库 时间:
2014-05-10 04:07:58
阅读次数:
1778
psql:致命错误:用户"***"Ident认证失败或psql:FATAL:Identauthenticationfailedforuser“username”,maispourquoidonc?解决办法:修改"pg_hba.conf"文件中认证方式"METHOD"为"md5"或"trust",具体参考文件中的说明。
分类:
数据库 时间:
2014-05-10 03:58:44
阅读次数:
611
error: RPC failed; result=22, HTTP code = 411fatal:
The remote end hung up unexpectedly解决方法:git config http.postBuffer 524288000
分类:
其他好文 时间:
2014-05-10 01:06:09
阅读次数:
367
整个Android系统的启动分为Linux kernel的启动和Android系统的启动。Linux kernel启动起来后,然后就运行第一个用户程序,在Android中,就是init程序,上一博文已经介绍。
Init进程始终是第一个进程。Init进程的对应的代码的main函数在目录system/core/init/init.c,先来总体看一下这个main函数。
int main(int...
分类:
移动开发 时间:
2014-05-09 22:24:03
阅读次数:
536
在 mkfs.ext4 /dev/sda2 格式化硬盘空间时,可能出现这样的错误。
had this situation at office where I was told to re-partition an already existing partition. The situation was to get the below schema
/dev/sdb1 1 3040 24...
分类:
其他好文 时间:
2014-05-09 20:49:25
阅读次数:
343