我想知道是否有办法阻止iPad弹出窗口在弹出窗口外触摸屏幕时自动解除?如果没有,是否有某种类似于"popoverDidDismiss"的方法,我可以在弹出窗口被解除时调用它?
我有一个搜索数组的搜索栏,并用结果更新UITableView.表格视图是书籍列表,包括标题和作者:

现在,搜索栏只搜索标题,但我想让它搜索作者.这是我的搜索代码(我从http://blog.webscale.co.in/?p=228获得).
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
{
[tableData removeAllObjects];// remove all data that belongs to previous search
if([searchText isEqualToString:@""]||searchText==nil){
[tableView reloadData];
return;
}
for(NSString *name in dataSource){
NSInteger counter = 0;
//NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init];
NSRange r = [[name lowercaseString] rangeOfString:[searchText lowercaseString]];
if(r.location != NSNotFound)
[tableData addObject:name];
counter++;
}
//[pool release];
[tableView reloadData];
Run Code Online (Sandbox Code Playgroud)
}
dataSource是包含标题的NSMutable Array.包含作者的数组称为"作者"."tableData"是存储应该出现在屏幕上的单元格的数组(包含要搜索的术语的单元格).
非常感谢,
卢克
当我尝试构建使用可达性的项目时,我不断收到此错误(错误仅在我尝试实现可达性后出现):

我在互联网上阅读了其他一些帖子,但似乎没有任何效果.我添加了SystemConfiguration.framework(项目,构建阶段,+),但这不起作用(我已经在错误出现时添加了它).这是我实现文件的方式:
#import <UIKit/UIKit.h>
#import "Reachability.h"
@interface catalogDetailView : UIViewController{
}
-(void)checkNetwork;
@end
Run Code Online (Sandbox Code Playgroud)
然后在.m:
#import "catalogDetailView.h"
-(void)checkNetwork{
if ([self reachable]) {
NSLog(@"Connected to Network");
}
else {
NSLog(@"Connection Failed");
}
}
-(BOOL)reachable {
Reachability *r = [Reachability reachabilityWithHostName:@"apple.com"];
NetworkStatus internetStatus = [r currentReachabilityStatus];
if(internetStatus == NotReachable) {
return NO;
}
return YES;
}
Run Code Online (Sandbox Code Playgroud)
所以,如果你能帮助那将是惊人的!! 谢谢;)卢克