はいできます。
あなたのテーブルビューは、あなたのテーブルビューのソースとしてNSMutableArrayのを使用するUITableViewDataSourceを実装する必要があります:あなたが持っている。このために(ここでは、このサンプルコードでの配列としてMyArrayというを使用して)
-(void)saveToHistoryArray:(NSString *)urlAsString {
[myArray addObject:urlAsString];
[self.tableView reloadData];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
/* insert error checking here */
return [myArray count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = [myArray objectAtIndex:indexPath.row];
return cell;
}
hiren、これを行うためのチュートリアルリンクを教えてください。 –
このチュートリアルを試すhttp://www.iphonesdkarticles.com/2008/10/sqlite-tutorial-selecting-data.html – Hiren