Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Blake Mitchell
2,749 PointsProblem with login
when I try to login on the ribbit app I have created I get this error....
return UIApplicationMain(argc, argv, nil, NSStringFromClass([BMAppDelegate class]));
to the right side of it it says Thread 1: signal SIGABRT
could someone please explain to me what is wrong here and how I can fix it?
Thank You
Blake Mitchell
2,749 Points// // LoginViewController.m // Ribbit // // Created by Blake Mitchell on 12/4/13. // Copyright (c) 2013 Blake Mitchell. All rights reserved. //
import "LoginViewController.h"
import <Parse/Parse.h>
@interface LoginViewController ()
@end
@implementation LoginViewController
-
(void)viewDidLoad { [super viewDidLoad];
self.navigationItem.hidesBackButton = YES; }
-
(IBAction)login:(id)sender { NSString *username = [self.usernameField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSString *password = [self.passwordField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if ([username length] == 0 || [password length] == 0) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Oops!" message:@"Make sure you enter a username and password!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; } else {
[PFUser logInWithUsernameInBackground:username password:password block:^(PFUser *user, NSError *error) { if (error) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Sorry!" message:[error.userInfo objectForKey:@"error"] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; } else { [self.navigationController popToRootViewControllerAnimated:YES]; } }];
} }
@end
1 Answer
Stone Preston
42,016 Pointshmmm ok try setting an exception breakpoint in your app by going to debug -> breakpoints -> create exception breakpoint. That will show you the line of code that is causing the crash. It may be in your login view controller (it doesnt look like it is) so its probably in your root view controller of the tab bar (inbox i think?)
Stone Preston
42,016 PointsStone Preston
42,016 Pointspost the code in you login view controller. Most of the times a single error message like that isnt very helpful in diagnosing a problem. Its easier to figure out when you have some context (your code, a stack trace, etc)