首先使用selectRowAtIndexes: 选择行数,滚动的话tableview的superview时scrollview,scrollview能够滚动到某个position 那么就要计算这个position position = table row height * index,就获得滚动的位置了。
Q:在使用SLQite3调用sqlite3_bind_text函数时须要使用char *类型的参数,在sqlite3_column_text函数中须要使用char *类型的返回值,如何将字符串对象在NSString和Char *之间进行转换?
A:
将NSString转换成char *:[NSString UTF8String]
将char *转换成NSString:[NSString stringWithUTF8String:]
例如:
//=======NSString to char *==============

NSString *updateSign =
@"AAAA";

sqlite3_bind_text(statement, 1, [updateSign UTF8String], -1, NULL);
//=========char * to NSString============

columnName.text = [NSString stringWithUTF8String:(
char *)sqlite3_column_text(statement, 1)];
Q:如何解决在iPhone程序开发中常遇到“unrecognized selector sent to instance”的问题?
A:形成该问题的大部分缘由是
对象被提早release了,在不但愿它release的状况下,指针还在,对象已经不在了。主要是由于init初始化
函数中,
没有对属性使用self.[属性]=xxxx的方式赋值,而是直接对属性所对应的私有变量进行赋值,致使属性对象没有retain而提早释放。解决方法,使用self.[属性]=xxxx语句对属性赋值便可。
Q:我想计算两个NSDate的数据相差几天几个小时几分几秒怎么办阿?
A:

NSTimeInterval time = [date1 timeIntervalSinceDate:date2];
time是date1和date2的秒间隔,大于零说明date1比date2晚,反之。。。。
要获得几天几分几秒的,算算就出来了。
Q:怎么实现一个登陆页面,在登陆成功后跳转到另外一个页面(我想实现先是一个登陆界面点击一个登陆按钮载跳转到UITabBarController界面怎样处理啊 )?
A:能够尝试下面的方法:
1,在MainWindow.xib里放入LoginViewController和UITabBarController。
2,Delegate里application加入下记代码。

[window addSubview:tabBarController];

[window addSubview:loginViewController];
3,Login成功后,在LoginViewController里加入下记代码。

[self.view removeFromSuperview];
Q:iPhone中如何实现相似于Timer的定时操做?
A:相似下面代码实现:

timer = [NSTimer scheduledTimerWithTimeInterval:(3) target:self selector:@selector (onTimer:) userInfo:nil repeats:YES];
- (
void)onTimer:(NSTimer*)timer {
//处理

......

}
Q:UITableViewCell 里 有个 UITextField当点击UITextField时会出现软键盘,为了返回UITextField的值,我在valueChanged事件绑定了 rootViewController 的
-(IBAction) textAction : (id) sender;
但是我同时须要知道该Cell 的 indexPath.row 该怎么作?
A:有两种方法:
方法1
先获取UITextField所在的Cell.

NSIndexPath *path = [tableView indexPathForCell: (UITableViewCell *) [ (UITextField *)sender superview] ];
方法2
首先,在table loadview 制造cell的时候在cell.tag和textField.tag 设个值

tmpcell.tag = 3;

tmpcell.textField.tag = 3;
而后事件启动的时候这样

- (IBAction)textAction:(id)sender

{

NSInteger tag = [sender tag];

NSIndexPath *indexPath = [self.tableView indexPathForCell: (UITableViewCell *)[self.tableView viewWithTag:tag]];

[[[rawElementsArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row] setValue:[sender text] forKey:
@"value"];

}
[待续... ...]