uiviewcontroller

MPMoviePlayerController : orientation problem

隐身守侯 提交于 2019-12-21 23:15:24
问题 finally I have to post my problem here. Yes it could be duplicate question here as I have referred many answers regarding to this question.But I could not find any fix. (Also didn't find any question regarding to tab-bar app specific so...) And I don't want to use MPMoviePlayerViewController I have tab-bar application. In last tab's VC there is a button. On click event I want to start movie player. For that I am using MPMoviePlayerController . Its all fine when orientation is Portrait . But

uitableview reloadData issue

谁说我不能喝 提交于 2019-12-21 22:41:43
问题 I've been debugging my iphone app and found something interesting. I have a UIViewControllers with TabBarcontroller( 6 tabs). Each tab is a UIViewController and it has a UITtableview. The viewDidLoad works and brings the initial data. On of the UITableView has a search bar. After the user touchs presses search some magic happens and I get an array with data. I cant see the new data in the tableview and the [tableView reloadData] has no effect outside viewDidLoad (first time). I can see the

UIViewController Containment with animation like Google+

半世苍凉 提交于 2019-12-21 22:26:18
问题 The best way to understand what I'm trying to explain is to open Google+ app and tap anywhere in background of a post displayed in the main stream of posts. When you tap it, the entire post moves itself at the center of the screen with a nice animation and it loads the post's comments below it. I think this is a common UIViewController containment scenario, where one UIViewController is inside another. But how the post can moves it animately and "transfering" itself inside the contained view

How to make data visible for all view controllers?

余生长醉 提交于 2019-12-21 21:34:17
问题 Let's consider the following case: I have a tab bar application where tapping each tab bar item takes user to other view that is handled by different view controller(typical pattern). In one of my controllers I have method that downloads the important data and I want them to be global for whole application. What design pattern should I use? One way to do that is to store this data using persistence such as core data, but is it the only way to make data visible for all view controllers? Maybe

Objective-C: UIScroller and UItextfields hidden by keyboard appearing in UIViewController

[亡魂溺海] 提交于 2019-12-21 20:33:34
问题 I need help trying to configure in a UIViewController, the keyboard : (a) not hovering over both UITextfields, so the scroller should be positioned correctly; and (b) When the user touches the background the keyboard disappears. I haven't tried (b) yet but I'm trying (a) and the code I got from googling around didn't give me the desired effects. In-fact, it makes my textboxes disappear when I touch one of them. Im sure my implementation of activeField is also wrong. I got this example from

“Embed” UIViewController within another

五迷三道 提交于 2019-12-21 20:18:10
问题 I have a UIViewController (DetailViewController) consisting of a navigation bar on the top and a UIView covering the rest of the screen. Is it possible to control the UIView with a UIViewController other than DetailViewController? 回答1: You can do this, but you must not forget to call Apple's required methods for embedding UIViewControllers. Otherwise, your view controller will not get called by the OS to handle certain events. To add the view controller: [self addChildViewController

Taking a screenshot of a view that is currently not on screen on iOS

女生的网名这么多〃 提交于 2019-12-21 20:04:48
问题 I'm trying to make a transition between two ViewControllers. My Transition class has a property for the destination view controller. When I try to get a screenshot of the destination's view, I use this method: + (UIImage *)renderImageFromView:(UIView *)view withRect:(CGRect)frame { // Create a new context the size of the frame UIGraphicsBeginImageContextWithOptions(frame.size, YES, 0); CGContextRef context = UIGraphicsGetCurrentContext(); // Render the view [view.layer renderInContext:context

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

Storyboard - Workflow for turn based game

核能气质少年 提交于 2019-12-21 17:49:17
问题 I am creating a turn based game and would like to know the correct process for my workflow. At present I have the following: Home View Controller (which has a UITableView ) Click on row from section 1 > Loads a UINavigationController with path 1 Click on row from section 2 > Loads a UINavigationController with path 2 As an example: path 1 - play your turn path 2 - guess your turn Each path has around 4-5 UIViewControllers loaded into the navigation controller. Now I am at the stage where once

Calling a method of One View controller from Another View Controller

怎甘沉沦 提交于 2019-12-21 17:29:52
问题 I have a method "someMethod" declared in OneViewController.h @interface OneViewController { UIView *tempView; .. } -(void) someMethod ; @end and implemented in OneViewController.m file @implementation OneViewController -(void) someMethod { tempView = [[UIView alloc]initWithFrame:CGRectMake(100, 50, 200, 250)]; tempView.backgroundColor = [UIColor yellowColor]; if([[self.view subviews] containsObject:tempView]) [tempView removeFromSuperView]; else [self.view addsubview:tempView]; } I want to