Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4116546
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:43:18+00:00 2026-05-20T22:43:18+00:00

I am making a iPhone app with a login feature. After they login, I

  • 0

I am making a iPhone app with a login feature. After they login, I have it write to a database. When the user opens the app, I want it to check whether or not to go to the app or show a UIView for them to login. I have some code, but it crashes. Here it is:

- (void)applicationDidFinishLaunching:(UIApplication *)application {    
sleep(5);
// Configure and show the window
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
//[application setStatusBarStyle:UIStatusBarStyleBlackOpaque];

int checkLoginCount = 0;
NSArray *checkLoginInfo = [database executeQuery:@"SELECT * FROM login WHERE id != '' or email != '' or password != ''"];   
for (NSDictionary *checkLoginRow in checkLoginInfo) {
    checkLoginCount++;
}

NSLog(@"alsdfjaldfksjalsdfjkas %d", checkLoginCount);

if (checkLoginCount == 0) {
    SplashPageViewController *screentwo = [[SplashPageViewController alloc] initWithNibName:@"splashPage" bundle:nil];
    //NSLog(@"aldjksflasdfjadksaldfjsaldksfj %@", screentwo);
    screentwo.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    [self presentModalViewController:screentwo animated:NO];
    [screentwo release];
} else {
    splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
    splashView.image = [UIImage imageNamed:@"Default.png"];
    [window addSubview:splashView];
    [window bringSubviewToFront:splashView];
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.5];
    [UIView setAnimationTransition:UIViewAnimationTransitionNone forView:window cache:YES];
    [UIView setAnimationDelegate:self]; 
    [UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];
    splashView.alpha = 0.0;
    //splashView.frame = CGRectMake(-60, -60, 440, 600);
    [UIView commitAnimations];
}
}

And here’s the error:

-[TableViewAppDelegate presentModalViewController:animated:]: unrecognized selector sent to instance 0x4e3e860
TableView[15309:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[TableViewAppDelegate presentModalViewController:animated:]: unrecognized selector sent to instance 0x4e3e860'
*** Call stack at first throw:
(
0   CoreFoundation                      0x00fccbe9 __exceptionPreprocess + 185
1   libobjc.A.dylib                     0x011215c2 objc_exception_throw + 47
2   CoreFoundation                      0x00fce6fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3   CoreFoundation                      0x00f3e366 ___forwarding___ + 966
4   CoreFoundation                      0x00f3df22 _CF_forwarding_prep_0 + 50
5   TableView                           0x00002b02 -[TableViewAppDelegate applicationDidFinishLaunching:] + 473
6   UIKit                               0x002e6253 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1252
7   UIKit                               0x002e855e -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 439
8   UIKit                               0x002f2db2 -[UIApplication handleEvent:withNewEvent:] + 1533
9   UIKit                               0x002eb202 -[UIApplication sendEvent:] + 71
10  UIKit                               0x002f0732 _UIApplicationHandleEvent + 7576
11  GraphicsServices                    0x0186fa36 PurpleEventCallback + 1550
12  CoreFoundation                      0x00fae064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
13  CoreFoundation                      0x00f0e6f7 __CFRunLoopDoSource1 + 215
14  CoreFoundation                      0x00f0b983 __CFRunLoopRun + 979
15  CoreFoundation                      0x00f0b240 CFRunLoopRunSpecific + 208
16  CoreFoundation                      0x00f0b161 CFRunLoopRunInMode + 97
17  UIKit                               0x002e7fa8 -[UIApplication _run] + 636
18  UIKit                               0x002f442e UIApplicationMain + 1160
19  TableView                           0x000027f6 main + 84
20  TableView                           0x00002799 start + 53
21  ???                                 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
  • database isn’t nil

Maybe I can’t do that action in that method. Who knows. Any help is appreciated!
Coulton!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T22:43:19+00:00Added an answer on May 20, 2026 at 10:43 pm

    First of all sleep(5); is a bad idea, you should avoid using sleep on the main thread (and better don’t use it anywhere).

    Seems that you have all your code in one file (main app delegate) and it also is a tableview delegate? Thats why you have so messy code, try to divide logic in two groups.

    For example, you can show your modal views with the help of navigation controller:

    [[self navigationController] presentModalViewController:modalViewController animated:YES];
    

    and dismiss it using

    [self.navigationController dismissModalViewControllerAnimated:YES];
    

    In iOS, you can display views modally by presenting the controller for the modal view from your current view controller. So you have get any view controller loaded before.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a iPhone app that has two different targets. They use the
I am making an iPhone app. I have a code that is in C.
im new developer and making my firt iPhone app ,and i want to make
My iPhone app currently uses core data. I want to create an online database
I'm making an iPhone app where I want to save state of the Application.
I am making a iphone app for my local school. I have a good
I'm making an iPhone app and I have a ton of .wav files I
I am making an iPhone app where in the user wants that the selected
I am making an iPhone app, where the requirement is such that user should
I'm making an iPhone app in which the user can do gestures (left and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.