由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
MobileDevelopment版 - 昨天遇到一个iOS上的问题。
相关主题
写了个简单认明星的Android App,大家帮看看? (转载)请问下大家iOS开发都赚钱了嘛?
Best place to make money on mobile.iOS Developer Position Available (转载)
7.1 million daily downloads in March on the iOS App StoreApple Using M7 Motion Processor For Indoor Positioning With iOS 8
Best Practices for Great iOS UI DesignPhoneGap 3.5.0 No Longer Supports iOS 5 and Won’t Support WP 7
喜见开版,恭喜恭喜,iOS程序员路过cosmorning, 请问个问题
Research project Cider brings iOS apps to Android devices有没有iOS上OCR比较熟悉的大牛
祝贺一下iOS video - progressive download or streaming?
Rumor: Apple may debut ‘smart home’ platform for iOS at WWDC申请iOS Distribution的问题
相关话题的讨论汇总
话题: tableview话题: indexpath话题: detail
进入MobileDevelopment版参与讨论
1 (共1页)
r******n
发帖数: 81
1
我设计的一个app,最外面是一个UITabView,第一个Tab里放了一个UITableView,用来
显示一个列表,点击列表的一项,可以打开详细的View。一切都是好好的,从tab到
list到detail,然后返回list。
后来吧,我就加了一个search bar controller在那个TableView里面。先开始是search
的results里面的cell不能点击,后来看了网上的资料后加了关于segus处理的代码好了
,但是现在有个问题,就是从detail返回的时候会crash,报告的错误是navigation
subtree corupted。感觉是detail view被push了多次,但是又没有找到是哪里。
有没有遇到过相同情况的?
z*******n
发帖数: 1034
2
样例寄出来观摩观摩

search

【在 r******n 的大作中提到】
: 我设计的一个app,最外面是一个UITabView,第一个Tab里放了一个UITableView,用来
: 显示一个列表,点击列表的一项,可以打开详细的View。一切都是好好的,从tab到
: list到detail,然后返回list。
: 后来吧,我就加了一个search bar controller在那个TableView里面。先开始是search
: 的results里面的cell不能点击,后来看了网上的资料后加了关于segus处理的代码好了
: ,但是现在有个问题,就是从detail返回的时候会crash,报告的错误是navigation
: subtree corupted。感觉是detail view被push了多次,但是又没有找到是哪里。
: 有没有遇到过相同情况的?

r******n
发帖数: 81
3
这个问题已经解决了。我发现网上的好多教程都是错的,比如这个
http://www.raywenderlich.com/16873/how-to-add-search-into-a-tab
有个函数,例子是这样的:
#pragma mark - TableView Delegate
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(
NSIndexPath *)indexPath {
// Perform segue to candy detail
[self performSegueWithIdentifier:@"candyDetail" sender:tableView];
}
但我发现必须要这样才行:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(
NSIndexPath *)indexPath {
NSLog(@"lincai: %@ *** %@ *** %d", tableView,self.
searchDisplayController.searchResultsTableView, [indexPath row]);
if (tableView == self.searchDisplayController.searchResultsTableView) {
[self performSegueWithIdentifier:@"wordDetail" sender:tableView];
}
}

【在 z*******n 的大作中提到】
: 样例寄出来观摩观摩
:
: search

z*******n
发帖数: 1034
4
comments 里有说有问题,官方不会没例子把

【在 r******n 的大作中提到】
: 这个问题已经解决了。我发现网上的好多教程都是错的,比如这个
: http://www.raywenderlich.com/16873/how-to-add-search-into-a-tab
: 有个函数,例子是这样的:
: #pragma mark - TableView Delegate
: -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(
: NSIndexPath *)indexPath {
: // Perform segue to candy detail
: [self performSegueWithIdentifier:@"candyDetail" sender:tableView];
: }
: 但我发现必须要这样才行:

1 (共1页)
进入MobileDevelopment版参与讨论
相关主题
申请iOS Distribution的问题喜见开版,恭喜恭喜,iOS程序员路过
11%, or 57,563 developers develop for both iOS and Android.Research project Cider brings iOS apps to Android devices
寻找ISO开发合作祝贺一下
[教程]移动开发初学者的平台选择建议Rumor: Apple may debut ‘smart home’ platform for iOS at WWDC
写了个简单认明星的Android App,大家帮看看? (转载)请问下大家iOS开发都赚钱了嘛?
Best place to make money on mobile.iOS Developer Position Available (转载)
7.1 million daily downloads in March on the iOS App StoreApple Using M7 Motion Processor For Indoor Positioning With iOS 8
Best Practices for Great iOS UI DesignPhoneGap 3.5.0 No Longer Supports iOS 5 and Won’t Support WP 7
相关话题的讨论汇总
话题: tableview话题: indexpath话题: detail