我有一个ini_set('session.save_handler', 'files');
session_save_path(dirname(__FILE__).'/tmp');
session_start();
$_SESSION['Test'] = "info";
$_SESSION['Test2'] = "more info";
$orig = session_id();
session_regenerate_id();
echo "Original session is ".$orig."<br>";
echo "Regen session is ".session_id()."<br>";
,其中包含两个自定义单元格xib文件(一个包含uitableview
,第二个包含uilabel
)。
我做什么 -
1.我将tableview附加三个单元格(uibutton
- 第一个xib)
2.然后我加载第四个单元格(带uilabel
- 秒xib)
uibutton
文本,同时也从另一个数组中获取uilabel
。
我的目标是 - 点击uibutton currentTitle
后,它应附加1.下一个单元格数组uibutton
和2. 1个单元格uilabel
来自相应数组。
以下是uibutton
tableview
我知道我应该使用像func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return linesmain["start"]!.count + 1
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
if(indexPath.row < someTagsArray.count){
var cell:TblCell = self.tableView.dequeueReusableCellWithIdentifier("cell") as! TblCell
cell.lblCarName.text = linesmain["start"]![indexPath.row]
return cell
} else {
var celle:vwAnswers = self.tableView.dequeueReusableCellWithIdentifier("cell2") as! vwAnswers
celle.Answer1.setTitle(answersmain["start"]![0], forState:UIControlState.Normal)
return celle
}}
这样的东西,但我不知道如何在我的情况下正确实现它。
答案 0 :(得分:1)
试
tableView.beginUpdates()
var indexPath = NSIndexPath(forRow:row,inSection:0)
var indexPath2 = NSIndexPath(forRow:row,inSection:0)
self.tableView?.insertRowsAtIndexPaths([indexPath,indexPath2], withRowAnimation: UITableViewRowAnimation.Left)
tableView.endUpdates()
参考Apple swift示例:https://developer.apple.com/library/ios/samplecode/Lister/Listings/Swift_ListerToday_TodayViewController_swift.html