标签: xcode5

将补充标题视图添加到UICollectionView时出错

我实现补充标题视图时出现以下错误

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'no UICollectionViewLayoutAttributes instance for -layoutAttributesForSupplementaryElementOfKind: HeaderView at path <NSIndexPath: 0x9e82a40> {length = 2, path = 0 - 0}'
Run Code Online (Sandbox Code Playgroud)

这是创建标题视图的代码

- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
    static NSString * headerIdentifier = @"HeaderView";
    UICollectionReusableView *header = [collectionView dequeueReusableSupplementaryViewOfKind:headerIdentifier withReuseIdentifier:UICollectionElementKindSectionHeader forIndexPath:indexPath];
    return header;
}
Run Code Online (Sandbox Code Playgroud)

该错误发生在dequeueReusableSupplementaryViewOfKind方法中.

我在Collection View Controller的initWithCoder中添加了这两行

UINib *headerNib = [UINib nibWithNibName:@"MTCollectionHeaderView" bundle:nil];
[self.collectionView registerNib:headerNib forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HeaderView"];
Run Code Online (Sandbox Code Playgroud)

所以它确实有一个UI元素的引用.无论如何我都找不到在标题上设置布局.

我尝试将其添加到同一个集合视图控制器,但它从未点击此代码,因为我通过调试器确认

- (UICollectionViewLayoutAttributes *)layoutAttributesForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
    return [self.collectionViewLayout layoutAttributesForDecorationViewOfKind:kind atIndexPath:indexPath]; …
Run Code Online (Sandbox Code Playgroud)

objective-c uicollectionview uicollectionreusableview ios7 xcode5

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

iOS 7 UI更改:状态栏和导航控制器

我想更新iOS 7的应用程序.我在iOS 7上从app store安装了应用程序,看起来不错,用户界面非常完美.但是,当我从Xcode 5安装应用程序时,它会在状态栏下方显示导航栏和其他视图.我阅读了建议使用自动布局的iOS 7转换文档.我的应用目标是5.1及更高版本,自动布局仅支持iOS 6及更高版本.

请告诉我,我该如何解决它.

statusbar uinavigationbar ios7 xcode5

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

Xcode 5没有看到带有ios 6.1.3的设备

我在组织者看到我的设备有一个绿点.但我无法运行我的项目,因为目标菜单中没有iOS 6设备.

有了ios7,一切都还可以.

ios6 xcode5

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

架构armv7的未定义符号:"_ OBJCCLASS $ _ALAssetsLibrary"

我是这个网站的新手,我的名字是凯文格里菲斯,主要是在3D工作,我在去年在Unity3D上建立一个游戏,一切似乎都没问题,直到我必须升级我的软件.. :(这就是为什么我在这里寻求一些帮助,因为我真的不知道我的方式Xcode,我刚刚升级到上面,现在当我建立我得到这些2错误从Xcode任何人都知道如何纠正这些请我真的很感激帮助.

  Undefined symbols for architecture armv7: "_OBJCCLASS$_ALAssetsLibrary", referenced from: objc-class-ref in libScreenRecorder.a(MP4RecorderProcessor.o)

ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

谢谢.

xcode ios ios7 xcode5

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

iOS7中的UIMenuController

我实际上对iOS7中用于在UITableView上显示自定义上下文菜单的更改感到困惑.

我的代码如下:

- (void)viewDidLoad {
   UIMenuItem *deleteAction = [[UIMenuItem alloc]initWithTitle:NSLocalizedString(@"Delete", nil) action:@selector(delete:)];
   UIMenuItem *renameAction = [[UIMenuItem alloc]initWithTitle:NSLocalizedString(@"Rename", nil) action:@selector(rename:)];
   UIMenuController* mc = [UIMenuController sharedMenuController];
   mc.menuItems = [NSArray arrayWithObjects: renameAction, deleteAction, nil];
   [mc setTargetRect:CGRectMake(50.0, 50.0, 0, 0) inView:self.view];
   [mc setMenuVisible:YES animated:YES];
   [mc setMenuItems:@[deleteAction, renameAction]];
   [self becomeFirstResponder];

-(void)tableView:(UITableView*)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath*)indexPath withSender:(id)sender{
}

-(BOOL)tableView:(UITableView*)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath*)indexPath withSender:(id)sender {
if (tableView != nil && indexPath != nil)
{
    if (action == @selector(delete:)) {
            return YES;
        }
        if (action == @selector(rename:)) {
            return YES;
        } …
Run Code Online (Sandbox Code Playgroud)

contextmenu uimenucontroller ios7 xcode5

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

如何在xCode 5中删除Provisioning配置文件

我必须通过Ad-Hoc Distribution制作一个ipa,但是当我必须选择配置配置文件时,我有两个相同的配置,所以如何删除一个?我检查了我的证书,我在开发者苹果面板中只有一个.我已多次安装此配置文件,因为我已经有了新设备(我已经添加了超过2次的配置)有人可以帮助我吗?

这是图片:

在此输入图像描述

ios provisioning-profile xcode5

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

iOS部署的神秘故障目标在真实设备上

我在使用XCode 5时遇到了麻烦.昨天一切都很好.今天,当我尝试在iPhone 5或iPad Mini上运行我的应用程序时,出现以下错误:

iOS deployment target '7.0' for architecture 'armv7s' and variant 'normal' is greater than the maximum value '6.1.99' for the iOS 6.1 SDK.
Run Code Online (Sandbox Code Playgroud)

基础SDK和部署目标都是iOS 7(最新版本).我在两台设备上都安装了iOS7.当我尝试在iOS7的模拟器上启动应用程序时,一切都很好.我试图清理项目,重新启动XCode和MAC,查看project.pbxproj - 仍然无法理解是什么.所以,任何帮助都会非常棒!

基础SDK:

部署目标:

xcode ios ios7 xcode5

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

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
查看次数

更改UISearchBar的键盘颜色

我真的想改变键盘上"搜索"按钮的颜色,以匹配我的应用程序的主题.但如果这是不可能的,至少我想这样做

self.searchBar.keyboardAppearance = UIKeyboardAppearanceDark;
Run Code Online (Sandbox Code Playgroud)

但这不起作用,因为我猜,searchBar不是UITextField.那么我怎么能成功呢?我的意思是,改变键盘上"搜索"的颜色:是完全还是只是黑暗主题.

keyboard colors ios xcode5

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

无法创建新的客户端ID(适用于iOS sdk中的google plus signin)

我无法为我的iOS应用程序创建oAuth客户端ID.我的应用程序不是在Apple iTunes App Store中创建的,因为我无法输入AppStore ID.这里我附加两个屏幕截图.第一个是创建客户端ID表单,第二个是我的错误屏幕截图.如何解决这个问题?请帮帮我..

在此输入图像描述

我得到这样的错误....

iphone ios google-plus xcode5

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