草庐IT

tableviewController

全部标签

ios - 如何在 Swift 中从不同的 ViewController 重新加载 TableView 中的数据

在ViewController中,我正在尝试在另一个ViewController的TableView中重新加载数据,如下所示:(self.presentedViewControlleras!tableViewController).table.reloadData()其中tableViewController是TableViewController中的类(我知道这不是大驼峰式),table是TableView。好吧,这样做会产生“fatalerror:在展开可选值时意外发现nil”,我想这是有道理的,因为“presentedViewController”尚未加载。我也试过这个:(sel

ios - 以编程方式使用 swift UITableView

我正在尝试使用swift以编程方式创建一个简单的tableView,所以我在“AppDelegate.swift”上编写了这段代码:funcapplication(application:UIApplication,didFinishLaunchingWithOptionslaunchOptions:NSDictionary?)->Bool{self.window=UIWindow(frame:UIScreen.mainScreen().bounds)vartvc:TableViewController=TableViewController(style:UITableViewStyl

ios - 以编程方式使用 swift UITableView

我正在尝试使用swift以编程方式创建一个简单的tableView,所以我在“AppDelegate.swift”上编写了这段代码:funcapplication(application:UIApplication,didFinishLaunchingWithOptionslaunchOptions:NSDictionary?)->Bool{self.window=UIWindow(frame:UIScreen.mainScreen().bounds)vartvc:TableViewController=TableViewController(style:UITableViewStyl

ios - 将 UITableView 行从一个 tableviewController 发送到另一个

我想将位于indexPath.row的UITableViewCell从一个Controller发送到另一个Controller。我可以使用removeObjectAtIndex删除行,但无法将删除的行发送到另一个Controller。我试图将删除的行存储在一个Controller的NSMutableArray中,但不知道如何在另一个Controller中填充它。下面是代码-ViewController*view=[self.storyboardinstantiateViewControllerWithIdentifier:@"ViewController"];view.anotherv

ios - 如何在应用程序重新运行时从 ViewController 保存数据并将其加载到 TableViewController?

所以我有一个类“WishListItem”、一个TableViewController和一个ViewController。我在保存大块数据并从TableViewController中检索它时遇到困难?如何有效地做到这一点?这是我的ViewController,它有一个prepareForSegue将数据存储到我的WishListItem类。-(void)prepareForSegue:(UIStoryboardSegue*)seguesender:(id)sender{NSDate*myDate=self.targetDatePicker.date;NSDateFormatter*da

ios - willDisplayHeaderView 未在 TableViewController 中调用

为什么在TableViewController中没有调用willDisplayHeaderView?-(void)tableView:(UITableView*)tableViewwillDisplayHeaderView:(nonnullUIView*)viewforSection:(NSInteger)section{//}编辑:和heightForHeaderInSection-(CGFloat)tableView:(UITableView*)tableViewheightForHeaderInSection:(NSInteger)section{//}弃用?XCODE版本9.0

ios - 在 UINavigationController 中的 TableViewController 中消失 UISearchController

我制作了一个带有UISearchBar作为表头的UITableViewController。然后我将这个ViewController嵌入到UINavigationController中,作为RootViewController。现在,当我点击搜索栏时,搜索栏似乎消失并显示白屏。出现键盘,但没有搜索栏。表格View可以滚动,但搜索栏只是消失了。当我实现此UITableViewController而不导航Controller时,它工作得很好。但是关于导航Controller的一些事情让一切都变得乏味起来。 最佳答案 我遇到过有时会发生的

使用 Core Data 和 NSFetchedResultsControllers 使用 TableViewControllers 搜索后添加新条目时 iOS 应用程序崩溃

我的应用程序遇到了一个有趣的问题。首先,该应用程序的前提很简单:导航栏中带有加号按钮的表格ViewController;用户按下加号,ViewController以模态方式出现。用户添加名称、金额和事件,按下保存并通过NSFetchedResultsController和核心数据,该信息成功填充回TableViewController。效果很好。TableViewController还使用SearchBar,以便用户可以在TableView中搜索名称或事件。问题是:如果用户在表格View中搜索一个条目(并且没有取消搜索),然后按添加按钮添加一个条目,填写信息并按保存,应用程序崩溃并出现

ios - 在 Storyboard 中调整 TableViewController 的 TableView 大小

我有一个用Storyboard创建的UITableviewController。现在我想改变表格View的X和Y坐标(具体来说我想把表格View往下放一点)。Storyboard中有一个选项,我可以在其中设置此参数或更改表格View的大小?我找不到了我试过查看尺寸检查器,但看起来X和Y参数被禁用了。 最佳答案 UITableViewController的tableview是主视图,所以我们不能在storyboard中调整它。如果你想调整大小试试这个。在你的UITableViewController中。-(void)viewDidAp

iphone - three20 - TableViewController 内存警告给出黑屏,如何修复?

这让我抓狂。我正在使用three20的TTTableViewController,当我收到内存警告时,屏幕变白。现在,在阅读了three20googlegroup后,tableView似乎已发布。但是,我一辈子都无法弄清楚是否是这种情况,然后重新创建它。我使用以下内容是因为我认为它可以解决问题,但它似乎不满足if语句:-(void)viewDidAppear:(BOOL)animated{[superviewDidAppear:animated];//Ifwedon'thaveadatasourceweneedtoresetitif(!self.dataSource){//Create