0

I'm developing an application with XCode 7.01 and Objective C. In storyboard there is a Login screen with 2 UITextField: user and password. When execute in simulator since iPhone 5S works fine, but when i execute in iPhone 6 device and iPhone 6/6+ simulator, application crashes with EXC_BAD_ACCESS (code=1, address=0x1a...) when i touch user textfield (if i touch password textfield works fine).

NSZombies debug is enabled, but no information.

I read a lot of questions in stackoverflow and other pages but didn't find solution. Last step I did was delete user textview and duplicate password textview. With this, application works fine if check "Secure Text Entry" keeps enabled. If i uncheck "Secure Text Entry" for user textview, application crash again. I know this is crazy but, any idea?

Thank you.

EDIT.

This is my code:

LoginViewController.h

#import <UIKit/UIKit.h>

@interface LoginViewController : UIViewController

@property (weak, nonatomic) IBOutlet UITextField *usuario;
@property (weak, nonatomic) IBOutlet UITextField *password;

- (IBAction)doLogin:(id)sender;

@end


LoginViewController.m

@interface LoginViewController () {
    CGRect screenRect;
    CGFloat screenWidth;
    CGFloat screenHeight;
}

@end

@implementation LoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    screenRect = [[UIScreen mainScreen] bounds];
    screenWidth = screenRect.size.width;
    screenHeight = screenRect.size.height;

    NSString *imageName = [NSString stringWithFormat:@"fondo_login-%d.png", (int)screenWidth];
    self.view.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:imageName]];

    [self.usuario setFont:[UIFont fontWithName:@"Museo300-Regular" size:15.0]];
    self.usuario.textColor = [UIColor colorWithRed:60/255.0 green:73/255.0 blue:93/255.0 alpha:1];

    [self.password setFont:[UIFont fontWithName:@"Museo300-Regular" size:15.0]];
    self.password.textColor = [UIColor colorWithRed:60/255.0 green:73/255.0 blue:93/255.0 alpha:1];

}

doLogin function is an asynchronous request that gets user and password values, but it does not execute because application crashed on touch user textfield.

usuario (user) field is connected with ViewController in Storyboard.

connection code-storyboard

0 Answers0