标签: xcode5

切换状态栏时如何重新定位导航/工具栏?

环境: iOS 6/7,Xcode 5中的AutoLayout.


我知道要调整NavBar以容纳状态栏,我将NavBar的背景图像设置为64位高(参考:WWDC 2013视频讲座#214).

在此输入图像描述

有没有一种方便的方法来切换这个状态栏的存在,同时重新定位 NavBar向上冲洗容器视图(反之亦然)?

添加了关注:我需要同时使用iOS 6和7.
iOS 6具有可靠的状态栏.因此,我必须在iOS 7中更改NavBar的背景图像以自动容纳状态栏......或者
......我是否正确我只能将状态栏设置为OPAQUE以在iOS 6/7中具有相似的定位环境?

uistatusbar autolayout ios7 xcode5

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

取消选中Autolayout后,如何恢复自动布局约束?

我有一个场景让我花了很长时间才在AL建立.最初它是在iOS6/Xcode4.6中完成的,但我将其迁移到iOS7/XCode5.

我正在摆弄移动导航栏并最终取消检查AL的另一个场景,即介绍场景.它完成了我想要的介绍场景,但是当我回到细节场景时,我在AL约束下完成了很多工作,我注意到现在当我选择它并转到尺寸检查器时,所有布局和导游走了.

这是因为我从ios6迁移还是因为我取消选中AL?

我能把它们还给他们吗?

autolayout ios7 xcode5

5
推荐指数
0
解决办法
99
查看次数

Xcode 5更新后RunUnitTests错误

我所做的只是将项目更新为Xcode 5.现在,当我尝试运行测试时,我收到此错误

if [ "${TEST_AFTER_BUILD}" = "YES" ]; then
    Error ${LINENO} "RunUnitTests is obsolete. To run unit tests for your target, use the Test scheme action in the Xcode IDE and the test action in xcodebuild."
    Note ${LINENO} "You can remove the Run Script build phase that invokes RunUnitTests from your unit test bundle target."
    # Exit with EX_UNAVAILABLE to indicate that this subsystem is unavailable.
    exit 69
fi
Run Code Online (Sandbox Code Playgroud)

哪里Error ${LINENO} "RunUnitTests is obsolete. To run unit tests for …

xcode unit-testing xcode5

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

使用应用程序的目标设备为iPad设置图标是iPhone

我将应用程序的目标设备设置为iPhone

在此输入图像描述

那么,我只能为iPhone设置图标,不能为iPad设置图标:

在此输入图像描述

因此,当我使用iOS7从iPad下载应用程序时,iPad上的图标默认为白色.

iphone ios xcode5

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

获取构建错误:转换为Universal app后无法写入路径

我有一个现有的iPhone应用程序(iOS6,ARC,Storyboards,XCode5),我试图转换为通用.我做了一个复制和过渡到iPad,然后做了一个构建.这就是我得到的:

编译失败.无法写入路径:/ Users/sd/Documents/iPhone Apps/SurveyorLevelingI/DerivedData/SurveyorLevelingI/Build/Products/Debug-iphoneos/SurveyorLevelingI.app/en.lproj/MainStoryboard.storyboardc

我已将DerivedData文件夹移动到项目,清理项目,关闭XCode 5,检查DerivedData文件夹(它的777)的权限都无济于事.

接下来要检查什么的想法?

ios ios-universal-app xcode5

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

在通过cocoapods更新KIF框架后运行以及测试Xcode工作区时出现链接器错误

我有一个Xcode工作区,我已经更新到KIF 2.0(在podfile中通过终端和pod'bIF'进行pod更新)之后我按照https://github.com/kif-中提供的说明配置了工作区.framework/KIF#configure-the-testing-target(使用Cocoapods部分安装).但是当我尝试执行项目以及运行我的测试目标时,它会抛出错误,

ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

我还检查了以下链接:https://groups.google.com/forum/#!msg/kif-framework/EilvCp2psZA/huUQ3sGpmwQJ.但问题仍然存在.

我该如何纠正?屏幕截图如下.在此输入图像描述

当我尝试使用iPhone 5运行它时,它显示5个链接器错误,例如

ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit, missing required architecture armv7s in file /Applications/Xcode.app/Contents/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit (2 slices)
Undefined symbols for architecture armv7s:
  "_OBJC_METACLASS_$_SenTestCase", referenced from:
      _OBJC_METACLASS_$_KIFTestCase in libPods.a(KIFTestCase.o)
  "_OBJC_CLASS_$_SenTestCase", referenced from:
      _OBJC_CLASS_$_KIFTestCase in libPods.a(KIFTestCase.o) …
Run Code Online (Sandbox Code Playgroud)

kif-framework cocoapods kif ios7 xcode5

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

sendAsynchronousRequest使UI冻结

downloadImages是一个按钮,每当我按下它时,一个微调器应该开始滚动,异步请求应该ping谷歌(以确保有连接)并且在收到响应后,我开始同步下载图像.

不知怎的,微调器不会去,似乎请求是同步而不是异步.

- (IBAction)downloadImages:(id)sender {

    NSString *ping=@"http://www.google.com/";

    GlobalVars *globals = [GlobalVars sharedInstance];
    [self startSpinner:@"Please Wait."];
    NSURL *url = [[NSURL alloc] initWithString:ping];
    NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:5.0];
    [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
        if (data) {
            for(int i=globals.farmerList.count-1; i>=0;i--)
            {
            //Definitions
            NSString * documentsDirectoryPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];

            //Get Image From URL
                NSString *urlString = [NSString stringWithFormat:@"https://myurl.com/%@",[[globals.farmerList objectAtIndex:i] objectForKey:@"Image"]];
            UIImage * imageFromURL = [self getImageFromURL:urlString];



            //Save Image to Directory
            [self saveImage:imageFromURL withFileName:[[globals.farmerList objectAtIndex:i] …
Run Code Online (Sandbox Code Playgroud)

xcode asynchronous uiactivityindicatorview ios xcode5

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

SDWebimage占位符中的活动指示器

如何SDWebImage使用占位符设置活动指示器UIImageView

iphone uiimageview ios7 xcode5

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

为什么Uncrustify在我的Objective-C块关闭括号之前强制占用空间?

我遇到了我的问题 - Uncrustify配置问题.我正在使用Xcode自动运行Uncrustify.

出于某种原因,Uncrustify似乎在块声明的关闭Brace之前添加了一个Space.

样本输入

 [_collectionView performBatchUpdates:nil completion:^(BOOL finished) {
 }];
Run Code Online (Sandbox Code Playgroud)

样品输出(注意forced关闭前的空格)

 [_collectionView performBatchUpdates:nil completion:^(BOOL finished) {
  }];
Run Code Online (Sandbox Code Playgroud)

期望的输出

 [_collectionView performBatchUpdates:nil completion:^(BOOL finished) {
 }];
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?

objective-c indentation uncrustify xcode5

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

无法在Xcode 5.1.1中运行单独的测试或测试用例

在Xcode 5中,通常在排水沟中每个测试方法的开头旁边都有这个复选标记,您可以将鼠标悬停并单击以运行该个案(或整个测试用例).在特定的Xcode安装上,我无法做到这一点 - 我只能通过单击Test Navigator窗格中的单个播放图标来运行整个测试套件.

不知道这是否可能是由配置问题引起的?

在此输入图像描述

tdd unit-testing xcode5

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