【发布时间】:2012-10-01 12:12:52
【问题描述】:
我目前在 cellForRow 方法中,每行前面都有一个按钮。
CellForRow:
JSONDecoder *decoder=[[JSONDecoder alloc] initWithParseOptions:JKParseOptionNone];
NSMutableArray *json=[decoder objectWithData:myData]; {This has a list of items in the dictionary format}
NSDictionary *dict=[json objectAtIndex:indexPath.row];
NSString *status=[dict valueForKey:@"status key in json"];
"dict" can be represented as:
{
status key in json="approved";
name="abc";
type="resourceName";
},
{
status key in json="rejected";
name="xyz";
type="bus";
},
{
status key in json ="pending";
name="pqr";
type="resource";
}...and so on .
打印状态将为我提供所有行的状态。 得到正式认可的 被拒绝 待定
但我只需要我要单击该按钮的特定行的状态。这是因为当我单击该行前面的按钮时,我需要将每一行的状态分别发送到 buttonPressed 方法。我不想在 didSelectRow 方法中这样做。
如何获取特定行的 indexPath.row(单击该行),以便在单击与该特定行对应的按钮时编写方法?
【问题讨论】:
-
您的问题解决了吗?有什么问题吗?
标签: iphone objective-c xcode ios5