标签: xcode5

UISearchbar取消按钮自定义图像

我使用下面的代码为搜索栏和搜索字段设置了背景图像.我正在使用Xcode5 DP2和ios 7.

[[UISearchBar appearance] setSearchFieldBackgroundImage:[UIImage imageNamed:@"fieldBg"] forState:UIControlStateNormal];
[[UISearchBar appearance] setBackgroundImage:[UIImage imageNamed:@"searchBarBg"]];
Run Code Online (Sandbox Code Playgroud)

这段代码工作正常.但我也想自定义取消按钮图像.为此,我在viewWillAppear和searchBarTextDidBeginEditing中使用了以下代码.它在加载时第一次工作.

for (UIView *searchbuttons in _searchBar.subviews)
{
    if ([searchbuttons isKindOfClass:[UIButton class]])
    {
        UIButton *cancelButton = (UIButton*)searchbuttons;
        cancelButton.enabled = YES;
        [cancelButton setBackgroundImage:[UIImage imageNamed:@"cancelImage"] forState:UIControlStateNormal];
        break;
    }
}
Run Code Online (Sandbox Code Playgroud)

如果取消按钮单击一次,则自定义图像将不会出现在那里.我记录了_searchBar.subviews并得到了结果

po [_searchBar subviews]
<__NSArrayM 0x210b1120>(
<UISearchBarBackground: 0x1fd6ff80; frame = (0 0; 768 44); userInteractionEnabled = NO; layer = <CALayer: 0x1fdafaf0>>,
<UISearchBarTextField: 0x1fd6f2f0; frame = (5 -3; 758 50); text = ''; clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0x1fdc10b0>; …
Run Code Online (Sandbox Code Playgroud)

iphone uitableview uisearchbar uisearchdisplaycontroller xcode5

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

UICollectionView + iOS 7/Xcode 5 =断言失败

在我的应用程序中有一个使用flowLayout的UICollectionView,它在iOS 6中工作得非常漂亮,但在iOS 7中失败了.只要我看到包含我的UICollectionView的视图,就会发生以下情况:

*** Assertion failure in -[UICollectionView _createPreparedSupplementaryViewForElementOfKind:atIndexPath:withLayoutAttributes:applyAttributes:], /SourceCache/UIKit/UIKit-2903.2/UICollectionView.m:1401
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'the view returned from -collectionView:viewForSupplementaryElementOfKind:atIndexPath
(UICollectionElementKindSectionHeader,<NSIndexPath: 0x145f3f50> {length = 2, path = 0 - 0}) was not retrieved by calling -dequeueReusableSupplementaryViewOfKind:withReuseIdentifier:forIndexPath: or is nil'
(<UICollectionReusableView: 0x145f9400; frame = (0 0; 320 20); layer = <CALayer: 0x145f90c0>>)
Run Code Online (Sandbox Code Playgroud)

uncaught-exception uicollectionview ios7 xcode5

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

Xcode警告:"没有处理文件的规则"和"找不到目录"

重命名我的项目文件夹后,我收到以下错误消息:

    Warning: no rule to process file '/Users/cs/Documents/Xcode/Prototype/Prototype/Settings.bundle' 
of type wrapper.plug-in for architecture i386

    Warning: no rule to process file '/Users/cs/Documents/Xcode/Prototype/Prototype/DDMathParser/DDMathParser.h' 
of type sourcecode.c.h for architecture i386

    Warning: no rule to process file '/Users/cs/Documents/Xcode/Prototype/Prototype/AFNetworking/AFURLConnectionOperation.h' 
of type sourcecode.c.h for architecture i386

Directory not found for option '-L"/Users/cs/Documents/Xcode/Prototype/Prototype/../../../FacebookSDK/FacebookSDK.framework"
Run Code Online (Sandbox Code Playgroud)

什么可能出错?

xcode objective-c ios xcode5

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

在Xcode终端中运行时找不到'Cordova/CDVViewController.h'文件

因此,当我尝试从xcode终端构建我的代码时它失败并且给我一个错误的'Cordova/CDVViewController.h'文件找不到但是当我从xcode构建它时它正在构建就好了.

在我的Xcode中,我完成了整个Cordova子目录升级Cordova.当我跑名单时.这就是我在下面看到的:

xcodebuild -list

有关项目"myProject"的信息:

Targets:
    myProject

Build Configurations:
    Debug
    Release

If no build configuration is specified and -scheme is not passed then "Release" is used.

Schemes:
    myProject
    CordovaLib
Run Code Online (Sandbox Code Playgroud)

环境:Xcode5,OS 10.8.5

有什么我想念的吗?之所以我这样做是因为我试图通过jenkins来运行它.我认为这是一个jenkins问题,但后来我把它归结为没有看到CordovaLib的xcode终端.

terminal xcode jenkins cordova xcode5

7
推荐指数
2
解决办法
9101
查看次数

iOS 7:'isa'已弃用

当我在iOS7中运行我的应用程序时,我收到警告"'isa'已被弃用",我不知道如何修复此警告消息.请任何一个帮助.

array->isa      = _JKArrayClass;
Run Code Online (Sandbox Code Playgroud)

jsonkit ios7 xcode5

7
推荐指数
2
解决办法
6011
查看次数

在启动屏幕上删除状态栏

我正在使用xCode 5.

我想在启动屏幕中专门隐藏状态栏.

我怎样才能做到这一点?

我尝试将' 基于控制器的状态栏外观 '设置为NO到info.plist文件中.通常从项目文件(iOS 7)中禁用"在应用程序启动期间隐藏".

objective-c ios xcode5

7
推荐指数
2
解决办法
7222
查看次数

CocoaPods UIImageView + AFNetworking.h无法识别的选择器setImageWithURLRequest

我在Xcode 5上安装了带有CocoaPods的AFNetworking 2.1.0.

//ViewController.h
#import <AFNetworking/AFNetworking.h>
#import <AFNetworking/UIImageView+AFNetworking.h>
Run Code Online (Sandbox Code Playgroud)

在UIImageview上调用setImageWithURLRequest,应用程序失败并显示以下日志:

这是错误日志:

2014-02-07 11:55:19.984 OPS[1717:60b] *** Terminating app 
due to uncaught exception'NSInvalidArgumentException', 
reason: '-[UIImageViewsetImageWithURLRequest:placeholderImage:success:failure:]: 
unrecognized selector sent to instance 0x147b06d0'
Run Code Online (Sandbox Code Playgroud)

我已经找到了关于这个问题的一些讨论,但提供的解决方案(添加-ObjC -all_load)在我的情况下不起作用.

任何的想法?

谢谢

ios objective-c-category afnetworking cocoapods xcode5

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

Xcode数据保护

自Xcode 5.0发布以来,CapabilitiesXcode项目的目标设置中出现了新版本的选项卡.它包括在项目App ID上配置权利的功能.其中一项功能是Data Protection.在目标设置中启用设置只不过是:

将"数据保护"权利添加到您的应用程序ID

如何在我的应用程序中实际实现数据保护?数据保护有哪些应用?它是否加密了我的所有应用程序数据?

data-protection ios xcode5

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

Xcode快速帮助面板中的Appledoc内联代码?

我怎样才能显示内嵌代码块像this在Appledoc评论?

反引号只是在Xcode快速帮助面板中作为反引号读取.

在此输入图像描述

我真的很想以NSStringFromClass某种方式编纂.

xcode ios appledoc xcode5 xcode5.1

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

提交到App Store的应用和应用更新必须使用Xcode 5.1.1或更高版本以及iOS 7 SDK构建

今天使用新的iTunes连接网页出现此错误.

在此输入图像描述

我的xCode版本是

在此输入图像描述

我的SDK是

在此输入图像描述

我之前提交的内容已经过了旧的网页.现在,新网页一直在抱怨我的新版本出现此错误.有谁见过同样的问题?

itunesconnect ios xcode5

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