i'm literally having trouble having loginview show using modal view thats called when app starts. app used tab bar template in beginning.
please can tell me 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 how linked it, feel terribly wrong.
crashes every time, i've tried tons of other methods, other examples , tutorials.
i've been on problem 2 days, if can ill thankful.
resolved,
wow simple, don't know why isn't out in internet more.
had go ib , set login view initial controller.
no coding needed except in loginview nib
Forums iPhone, iPad, and iPod Touch iOS Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
![[img]](proxy.php?image=http%3a%2f%2fi43.tinypic.com%2f155i1kk.png&hash=e0b823bafed59e2af33483cc9e7a1d24)
No comments:
Post a Comment