小编Ste*_*lin的帖子

当我尝试从UIWebview到Header文件创建一个插座时,Xcode崩溃

我目前正在运行OSX Yosemite的Macbook Pro上使用Xcode 5.我正在尝试从UIWebview创建一个插件到头文件.当我放开鼠标来创建连接时,Xcode冻结并崩溃.无论我做了什么,都会反复发生这种情况.我试过重启Xcode和我的Macbook.有没有其他人有这个问题或知道如何解决它?谢谢!

我已经从崩溃中添加了日志(我无法包含回溯,因为它超出了正文中的最大字符数)

    Process:               Xcode [1631]
Path:                  /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:            com.apple.dt.Xcode
Version:               5.1.1 (5085)
Build Info:            IDEFrameworks-5085000000000000~10
App Item ID:           497799835
App External ID:       520942841
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Xcode [1631]
User ID:               502

Date/Time:             2014-06-26 21:50:34.616 -0400
OS Version:            Mac OS X 10.10 (14A238x)
Report Version:        11
Anonymous UUID:        6D3E70F1-91EB-79A5-FAB6-2929D7E8A66F

Sleep/Wake UUID:       C86C5452-A655-43AA-9D11-92BE0F080F3E

Time Awake Since Boot: 11000 seconds
Time Since Wake:       510 seconds

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH …
Run Code Online (Sandbox Code Playgroud)

iphone xcode objective-c uiwebview ios

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

[NSObject:AnyObject]?' 在Xcode 6 Beta 6中没有名为'subscript'的成员

我正在Swift的Xcode 6 Beta 6中构建一个应用程序,我不断收到此错误:

[NSObject : AnyObject]?' does not have a member named 'subscript'
Run Code Online (Sandbox Code Playgroud)

我不知道如何解决这个问题.我试过看[NSObject:AnyObject]?在Xcode 6 beta 6中没有名为'subscript'的成员,但我仍然不明白如何解决这个问题.如果有人可以向我解释,那将是非常好的.如果你想看我的代码,这里是:

import UIKit

class TimelineTableViewController: UITableViewController {

