标签: ios8

UIImagePickerController没有在iOS 8中呈现

是否有其他人UIImagePickerController在iOS 8中遇到问题?下面的方法在iPad上的iOS 7中运行得非常好,但是当我尝试呈现选择器(最后一行)时,我在XCode 6(Beta 3或4)中运行时会出现以下错误.如果重要,那么sourceType的选择来自于在同一个地方呈现的alertView.

Warning: Attempt to present <UIImagePickerController: 0x7c0ae400>  on <CAGUCreateContactViewController: 0x7bf61a00> which is already presenting (null)
Run Code Online (Sandbox Code Playgroud)

打开imagePicker的方法.

- (void)openPhotoPicker:(UIImagePickerControllerSourceType)sourceType
{
    if ([UIImagePickerController isSourceTypeAvailable:sourceType]) {
        NSArray *availableMediaTypes = [UIImagePickerController availableMediaTypesForSourceType:sourceType];
        if ([availableMediaTypes containsObject:(NSString *)kUTTypeImage]) {
            UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
            imagePickerController.modalPresentationStyle = UIModalPresentationFullScreen;
            imagePickerController.sourceType = sourceType;
            imagePickerController.mediaTypes = @[(NSString *)kUTTypeImage];
            imagePickerController.delegate = self;

            self.imagePickerController = imagePickerController;

            if (sourceType == UIImagePickerControllerSourceTypeCamera) {
                [self presentViewController:self.imagePickerController animated:YES completion:nil];
            } else {                    
                if (self.popoverVC) {
                    [self.popoverVC dismissPopoverAnimated:YES];
                    self.popoverVC = …
Run Code Online (Sandbox Code Playgroud)

uiimagepickercontroller ipad ios ios8

56
推荐指数
4
解决办法
3万
查看次数

在WKWebView中禁用放大手势

我正在寻找一种方法来禁用WKWebView的iOS实现上的"捏缩放"放大手势.OS X有一个放大BOOL属性,但它似乎在iOS上不可用.

WKWebView.h

#if !TARGET_OS_IPHONE
/* @abstract A Boolean value indicating whether magnify gestures will
 change the web view's magnification.
 @discussion It is possible to set the magnification property even if
 allowsMagnification is set to NO.
 The default value is NO.
 */
@property (nonatomic) BOOL allowsMagnification;
Run Code Online (Sandbox Code Playgroud)

我也试过看看WKWebView的手势识别器,但这似乎是一个空阵列.我假设实际的识别器在组件的结构中更深(比较复杂,看起来很复杂),如果可能的话,宁愿不去挖掘它们.

我知道可能存在可能会禁用手势的黑客攻击(有选择地将手势传递给WebView,添加子视图以捕获捏手势等)但我总是发现那些引入滞后的事件并希望将实现保持为尽可能清洁/黑客.

webkit ios ios8 wkwebview

56
推荐指数
8
解决办法
4万
查看次数

由UISearchController在表头视图中呈现的UISearchBar在活动时动画太远

我正在使用UISearchController在tableview的标题视图中显示一个搜索栏:

...
self.searchController.hidesNavigationBarDuringPresentation = NO;            
self.presentingTVC.tableView.tableHeaderView = self.searchController.searchBar;
[self.searchController.searchBar sizeToFit];
self.presentingTVC.tableView.tableHeaderView = self.searchController.searchBar;
Run Code Online (Sandbox Code Playgroud)

(需要设置tableHeaderView属性两次,否则标题视图与第一行重叠,参见SO上的几个答案)

这是它看起来的样子,在不活动时完美地处于适当位置 非活动搜索栏位于正确位置

搜索栏应该在活动时保持原位 - 我不希望它向上移动以隐藏导航栏.但它意外地动画下来,在它和导航栏之间留下一个空白:

屏幕截图显示搜索栏动画太远了

这是一个 奇怪的搜索栏动画视频

如果我只是使用与UISearchController分开的搜索栏,则它在激活时不会显示相同的行为.

在我的呈现视图控制器中,我有self.definesPresentationContext = YES;self.navigationController.navigationBar.translucent = YES;,并且在IB中没有任何"扩展边缘"框是活动的(所有这些似乎都可能使搜索演示文件无法读取).

有谁知道如何阻止搜索栏动画下来?

uitableview uisearchbar ios ios8 uisearchcontroller

56
推荐指数
7
解决办法
4万
查看次数

Xcode 6.0.1没有显示内存使用情况

我从5.1升级到Xcode 6.0.1,当我运行我的应用程序时,我看不到调试导航器中的内存使用情况:

在此输入图像描述

我收到了记忆警告.是的,我可以在没有调试的情况下分析我的应用程序仪器,但只是在调试时看到直接内存使用对我有很大帮助 如何重新启用此功能?我重新启动了Xcode,重建了我的项目等,但我还是看不到内存使用情况.在设备上或模拟器上进行调试时都会出现此问题.当我单击内存选项卡时,我也会得到这个奇怪的"清零"仪表板:

在此输入图像描述

debugging xcode ios xcode6 ios8

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

滑动以删除单元格会导致tableViewHeader与单元格一起移动

tableViewHeaderUITableView在iOS 8中遇到了一个奇怪的错误.当在一个单元格上滑动以显示删除按钮(标准iOS滑动到删除)时,它会tableViewHeader随着正在滑动的单元格一起移动.当我轻扫单元格时,标题的移动方式与刷过单元格的方式相同.表视图中没有其他单元格被移动,只有标题和任何单元格被刷过.我在iOS 7上测试过这个没有遇到过这个问题.对我来说,这似乎是tableViewHeaderiOS 8中的一个错误,因为它只出现在这个版本中,似乎永远不会发生.我认为没有理由将标题包含在swipe-to-delete中.

下面只是一个模型.在应用程序中滑动删除是默认的iOS,没有自定义.

下面只是一个模型. 在应用程序中滑动删除是默认的iOS,没有自定义.

objective-c uitableview ios ios8

54
推荐指数
3
解决办法
7921
查看次数

在10.9上使用Xcode 6没有iOS 8.0模拟器可用

我还在10.10分区上安装并可以访问那里的iOS 8.0模拟器,但出于某种原因,当在10.9上执行相同的设置过程时,没有8.0模拟器可用,我只能选择使用"iOS设备".

我的命令行工具是Mavericks的最新工具,并在"位置"下选择.如果我更改部署目标,我可以启动7.1模拟器.唯一可能的异常值是我使用iRamDisk来管理模拟器和派生数据文件存储.但是,我已禁用此功能,卸载并重新安装Xcode无济于事.其他Xcode安装可能会有冲突吗?

非常感谢任何帮助或想法.谢谢.

ios-simulator xcode6 ios8

52
推荐指数
5
解决办法
2万
查看次数

从IOS 8在UIActionSheet中添加UIPickerView无法正常工作

我正在补充UIPickerView,UIActionsheet但它的工作完美,ios 7但没有工作ios 8.请帮我解决这个问题.

在这里我附上了截图.在此输入图像描述

谢谢

我正在使用以下代码.

UIActionSheet *actionSheet;
NSString *pickerType;

- (void)createActionSheet {

    if (actionSheet == nil) {
        // setup actionsheet to contain the UIPicker
        actionSheet = [[UIActionSheet alloc] initWithTitle:@"Please select" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil];
        actionSheet.backgroundColor = [UIColor clearColor];

        UIToolbar *pickerToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 40)];
        pickerToolbar.barStyle = UIBarStyleBlackOpaque;
        [pickerToolbar sizeToFit];

        UIImageView *imageObj = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 40)];
        imageObj.image = [UIImage imageNamed:@"header.png"];
        [pickerToolbar addSubview:imageObj];

        UIButton *cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom]; …
Run Code Online (Sandbox Code Playgroud)

iphone uipickerview uiactionsheet ios ios8

52
推荐指数
4
解决办法
3万
查看次数

iOS 8轮换方法弃用 - 向后兼容性

在iOS 8中,不推荐使用接口轮换方法.这包括:

  • willRotateToInterfaceOrientation:duration:
  • didRotateFromInterfaceOrientation:
  • willAnimateRotationToInterfaceOrientation:duration:

替代方法包括:

  • willTransitionToTraitCollection:withTransitionCoordinator:
  • viewWillTransitionToSize:withTransitionCoordinator:

如果未实现新的旋转方法,并且使用iOS 8 SDK编译项目,则视图控制器将不会接收调用 - 不推荐的旋转方法.

我担心的是:使用iOS 7 SDK构建的AppStore中的应用程序会发生什么变化?是否仍会在iOS 8设备上调用已弃用的旋转方法?

编辑:

仍然会调用旋转方法,但iOS 8中存在一些更改/问题/错误.

现在也是UIScreen面向接口的

rotation ios ios8

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

Xcode6:嵌入式二进制文件未使用与父应用程序相同的证书进行签名

添加Today App Extension Target后,我无法编译项目.以下是错误:

error: Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's.
Run Code Online (Sandbox Code Playgroud)

嵌入式二进制签名证书:iPhone开发人员:(开发者名称)(编号)

家长App签名证书:iPhone开发人员:(开发者名称)(编号)

但嵌入式二进制证书和父应用程序的证书是相同的.所以我现在很困惑......

xcode ios xcode6 ios8 ios-app-extension

52
推荐指数
10
解决办法
4万
查看次数

Xcode在iOS 8的Main()中抛出一个异常,带有'all exceptions'断点

我正在使用Xcode 6(通用汽车,我没有下载测试版),我正在为iOS 7+开发应用程序.对于我的所有项目,我只是打开了我曾经在Xcode 5中工作的相同项目.

在Breakpoint导航器中,我有All Exceptions断点.它被设置为Break: On Throw.现在,每次我运行我的应用程序(无论是在设备上还是在模拟器中),它都会停止return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));main()函数中的行上执行.

如果我按Play继续执行程序两次,程序运行正常.所以这并不妨碍我工作,但每次手动播放执行并重置我的编辑器都很烦人.

我喜欢我在Xcode中设置的行为(将当前编辑器带到执行暂停的位置),并且让All Exceptions断点成为重要的IMO.(所以我不想改变那些)

通过使用相同的环境运行相同的代码,对于iOS 7目标(再次,设备或模拟器),不会抛出异常.

有什么可能导致这种奇怪行为的线索?

xcode objective-c xcode6 ios8

52
推荐指数
2
解决办法
9349
查看次数