我需要增加一个<代码>可读,而且应当能够点击数。 www.un.org/chinese/ecosoc 缩略语
我知道,你必须为此使用<代码>NStable Dictionary。 但我不理解如何做到这一点。
请允许我指出一个好的理论或为我提供一些样本。
我需要增加一个<代码>可读,而且应当能够点击数。 www.un.org/chinese/ecosoc 缩略语
我知道,你必须为此使用<代码>NStable Dictionary。 但我不理解如何做到这一点。
请允许我指出一个好的理论或为我提供一些样本。
You will have to use a delegate method for that.
First make sure your table view is set up well (delegate and datasource) and then
implement delegate s :
(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
.
You access the selected row index with : [indexPath row]
.
And then you can store this value.
THere在Cocoa With Love上担任职务,你可能会发现这一点。
定点,但原则相同。
It really depends on your data model. First of all you need a NSMutableArray not a NSMutableDictionary;
//declare an NSMutableArray in the interface
@interface Class : SuperClass {
NSMutableArray *_arrayWithMySelectedItems;
}
//in one of your init/preparation methods alloc and initialize your mutable array;
- (void)viewDidLoad {
[super viewDidLoad];
_arrayWithMySelectedItems = [NSMutableArray alloc] init];
}
//now before you forget it add release in your dealloc method
- (void)dealloc {
[_arrayWithMySelectedItems release];
[super dealloc];
}
//add this following code to your didSelect Method part of tableView s delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//if you have only one category, you will probably have something like this
[_arrayWithMySelectItems addObject:[dataModelArray objectAtIndex:indexPath.row];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
您可在这一方法中使用NSMutableDictionary
:
(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSMutableDictionary *dict = [NSMutableDictionary alloc] init];
[dict setObject:[NSString stringWithFormat:"%@", cell.Label.text] forKey:[NSString stringWithFormat:"Key%d", indexPath.row]];
}
然后,宣布在座标的斜体内进行扼杀,然后根据你的愿望,将座标=[人口稠密阵标AtIndex:indexpath.row];然后添加到字典或可变阵列中。
I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...
HI, In our application i am using corelocationframework when opening application a alert for allow and dont allow.when clicking on the allow for current location we will show current location.When ...
Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...
我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......
我希望我与四舍五入的累进角进行网上讨论。
我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。
We have a restaurant table that has lat-long data for each row. We need to write a query that performs a search to find all restaurants within the provided radius e.g. 1 mile, 5 miles etc. We have ...
I like to write bash shell scripts on my iPhone, put them in an app folder with an icon, plist, etc., so they execute like apps by tapping their icon on SpringBoard. This is not interactive like ...