uinavigationcontroller

Push View Controller into Navigation Controller

坚强是说给别人听的谎言 提交于 2019-12-22 00:17:20
问题 Some times when I push ViewController into Navigation Controller, the viewDidLoad() method of the View Controller is not called. And this cause my application to crash. I would appreciate any help. I forget to mention that I load the view from the nib before I push it to the Navigation Controller. Thanks, Sarah 回答1: The viewDidLoad method is only called when the view is first loaded from the Nib file. If the view was already loaded and you push the view again it will not fire again. Depending

How do I access a variable in one view controller from another view controller?

北慕城南 提交于 2019-12-22 00:14:18
问题 In my UINavtigationController application, I have a user select a value in UITableViewController and once that is done, they are sent back to a previous UITableViewController where that value must be shown. The problem I am anticipating is that once a view is "popped", I am assuming that its viewUnload is called that gets rid of the array making it unaccessible in another view controller. Any thoughts? 回答1: You need to pass the new value to previous controller from your didSelectRowIndex

I have a UICollectionView and i want to show an image in a Cell, that goes to a normal ViewController. How do i do that?

馋奶兔 提交于 2019-12-21 23:12:12
问题 I have a UICollectionViewController (with a navigation controller) and i want to show an image in a Cell that 'pushes' to a normal ViewController (different by every image). How do i do that? 回答1: Seem you want to build photo gallery by UICollectionView. If use storyBoard, use segue - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"showDetail"]) { NSIndexPath *selectedIndexPath = [[self.collectionView indexPathsForSelectedItems]

Change the color of a bar button in iOS 7

强颜欢笑 提交于 2019-12-21 22:43:25
问题 I have the following code in my viewDidLoad of my containing view: // Now add the next button UIBarButtonItem *nextButton = [[UIBarButtonItem alloc] initWithTitle:@"Next" style:UIBarButtonItemStylePlain target:self action:@selector(self)]; self.navigationItem.rightBarButtonItem.tintColor = [UIColor blueColor]; self.navigationItem.rightBarButtonItem = nextButton; The UINavigationController parent has this in viewDidLoad: [super viewDidLoad]; // Do any additional setup after loading the view.

Swift 2: How to Load UITabBarController after Showing LoginViewController

霸气de小男生 提交于 2019-12-21 21:46:30
问题 Am new to Swift and Storyboard. At initially I have to show the login page and from the login page to UITabBarController. Once the user remembered the login details I have to check the login details in the AppDelegate and show the UITabBarController directly if the user already logged in. I have referred some SOF questions but, am not getting the result. I designed the LoginViewController embedded with UINavigationController. And I have one UITabBarController with 2 viewcontrollers. I set the

How to pass information from appDelegate into one of the view controllers in the UINavigationcontroller

僤鯓⒐⒋嵵緔 提交于 2019-12-21 21:11:33
问题 In the iphone app that I'm working on I use a custom class to manage network communication with the host. The class called protocolClass is an ivar in the appDelegate and alloc + init in the applicationDidFinishLaunching: method. Now whenever the protocolClass receive data from the host, it calls protocolClassDidReceiveData: method in its delegate (which I set as the appDelegate). I need then to update the data in one of the customViewControllers in the UINavigatorController. Should I just

What's the best way to refresh a UITableView within a UINavigationController hierarchy

和自甴很熟 提交于 2019-12-21 20:10:05
问题 I'm pretty new to iPhone development and have struggled to find what I consider to be a neat way around this problem. I have a user interface where a summary of record data is displayed in a table inside a navigation controller. When the user clicks the accessory button for a row, a new view is pushed onto the navigation controller revealing a view where the user can edit the data in the corresponding record. Once done, the editing view is popped from the navigation controller's stack and the

Swift / iOS. Remove few view controllers from navigation stack

时光毁灭记忆、已成空白 提交于 2019-12-21 17:49:42
问题 Here is what I want to do and I am not sure is it right approach, so please give me an advise how to do it. I have Initial VC with Navigation VC, from it I push First VC, from it I push Second VC. Next I present (from NavigationController of Second VC) Third VC. And now I want to remove First and Second VCs from navigation stack. After that I expect to have such result: I dismiss Third VC and I see Initial VC How can I get that result? 回答1: You can remove view controller from navigation stack

Can I increase the animation speed of presentModalViewController?

蓝咒 提交于 2019-12-21 17:44:14
问题 I'm writing a drawing application that shows a tools view controller when the user clicks an item in a toolbar. However, several of my beta testers have reported that the tools palate opens too slowly. I'm using the standard presentModalViewController:animated: call to display the tools, and I've tried wrapping it in a code block like this to speed it up: [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration: 0.1]; [self presentModalViewController:settings animated:YES];

How do I change the UINavigationController push transition style?

Deadly 提交于 2019-12-21 12:39:29
问题 I am using a navigation controller and push segues to control the flow of my app. Is there anyway to change the default animation of right-to-left for the push segues? Is there something I can overwrite somewhere? Thanks 回答1: I did the following and it works fine.. and is simple and easy to understand.. CATransition* transition = [CATransition animation]; transition.duration = 0.5; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];