小编Jag*_*een的帖子

SearchBar从iOS 7中的标题视图中消失

我有一个tableview在我的应用程序中显示设备列表.当调用viewWillAppear时,我添加了self.searchDisplayController.searchBar as a subview to a headerView.然后我分配self.tableView.tableHeaderView = headerView.它看起来像这样: 在此输入图像描述

我向下滚动tableview,以便headerview不在视图中,然后通过点击单元格转到其他视图控制器.当我回到这个tableView时,向上滚动到headerView,searchBar变得不可见,但是在点击不可见区域时,searchDisplayController被激活并且取消按钮不起作用.这仅适用于iOS 7.为什么会这样? 在此输入图像描述
注意:当我回到tableViewController时,只有当headerView不在视图中时才会发生.

iphone objective-c uitableview uisearchbar ios7

25
推荐指数
2
解决办法
1万
查看次数

从UIView/NSObject类显示UIAlertController

我有,working iOS application 为了support iOS8,我正在取代UIAlertView/UIActionSheet with UIAlertController.

问题:
为了显示UIAlertController,我需要UIViewController类的presentViewController方法.
但是 UIAlertView中是从哪个是类显示器inherited的 UIView or NSObject,
我不能[self presentViewController...]为明显的原因的方法.

我的工作:
我尝试获取rootViewController表单当前窗口并显示UIAlertController.

[[[UIApplication sharedApplication] keyWindow].rootViewController presentViewController ...]
Run Code Online (Sandbox Code Playgroud)

但有一些旋转问题,如果我的当前视图控制器没有旋转支持,它将旋转,如果UIAlertController打开.

问题:
有没有人遇到同样的问题并且有安全的解决方案?
如果是,请给我一些例子或给一些指导

objective-c uialertview uiactionsheet ios8 uialertcontroller

24
推荐指数
5
解决办法
3万
查看次数

在iOS8中更改操作表弹出箭头

我正在使用UIAlertController.但是在iOS 8的iPad上,actionSheet显示了弹出式箭头.任何隐藏箭头的想法?

这是我的代码:

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"this is alert controller" message:@"yeah" preferredStyle:UIAlertControllerStyleActionSheet];

            UIAlertAction *cancelAction = [UIAlertAction
                                           actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel action")
                                           style:UIAlertActionStyleCancel
                                           handler:^(UIAlertAction *action)
                                           {
                                               NSLog(@"Cancel action");
                                           }];

            UIAlertAction *okAction = [UIAlertAction
                                       actionWithTitle:NSLocalizedString(@"OK", @"OK action")
                                       style:UIAlertActionStyleDefault
                                       handler:^(UIAlertAction *action)
                                       {
                                           NSLog(@"OK action");
                                       }];

            UIAlertAction *deleteAction = [UIAlertAction
                                           actionWithTitle:NSLocalizedString(@"Delete", @"Delete action")
                                           style:UIAlertActionStyleDestructive
                                           handler:^(UIAlertAction *action) {
                                               NSLog(@"Delete action");
                                           }];

            [alertController addAction:cancelAction];
            [alertController addAction:okAction];
            [alertController addAction:deleteAction];

            UIPopoverPresentationController *popover = alertController.popoverPresentationController;
            if (popover) {
                popover.sourceView = self.view;
                popover.sourceRect = self.view.bounds;
                popover.permittedArrowDirections = UIPopoverArrowDirectionUnknown;
            } …
Run Code Online (Sandbox Code Playgroud)

uiactionsheet ipad uipopovercontroller ios8 uialertcontroller

21
推荐指数
3
解决办法
2万
查看次数

如何在iOS8中以编程方式知道该应用程序是否具有摄像头访问权限

我的应用程序使用相机.在iOS8中,它们包含一个新的隐私设置,Camera用户可以在其中管理每个应用程序的相机权限.

问题:
如果用户不允许我的应用程序使用相机,那么我怎么知道我的应用程序无法访问相机.
就像我可以ALAssetsLibrary authorizationStatus用来发现photolibrary的状态或ABAddressBookGetAuthorizationStatus了解电话簿访问的状态.

问题:
如何知道我的应用程序是否在iOS8中具有相机访问权限,以便我可以提示用户允许相机访问我的应用程序?


我有照片展位的下面打印屏幕,与我的应用程序有相同的问题.

在此输入图像描述

在此输入图像描述

在此输入图像描述


当没有摄像头访问时,它只会显示黑屏,没有任何消息.

camera xcode6 ios8

14
推荐指数
1
解决办法
8641
查看次数

NSLocalizedString不适用于某些单词

我有英文,日文,韩文Localizable.strings文件.我无法从韩国文件中加载一些单词.我也检查过拼写,大写字母或小写字母.它是正确的.我已清理项目,重置模拟器并删除设备上的应用程序.对某些词语不起作用.我可以知道该怎么办吗?

localizable.strings ios

8
推荐指数
1
解决办法
1662
查看次数

无法在iOS8beta5中使用UIWebView打开PDF文件

我有工作项目,我在UIWebView中显示pdf文件在使用XCode5
在iOS8beta5中测试我的应用程序时,它无法正常工作
在日志中显示failed to find PDF header : '%PDF' not found


我使用下面的代码创建示例应用程序,它也有同样的问题
CODE:

self.myWebView.delegate = self;
NSString *path = [[NSBundle mainBundle] pathForResource:@"201" ofType:@"pdf"];
NSURL *targetURL = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
[self.myWebView loadRequest:request];
Run Code Online (Sandbox Code Playgroud)


