English 中文(简体)
动态阵列数据表
原标题:Popover tableview with dynamic array data

我试图重新使用人口表代码,这样,当用户触及加拿大纽特州时,加拿大各省(阿尔伯塔省、不列颠哥伦比亚省......)就展示;当用户触及美国各州时(Alabama、阿拉斯加......)。 问题在于,在加拿大纽特州之后,我袭击了美国纽特州时,美国前12个州仍未被加拿大13个省/领土展示出来。

I am following the code here

http://www.raywenderlich.com/1056/ipad-for-iphone-developers-101-uipopovercontroller-tutorial

but modifying the setColorButtonTapped code to take an array so I can reuse the code for different arrays

- (IBAction)setColorButtonTapped:(id)sender withData:(NSArray *) data {
    if (_colorPicker == nil) {
        self.colorPicker = [[[ColorPickerController alloc] 
                             initWithStyle:UITableViewStylePlain] autorelease];
        _colorPicker.delegate = self;
        self.colorPickerPopover = [[[UIPopoverController alloc] 
                                    initWithContentViewController:_colorPicker] autorelease];               
    }
    [self.colorPickerPopover presentPopoverFromBarButtonItem:sender 
                                    permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
_colorPicker.tableList = [data copy];
// I defined a property NSMutableArray *tableList
// I think the problem is with the way I copy the data  }

关注该法典的内容。

感谢你事先提供帮助。

Joe

问题回答

Joe,我猜想许多人会告诉你,你更具体一点。 然而,我看上去的一件事是,你似乎不把你的“条码”。

基本上,在你复制新数据之前,尝试检查数据有无。 如果是,删除旧数据并复制新数据。





相关问题
Duplicate a table row with UITableViewCellEditingStyleInsert?

I have an application based on the Core Data Books example, and I m coming to the conclusion that I need to give the user the ability to duplicate a row in the table - a set of data - and then let ...

Copy/Paste in Windows Forms with custom controls

I am writing a small application in C# using Windows Forms. I want to let my users copy and paste data around the application and there are some custom controls, for example one is a colour picker. ...

Copying only non-existent files in ant

I m deploying my project to a web-server to be deployed with java Web Start. However, Web Start uses modification date to figure out whether to download the resources again (by default). What I want ...

Copying one FlowDocument to Second FlowDocument

How can i copy the contents of one FlowDocument to another FlowDocument below is what i tryed foreach (var blk in fd1.Blocks) { fd2.Blocks.Add(blk); } fd1 is FlowDocument1 and fd2 is ...

emacs command to append to ring

How can I make an emacs command to copy text (to the kill ring) by appending? (Why is there no such built-in command?) Appending Kills mentions C-M-w (`append-next-kill ) which allows me to append ...

about get value from sqlite

Code Sample: NSString *str= [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectStatement, 1)]; Test *t=[[Test alloc] init]; t.str=[str copy]; // why use "copy" here? [str release];

Insert into an STL queue using std::copy

I d like to use std::copy to insert elements into a queue like this: vector<int> v; v.push_back( 1 ); v.push_back( 2 ); queue<int> q; copy( v.begin(), v.end(), insert_iterator< queue&...

热门标签