Tar*_*run 49 iphone cocoa-touch
我需要将nsindexpath var转换为NsInteger或简单地转换为int.例如:
 int rowIndex = [mGoogleBaseTable selectedRow];
 //mGoogleBaseTable is a NSTable type in Macdevelopement..
&&
int rowIndex = [mGoogleBaseTable indexPathForSelectedRow];
//mGoogleBaseTable is a UITableView type in Iphone (iOS)Development.
selectedRow返回NSInteger,但indexPathForSelectedRow返回NSIndexPath ..
请帮助我如何实现这一目标.
mvd*_*vds 128
如果
NSIndexPath *p = ... // some indexpath
然后
NSInteger row = p.row;
NSInteger section = p.section;
就这样!
在Swift中:
    let section: Int = indexPath.section
    let row: Int = indexPath.row
小智 7
我更喜欢这样做
NSNumber *selRow = [[NSNumber alloc] initWithInteger:indexPath.row];
| 归档时间: | 
 | 
| 查看次数: | 57165 次 | 
| 最近记录: |