 override func viewDidAppear(animated: Bool) {

    if ((PFUser.currentUser()) != nil) {

        //Create an UIAlertController if there isn't an user
        var loginAlert:UIAlertController = UIAlertController(title: "Sign Up/ Log In", message: "Please sign up or log in", preferredStyle: UIAlertControllerStyle.Alert)

        //Add a textView in the Log In Alert for the username
        loginAlert.addTextFieldWithConfigurationHandler({
            textfield in
            textfield.placeholder = "Your Username"
        }) …
Run Code Online (Sandbox Code Playgroud)

ios swift

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

有陀螺仪滚动图像的问题

iPad Air有一个奇怪的问题!,我的代码在iPad 3,iPad 4,iPhone 5S,iPod 5th Gen上运行良好,但在iPad上,我的图像自动滚动而无需用户旋转设备,这是我的代码:

 @property (strong, nonatomic) CMMotionManager *motionManager;


    self.mainScrollView.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);

    self.mainScrollView.bounces = NO;


    self.mainScrollView.userInteractionEnabled = NO;

    //set up the image view
    UIImage *image= [UIImage imageNamed:@"YOUR_IMAGE_NAME"];
    UIImageView *movingImageView = [[UIImageView alloc]initWithImage:image];
    [self.mainScrollView addSubview:movingImageView];

    self.mainScrollView.contentSize = CGSizeMake(movingImageView.frame.size.width, self.mainScrollView.frame.size.height);


    self.mainScrollView.contentOffset = CGPointMake((self.mainScrollView.contentSize.width - self.view.frame.size.width) / 2, 0);

    //inital the motionManager and detec the Gyroscrope for every 1/60 second
    //the interval may not need to be that fast
    self.motionManager = [[CMMotionManager alloc] init];
    self.motionManager.gyroUpdateInterval = 1/60; …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c ipad ios

8
推荐指数
1
解决办法
867
查看次数

为什么我的info.plist和.pch文件是红色的?

我创建了一个spriteKit游戏,后来在Xcode中更改了我的Project的名称.从那时起,我的.pch和.plist文件都是红色的.我会告诉你一个图像:

在此输入图像描述

该应用程序运行正常,并正确构建.我不确定这是不是坏事,所以这就是我问的原因.请告诉我如何解决这个问题.

xcode info.plist xcode6

6
推荐指数
1
解决办法
1163
查看次数

Swift 4尝试呈现视图不在窗口层次结构中的ViewController

我正在使用,swift 4并且尝试alertView使用进行用户注册时出错时尝试创建一个Firebase。我有一个IBActionfor sign up按钮,它将使用两个文本来注册用户textfields,一个用于电子邮件,一个用于密码。

我基本上是在尝试显示alertview注册过程中出现错误时(例如,有一个Empty)textfield

在此处输入图片说明

我将函数的屏幕快照附加到发生的地方。我知道我实际上遇到了错误,因为如果有一个print语句,则会输出一个错误。

无论是否存在错误,都不会显示警报视图,并且该应用程序会执行segue。

2019-01-15 21:40:26.368924-0500 Pronto [9036:225268]警告:尝试呈现其视图不在窗口层次结构中的视图

这是我现在显示的alertview的输出。我看过所有其他关于同一问题的文章,但似乎都没有。

uialertview ios firebase swift swift4

3
推荐指数
1
解决办法
5635
查看次数

为什么我的模拟器仍显示节点数和FPS?[SpriteKit]

我准备将我的游戏发布到应用程序商店.在我这样做之前,我想关闭节点数和FPS,并且不希望显示这两件事.我有一个GameScene.m和一个TitleScene.m.我试过view.showsFPS = NO;view.showsNodeCount = NO;在我的GameScene.m中运行正常.在我TitleScene.m我试过self.view.showsNodeCount = NO;self.view.showsFPS = NO;,但它仍然显示NodeCount和FPS.这是我的TitleScene.m代码:

#import "TitleScene.h"
#import "GameScene.h"

@implementation TitleScene

-(id)initWithSize:(CGSize)size {
    if (self = [super initWithSize:size]) {
        /* Setup your scene here */

        self.view.showsNodeCount = NO;
        self.view.showsFPS = NO;

        SKTexture *YellowLabelTexture = [SKTexture textureWithImageNamed:@"YellowLabel.png"];
        SKTexture *BlueLabelTexture = [SKTexture textureWithImageNamed:@"BlueLabel.png"];
        SKTexture *GreenLabelTexture = [SKTexture textureWithImageNamed:@"GreenLabel.png"];
        SKTexture *RedLabelTexture = [SKTexture textureWithImageNamed:@"RedLabel.png"];
        SKTexture *WhiteLabelTexture = [SKTexture textureWithImageNamed:@"WhiteLabel.png"];

        SKSpriteNode *background = [SKSpriteNode spriteNodeWithImageNamed:@"awsome.png"];
        background.size = CGSizeMake(640, …
Run Code Online (Sandbox Code Playgroud)

objective-c ios sprite-kit

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

键盘出现时如何移动视图

我有多个UITextFields,我需要在键盘出现时向上移动视图.但我只需要3个底部字段,并且不希望移动顶部其他字段的视图.我使用这个代码,但是当用户点击每个字段时它的移动视图,而我只需要在用户点击2个底部字段时移动视图

- (void)viewWillAppear:(BOOL)animated {
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
}

- (void)viewWillDisappear:(BOOL)animated {
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil];
}

#pragma mark - keyboard movements
- (void)keyboardWillShow:(NSNotification *)notification
{
    [UIView animateWithDuration:0.3 animations:^{
        CGRect f = self.view.frame;
        f.origin.y = -115.0f;  //set the -35.0f to your required value
        self.view.frame = f;
    }];
}

-(void)keyboardWillHide:(NSNotification *)notification
{
    [UIView animateWithDuration:0.3 animations:^{
        CGRect f = self.view.frame;
        f.origin.y = 0.0f;
        self.view.frame = f; …
Run Code Online (Sandbox Code Playgroud)

uitextfield ios

0
推荐指数
1
解决办法
231
查看次数