我读了发行说明,Apple写道, Quicklook framework may did not display PDF file in some application 但他们没有提到任何关于UIWebView, 在此输入图像描述

参考


注意:
iOS8beta4中没有出现此问题.
在XCode6 + iOS8beta5中也会出现同样的问题.
我也检查不同的PDF文件,但有同样的问题.
问题:
1]有没有人为上述问题做过修复?
如果是,请提供一些示例代码.

xcode uiwebview xcode5 xcode6 ios8

7
推荐指数
1
解决办法
5792
查看次数

支持多接口但在主屏幕中具有单一界面,在iOS8 + iPhone中不起作用

我有如下的视图结构.

HomeView(Support only portrait mode)
 |
 |
 V
View1(Support all orientation)
 |
 |
 V
View2(Support all orientation)
Run Code Online (Sandbox Code Playgroud)

问题:
当我coming back from View2(Landscape mode)要HomeView调用popToRootViewController的方法,它没有调用supportedInterfaceOrientationsForWindow的方法App_Delegate并显示 在HomeViewlandscape mode.

图片:

在此输入图像描述

注意:
当我从View1(横向模式)返回到HomeView时,通过调用popToRootViewController方法调用supportedInterfaceOrientationsForWindow并且所有工作都很好,同样的事情不会发生.
如果我在iOS7中使用XCode6运行app,一切都很棒.

I read below question but it did not help me.
解雇模态视图控制器时如何保持显示视图控制器的方向?

在上面的链接matt说iOS8 stop support for friezing orientation,但我没有找到它,apple document 如果你有任何reference link关于这个改变请分享.

问题:
1]为什么委托方法supportedInterfaceOrientationsForWindow不调用.
2]是否可以使一个视图具有支持单一方向,而所有其他视图将支持所有方向.

谢谢

iphone orientation uiviewcontroller xcode6 ios8

7
推荐指数
1
解决办法
3388
查看次数

iOS7中的UIActionSheet在用户点击iPhone屏幕上的ANYWHERE时消失

我注意到iOS 7 a **UIActionSheet** automatically dismisses了user taps anywhere on the screen on an **iPhone**.这不是iOS 6中的情况,并且导致意想不到的效果.Is this a UI change? Bug? Is there a way to disable this?

来自iOS 7文档:
"如iOS人机界面指南中所述,您应该在iPhone上显示一个带有操作表的取消按钮,并在iPad上通过打开的弹出窗口显示这些操作页.否则,在iPad上,操作表会显示在弹出窗口中,并且用户可以通过点击弹出窗口外部取消操作表,在这种情况下,您不需要包含"取消"按钮."

这似乎表明,当点击操作表外的任何地方时,解雇的行为应仅适用于iPad.但现在这种情况发生在运行iOS 7的iPhone上,而不是在运行iOS 6的iPhone上运行

cocoa objective-c uiactionsheet ios7

5
推荐指数
1
解决办法
4302
查看次数

搜索iOS8 + XCode6后不显示标题视图

我有iOS7及以下的工作应用程序
我使用UISearchDisplayController进行表格搜索.

问题:
iOS8中未显示搜索标题视图后.
如下图所示.

搜索之前: 在此输入图像描述

搜索后: 在此输入图像描述


我尝试使用UISearchController,但也有同样的问题,我使用此代码链接

我在TPSMastreViewController.m中添加以下代码

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView *v = [[UIView alloc] init];
    v.backgroundColor = [UIColor greenColor];
    return v;
}
Run Code Online (Sandbox Code Playgroud)


我检查了那个委托 - (UIView*)tableView:(UITableView*)tableView
viewForHeaderInSection :( NSInteger)部分
在iOS8的情况下不调用.
编辑:
我所理解的只是调用UITableViewDataSource委托,UITableViewDelegate没有.
请注意,我在ViewDidLoad中设置了两个委托
问题:
1]是否是UI更改?
2]任何人都有补丁,以便委托方法强制调用.

uisearchdisplaycontroller xcode6 ios8 uisearchcontroller

5
推荐指数
1
解决办法
1118
查看次数

iOS8beta中的UIActionSheet崩溃

我有一些代码,只需点击按钮即可显示UIActionSheet.但是当我在iPad中使用XCode5.1 + iOS8beta构建它时它会崩溃.

下面是我用来显示UIActionSheet的代码.

UIActionSheet *tmpActionSheet = [[UIActionSheet alloc] initWithTitle:nil
                                                                delegate:self
                                                       cancelButtonTitle:@"Cancel"
                                                  destructiveButtonTitle:nil
                                                       otherButtonTitles:
                                     @"Ok",
                                     nil];
    [tmpActionSheet showInView:self.view];
Run Code Online (Sandbox Code Playgroud)

注意:
- 它完全适用于XCode6beta + iOS8beta(iPhone/iPad)
- 完美适用于XCode5.1 + iOS8beta(仅适用于iPhone)

异常的日志记录如下.

2014-06-23 15:54:04.860 ActionSheetDemo[680:191598] Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and …
Run Code Online (Sandbox Code Playgroud)

uiactionsheet ipad xcode5 ios8

4
推荐指数
1
解决办法
5349
查看次数

Setf变量到计算时间?

我想将变量设置为这样的计算时间

(setf a (time (+ 1 1)))
Run Code Online (Sandbox Code Playgroud)

但不是时间我得到这个

Break 1 [7]> a
2
Run Code Online (Sandbox Code Playgroud)

如何设置计算时间?

common-lisp

0
推荐指数
2
解决办法
78
查看次数