当前位置:首页 > 技术心得 > 正文内容

NSTableview从mutable array获取数据

xjtudll12年前 (2014-07-03)技术心得10320

参考资料:

可以使用以下的方法
– numberOfRowsInTableView:
– tableView:objectValueForTableColumn:row:
– tableView setObjectValue:object forTableColumn:row

举例如下:
 
dataArray是一个Mutable Array
 

- (NSUInteger)numberOfRowsInTableView: (NSTableView*) aTableView{
    return [dataArray count];
}

- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row{
    return [dataArray objectAtIndex: row];
}

- (void)tableView:(NSTableView *)tableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
    NSString *string = object;
    [dataArray replaceObjectAtIndex:row withObject:[[NSString alloc] initWithFormat:@"%@", string]];
    [ntpTableView reloadData];
}


扫描二维码推送至手机访问。

版权声明:本文由鸟的天空发布,如需转载请注明出处。

本文链接:http://www.xjtudll.cn/Exp/327/

标签: cocoa
分享给朋友:

“NSTableview从mutable array获取数据” 的相关文章

phpstorm调试XDebug 超时问题

phpstorm+xdebug+apache 调试代码时,一分钟就超时处理: 修改配置文件:1.php.ini 设置xdebug, 增加 xdebug.remote_cookie_expire_time = 3600max_execution_time=3600max_input_time=3600...

BOS自定义单据对应模块后台查找

bos数据大量更改新增之后,会出现数据存放位置忘记的情况,下面为单据及单据转换后台查询对应模块的语句,如有需要可参考查询--自定义单据忘记存放在哪个模块可使用以下语句进行查询SELECT it.FID,it.FFunctionID as FSubSysID,it.FNa...

android 停止Handler

mHandler.removeCallbacks(mRunnable); 或者 mHandler.removeMessages(what); mHandler.removeCallbacksAndMessages(null) 参数为null的话,会将所有的Callbacks和Messages全部清除...

CRC除法

所有CRC原理介绍中,都会提到CRC除法。CRC除法与算术除法有什么区别呢?下面举个实例来说明。 以下是120 ÷ 9 来举例说明CRC除法: 120 = 1111000 B 9 = 1001 B  ...

Quartus II Warning: Found 6 node(s) in clock paths which may be acting as ripple and/or gated clocks

Quartus II编译某代码之后,老是提示如下warning: Warning: Found 6 node(s) in clock paths which may be acting as ripple and/or gated clocks -- node(s) analyzed as buf...

object-c 函数前面加号和减号 +和-的区别

简单来说就是: 加号 是可以通过类名直接调用这个方法; 减号则要实例化逸个对象,然后通过实例化的对象来调用该方法!! 使用的时候请注意。...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。