利用KVC方法快速为数据对象赋值,如下例
在.h文件中声明如下形式方法:
- (id)initWithDic:(NSDictionary *)dic;
在对应.m文件中
- (id)initWithDic:(NSDictionary *)dic
{
self = [super
init];
if (self)
...
分类:
其他好文 时间:
2014-09-20 10:05:07
阅读次数:
125
创建视图UIView*view=[[UIViewalloc]initWithFrame:CGRectMake(220,100,100,100)];view.backgroundColor=[UIColorgreenColor];[self.windowaddSubview:view];[viewrelease];view1.centercenter属性获取视图的中心点.NSStringFromCGPoint将一个CGPoint类型的结构体变量转为字符..
分类:
其他好文 时间:
2014-09-20 02:27:16
阅读次数:
160
创建标签控制器UITabBarViewController*TVC=[[UITabBarViewControlleralloc]init];//初始化self.window.rootViewController=TVC;[TVCrelease];
分类:
其他好文 时间:
2014-09-20 02:25:36
阅读次数:
139
cell第二种方法(1)staticNSString*ideng=@"reuse";cell第二种方法(2)注册复用cell(cell的类型和标识符)(可以同时注册多个cell,方法相同,一定要保证标识符是不一样的)注册到了tableView的复用池[self.tableViewregisterClass:[TableViewCellclass]forCellReuseIdentifier:ideng]..
分类:
其他好文 时间:
2014-09-20 02:25:06
阅读次数:
158
创建集合视图UICollectionView*cView=[[UICollectionViewalloc]initWithFrame:CGRectMake(0,0,320,568)collectionViewLayout:flowLayout];cView.dataSource=self;设置dataSource代理cView.delegate=self;设置delegate代理[self.viewaddSubview:cView];集合视图cell的数量-(NSIn..
分类:
其他好文 时间:
2014-09-20 02:24:26
阅读次数:
141
1、创建类 1 class Book(object):2 def __init__(self,b): #定义构造器3 self.name=b4 print self.name5 def updatename(self,a):6 s...
分类:
编程语言 时间:
2014-09-19 20:59:15
阅读次数:
255
读王纯业前辈的笔记遇到个很坑的例子A namespace is a mapping from names to objects>>> class a: def __cmp__(self,other): if other > 0 : print 'other > 0' ;return -1 eli.....
分类:
编程语言 时间:
2014-09-19 18:59:45
阅读次数:
188
这个例子你可以看到可以再模板中编写python代码,也会粗略的编写第一个web.py程序了。步骤如下。1、首先看结构2.在testquery2.py中输入:import webimport osclass index: def GET(self): print "进入index"...
分类:
Web程序 时间:
2014-09-19 13:37:55
阅读次数:
138
Python使用中面向对象的语言,支持继承、多态;
定义一个Person类:
>>> class Person:
... def sayHello(self):
... print('hello')
...
>>> Person.sayHello(None)
hello
>>> Person().sayHello()
hello
可以修...
分类:
编程语言 时间:
2014-09-18 22:22:34
阅读次数:
255
#第一组 - (void)setDataDict:(NSDictionary *)dataDict;
这个方法优先执行
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style re...
分类:
移动开发 时间:
2014-09-18 20:46:44
阅读次数:
179