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 8719831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:53:30+00:00 2026-06-13T06:53:30+00:00

I am trying to input user information into coredata so that I can than

  • 0

I am trying to input user information into coredata so that I can than send it to my php and do a MySQL login. However, when I was testing JUST the coredata part, all I got was a black/blank screen with no xcode error or error reports (after the custom image loading screen, there should me my background and my buttons). Below is my code, obviously excluding storyboard and the xcdatamodeld (to actually store the core data input). Anything I am doing wrong?

Appdelegate.h

#import <UIKit/UIKit.h>

@class LoginViewController;

@interface AppDelegate : UIResponder <UIApplicationDelegate>
{
    LoginViewController *viewController;
}
@property (strong, nonatomic) IBOutlet LoginViewController *viewController;
@property (strong, nonatomic) UIWindow *window;
@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
- (void)saveContext;

@end

Appdelegate.m

#import "AppDelegate.h"

@implementation AppDelegate

@synthesize window = _window;
@synthesize managedObjectContext = __managedObjectContext;
@synthesize managedObjectModel = __managedObjectModel;
@synthesize persistentStoreCoordinator = __persistentStoreCoordinator;
@synthesize viewController;

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc]
                   initWithFrame:[[UIScreen mainScreen] bounds]];
    [self.window makeKeyAndVisible];
    return YES;
}

LoginViewController.h

    #import <UIKit/UIKit.h>

    @interface LoginViewController : UIViewController {
        UITextField *username;
        UITextField *password;

    }
    @property (strong, nonatomic) IBOutlet UITextField *username;
    @property (strong, nonatomic) IBOutlet UITextField *password;
    - (IBAction)saveData:(id)sender;

@end

LoginViewController.m

#import "LoginViewController.h"
#import "AppDelegate.h"
#import "Contacts.h"

@interface LoginViewController ()

@end

@implementation LoginViewController

@synthesize username, password;


- (IBAction)saveData:(id)sender {

    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];

    NSManagedObjectContext *context = [appDelegate managedObjectContext];

    NSManagedObject *newContact;

    newContact = [NSEntityDescription insertNewObjectForEntityForName:@"Contacts" inManagedObjectContext:context];

    [newContact setValue:username.text forKey:@"username"];
    [newContact setValue:password.text forKey:@"password"];

    username.text = @"";
    password.text = @"";

    NSError *error;
    [context save:&error];
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}
@end

Contacts.h

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>


@interface Contacts : NSManagedObject

@property (nonatomic, retain) NSString * username;
@property (nonatomic, retain) NSString * password;


@end

Contacts.m

#import "Contacts.h"


@implementation Contacts

@dynamic username;
@dynamic password;


@end
  • 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-06-13T06:53:32+00:00Added an answer on June 13, 2026 at 6:53 am

    Reason is , you are not adding any viewcontrollers in your window.

    Just add your logincontroller on it,

    like

     - (BOOL)application:(UIApplication *)application
     didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
     {
          self.window = [[UIWindow alloc]
                    initWithFrame:[[UIScreen mainScreen] bounds]];
          [self.window addSubView:viewController.view]; 
          // OR self.window.rootController = viewController;
          [self.window makeKeyAndVisible];
          return YES;
    

    }

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

Sidebar

Related Questions

So I am trying to make the user input information that displays after clicking
I'm trying to sanitize a string that involves user input without having to resort
I've been trying to make a simple program that takes the user input, until
What I am trying to do is have a user input his data into
i'm trying to make it so that a user can type text in a
I am trying to add user info into a database from a user input
I need to send information input into a text box in one form to
I'm currently trying to input information into a data grid view, but when I
I'm using MySQL and trying to sum the number of hours that user has
I'm trying to validate user input, which is just comma separated numbers. I'd like

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.