摘要: 在对table中每一个cell进行初始化时候,是下面这个函数- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *MyIdentifier = @"MyIdentifier"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; if (cell == nil) {cell 阅读全文
posted @ 2012-11-08 12:13 凰浴浴的CodingBlog 阅读(387) 评论(0) 推荐(0)
摘要: 比较字符串我想你很快就会在程序中需要比较两个字符串是否相等。在C中,你知道可以使用strcmp(string1,string2)函数:charstring1[]=“Yo”;charstring2[]=“Yo”;if(strcmp(string1,string2)==0){//dothefollowingcode}条件表达式的结果将会是真,从而执行if语句大括号中的代码。在Cocoa中,也是相类似的。记住,当我们声明一个字符串时:NSString *aString;变量aString并不真正包含一个字符串对象—它是指向内存中字符串对象的指针。我们称呼这类变量的另一个名称是对象标识符,因为它是标识 阅读全文
posted @ 2012-11-08 03:06 凰浴浴的CodingBlog 阅读(175) 评论(0) 推荐(0)