2014-10-06 43 views
0

我是新开发的iOS。 我有这样的错误...“线程1:断点1.1”。如何修复这个错误:如何解决Xcode中的线程错误?

enter image description here

这是头(.h)文件

#import <UIKit/UIKit.h> 

    @interface ViewController : UIViewController<UITextFieldDelegate> 

    @property (weak, nonatomic) IBOutlet UITextField *passwordTextField; 
    @property (weak, nonatomic) IBOutlet UITextField *usernameTextField; 
    - (IBAction)tekan:(id)sender; 

    @end 

这是实现(.M)文件

// 
// ViewController.m 
// Example1 
// 
// Created by Andika Kurniawan on 10/6/14. 
// Copyright (c) 2014 Indonative. All rights reserved. 
// 

#import "ViewController.h" 

@interface ViewController() 

@end 

@implementation ViewController 

@synthesize passwordTextField; 

- (void)viewDidLoad { 
    [super viewDidLoad]; 
    self.passwordTextField.delegate = self; 
    self.usernameTextField.delegate = self; 
} 

- (void)didReceiveMemoryWarning { 
    [super didReceiveMemoryWarning]; 
    // Dispose of any resources that can be recreated. 
} 


- (IBAction)tekan:(id)sender { 

    UIAlertView *helloEarthInputAlert = [[UIAlertView alloc] 
             initWithTitle:@"Name!" message:[NSString stringWithFormat:@"Message: %@", passwordTextField.text] 
             delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; 
    // Display this message. 
    [helloEarthInputAlert show]; 
} 
@end 

上面的代码是我的源代码。 我想修复线程错误,,但我混淆......因为我不知道我的源代码中存在什么错误。 在这个应用程序的插座和操作没有错误

+0

我想你只需点击其中写有34行的34的蓝色标记。这是一个断点,导致您的代码在第34行停止。 – divyenduz 2014-10-06 17:09:50

回答

4

enter image description here您不要有错误一个破发点。你只有一个断点。按下调试菜单中的play(控制台上方和内存中的值),应用程序应继续执行。

+0

谢谢,你的回答已完成 – AndikaK 2014-10-06 17:16:43

+2

请标记为正确的!谢谢 – 2014-10-06 17:17:47

0

我想你只需要点击其中写34行34的蓝色标记。这是导致你的代码停止线34

感谢

+0

谢谢,但下面的回答者回答我的问题细节 – AndikaK 2014-10-06 17:16:23

+0

当然,没有问题。我只是想帮忙。 :) – divyenduz 2014-10-06 17:17:38

+0

我很高兴:( – AndikaK 2014-10-06 18:09:11

相关问题