I'm literally having so much trouble with just having the loginview show up using a modal view thats called when the app starts. my app used the tab bar template in the beginning.
please can someone tell me what I'm doing wrong
AppDelegate.h
AppDelegate.m
here is how i linked it, which i feel like is terribly wrong.
it crashes every time, I've tried tons of other methods, from other examples and tutorials.
I've been on this problem for about 2 days, if anyone can help ill be very thankful.
please can someone tell me what I'm doing wrong
AppDelegate.h
Code:
#import <UIKit/UIKit.h>
#import "AppDelegateProtocol.h"
#import "DetailsViewController.h"
#import "GlobalStrings.h"
@class GlobalStrings;
@interface AppDelegate : UIViewController
<UIApplicationDelegate, AppDelegateProtocol>
{
GlobalStrings* theGlobalClass;
IBOutlet DetailsViewController* theDetailsViewController;
//UIViewController *loginViewController;
}
@property (strong, nonatomic) UIWindow *window;
@property (nonatomic, retain) GlobalStrings *theGlobalClass;
@property (nonatomic, retain) IBOutlet DetailsViewController *theDetailsViewController;
//@property (nonatomic, retain) UIViewController *loginViewController;
@end
AppDelegate.m
Code:
#import "AppDelegate.h"
#import "InventoryViewController.h"
#import "SalesViewController.h"
#import "AppDelegateProtocol.h"
#import "GlobalStrings.h"
#import "Brand.h"
#import "StoreViewController.h"
#import "LoginViewController.h"
@implementation AppDelegate
{
NSMutableArray *brandLists;
}
@synthesize window = _window;
@synthesize theGlobalClass, theDetailsViewController;
- (void)dealloc
{
[_window release];
self.theGlobalClass = nil;
self.theDetailsViewController = nil;
[super dealloc];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
brandLists = [NSMutableArray arrayWithCapacity:20];
Brand *brandlist = [[Brand alloc] init];
//brandlist.name = @"DeWalt";
brandlist.rating = 1;
[brandLists addObject:brandlist];
// LoginViewController *sampleView = [[[LoginViewController alloc] init] autorelease];
// [self presentModalViewController:sampleView animated:YES];
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; LoginViewController *loginViewController = [storyboard instantiateViewControllerWithIdentifier:@"loginViewController"];
[self presentModalViewController:loginViewController animated:YES];
// [self presentViewController: loginViewController animated: YES completion: nil];
return YES;
}
}
@end
here is how i linked it, which i feel like is terribly wrong.
it crashes every time, I've tried tons of other methods, from other examples and tutorials.
I've been on this problem for about 2 days, if anyone can help ill be very thankful.
Last edited by a moderator: