last day (14 days later) » 

11:16 AM
0
A: how to perform navigation[segue] from midle of the flow + ios application

gabblerYou can make the window.rootViewController to be the navController, this should work.

 
didnt workd.. :(
 
So the other function still doesn't work? UINavigationController *navCtl = [[UINavigationController alloc] init]; self.window.rootViewController = navCtl; [navCtl pushViewController:home animated:YES]; and this worked for me.
 
i got this error : Terminating app due to uncaught exception 'NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController.
 
That is because the controller doing the push is not on a navigation stack, nav->A->B->C, this will work fine, A->B->C will cause trouble, you need to check that if the controller's navigation controller is nil by logging out self.navigationController.
 
what if the self.navigationControler is nill ? what should i do ?
 
11:16 AM
See the comment above, window's rootViewController is a navigation controller. so home's navigationController will not be nil.
hi
 
hi
self.navigationControler is null and self.nav is nill
i have initialise a property in the login.h file [which is the page i loaded programaticaly from appdelegate]
property for the navigationControler
are you there @gabbler
 
self.window.rootViewController = nav;
[self.navController pushViewController:login animated:YES];
try this
instead of set a property in the login.h
 
ok i will give a try...n tell u the result
 
ok
 
i have a question
here , self.navControler
is it self.navicationControler ?
or the property in login.h file ?
 
11:28 AM
where did you push login
 
or the variable which i initialise like UINavigationController *navCtl = [[UINavigationController alloc] init];
 
in appdelegate.m
 
yeah i have load the login page from app delegate according to login state
i will send you the code
 
ok, show me the appdelegate file
 
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
LoginView *login = (LoginView *)[mainStoryboard instantiateViewControllerWithIdentifier:@"login"];
login.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
self.window.rootViewController = login;
[self.navController pushViewController:login animated:YES];
 
11:29 AM
if there is a navigation controller in appdelegate file
 
no
i havent
 
so self.navController is nil?
 
do i need a navigationControler in appdelegate
yes
 
then you need it
just create a new one
make sure self.navController is not nil
and self.window.rootViewController = your navigation controller;
 
tell me if I'm wrong , first i have to set a property in app delegate.h to a navigationControler, then again same thing in Login.h file... and from app delegate i need to set it as rootControler ?
 
11:32 AM
no ,don't set anything in login.h
first i have to set a property in app delegate.h to a navigationControler yes
from app delegate i need to set it as rootControler yes
before the line if((customer!=nil)){
add self.navigationcontroller = [[UINavigationController alloc] init];
and set self.navigationController as the rootViewController for both cases
 
both cases means about the viewControlers in the if condition right ?
Home and login
?
 
yes
 
oh my gode
god
you save my day sir
 
did it work?
 
yessss
it worked
perfect
 
11:40 AM
that's good news
 
thanx a lot gabber
sry gabbler
 
you can also move the line self.window.rootViewController = self.navigationController ; before before the line if((customer!=nil)){
 
yeah... now i figured out what was the mistake
actually I'm new to IOS development
i had no idea about navigationControlers
I'm learning still :)
 
me too, I am still learning
 
thank you soo much
 
11:42 AM
you are welcome
 
:)
if you don't mind can i ask something ?
 
go ahead'
 
i don't know is it ok or not to ask something like that here
 
you can
 
it is not about IOS thats why
is it ok ?
 
11:46 AM
yes
 
ok then... you are an Indian right ?
 
no
chinese
 
oh sory.. i thought you are an indian... because lots of people here are indians...for my questions lots of indian people helped me..
thats what i thought your also an indian.
 
no problem
 
thank you a lot again... :)
 
11:48 AM
you are welcome
 

last day (14 days later) »