我使用下面的代码为搜索栏和搜索字段设置了背景图像.我正在使用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
在我的应用程序中有一个使用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) 重命名我的项目文件夹后,我收到以下错误消息:
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终端构建我的代码时它失败并且给我一个错误的'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终端.
当我在iOS7中运行我的应用程序时,我收到警告"'isa'已被弃用",我不知道如何修复此警告消息.请任何一个帮助.
array->isa = _JKArrayClass;
Run Code Online (Sandbox Code Playgroud) 我正在使用xCode 5.
我想在启动屏幕中专门隐藏状态栏.
我怎样才能做到这一点?
我尝试将' 基于控制器的状态栏外观 '设置为NO到info.plist文件中.通常从项目文件(iOS 7)中禁用"在应用程序启动期间隐藏".
我在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)在我的情况下不起作用.
任何的想法?
谢谢
自Xcode 5.0发布以来,CapabilitiesXcode项目的目标设置中出现了新版本的选项卡.它包括在项目App ID上配置权利的功能.其中一项功能是Data Protection.在目标设置中启用设置只不过是:
将"数据保护"权利添加到您的应用程序ID
如何在我的应用程序中实际实现数据保护?数据保护有哪些应用?它是否加密了我的所有应用程序数据?
我怎样才能显示内嵌代码块像this在Appledoc评论?
反引号只是在Xcode快速帮助面板中作为反引号读取.

我真的很想以NSStringFromClass某种方式编纂.
今天使用新的iTunes连接网页出现此错误.

我的xCode版本是

我的SDK是

我之前提交的内容已经过了旧的网页.现在,新网页一直在抱怨我的新版本出现此错误.有谁见过同样的问题?
xcode5 ×10
ios ×6
xcode ×3
ios7 ×2
objective-c ×2
afnetworking ×1
appledoc ×1
cocoapods ×1
cordova ×1
iphone ×1
jenkins ×1
jsonkit ×1
terminal ×1
uisearchbar ×1
uitableview ×1
xcode5.1 ×1