iphone开发UIScrollView控件详解
摘要:首先实现UIScrollViewDelegate协议: #import @interface Activity01ViewController : UIViewController{ UIScrollView *myscrollview;}@property (nonatomic,retai...
阅读全文
posted @
2012-08-28 15:44
一位程序猿
阅读(219)
推荐(0)
iphone开发 tableview中cell的用法
摘要:添加数据源, 由三个函数来回答数据绑定的请求:numberOfSectionsInTableView, numberOfRowsInSection 和 cellForRowAtIndexPath. 用numberOfSectionsInTableView方法来返回table中有几个组. ...
阅读全文
posted @
2012-08-07 16:54
一位程序猿
阅读(209)
推荐(0)
iphone开发 使用TouchJSON框架 解析JSON
摘要:前提:配置到某具体的工程项目中复制TouchJSON框架源代码到自己的工程项目中,即将TouchJSON/Source目录及文件拷贝到项目中,在添加到工程项目中时确认选中“Copy items into destination groups folder(if needed)”项。转换JSON数据到对象——即解析,反序列化操作首先引入文件:#import "CJSONDeserializer.h"到项目具体源文件中。然后就可以将一个含有JSON数据的NSData对象进行转换成一个对象。NSData *theJSONData = /* 这里是一些JSON数据 */NSErro
阅读全文
posted @
2012-08-07 10:22
一位程序猿
阅读(222)
推荐(0)
Objective-c语言 字符串类NSMutableString用法
摘要:NSMutableString 是NSString 的子类,NSMutableString有很多方法,下面是总结的几种常用的方法:stringWithString:,类级构造方法创建NSString对象;insertString:,插入字符串,不会创建新的对象;appendString:,追加字符串,不会创建新的对象;deleteCharactersInRange:,在一个范围内删除字符串,不会创建新的对象;replaceCharactersInRange: withString:,替换字符串,不会创建新的对象。#import <Foundation/Foundation.h> i
阅读全文
posted @
2012-08-06 15:43
一位程序猿
阅读(213)
推荐(0)
iphone开发 如何在NSMutableDictionary中放入基本数据类型
摘要:NSMutableDictionary中只能放入对象,不能放入基本类型,这一点请参考java的Map系列。。。 然则NSInteger。。不是对象。。。。NSNumber才是,所以应该这样放的:NSInteger aInteger; NSMutableDictionary *dic=[[NSMutableDictionary alloc initWithCapacity:10]; [dic setObject:[NSNumber numberWithInteger:aInteger]forKey:@"TheKey"];
阅读全文
posted @
2012-08-04 11:44
一位程序猿
阅读(284)
推荐(0)