uiviewcontroller

Cannot dismiss GKGameCenterViewController presented from SKScene

你。 提交于 2020-01-06 08:43:10
问题 I'm presenting a GKGameCenterViewController from an SKScene. This is my code: -(void)showLeaderboardAndAchievements:(BOOL)shouldShowLeaderboard{ GKGameCenterViewController *gcViewController = [[GKGameCenterViewController alloc] init]; gcViewController.viewState = GKGameCenterViewControllerStateLeaderboards; gcViewController.leaderboardIdentifier = _leaderboardIdentifier; // _spriteViewController references an UIViewController [_spriteViewController presentViewController:gcViewController

Using pushViewController: animated:

℡╲_俬逩灬. 提交于 2020-01-06 07:08:23
问题 I'm trying to use the pushViewController: animated: with a UIViewController. I have it housed in a UINavigationController with initWithRoot and it still doesn't work. Here is my code? Am I doing something wrong? CloudappSettingsViewController *cloud = [[CloudappSettingsViewController alloc] initWithNibName:nil bundle:nil]; UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:cloud]; [self pushViewController:nav animated:YES]; [cloud release]; It always

How make static view on any viewcontroller in Xcode?

雨燕双飞 提交于 2020-01-06 07:01:55
问题 I Have interesting question. I have two screens, I need that would be the third screen elements (buttons, label) are static and do not change when you move from one screen to another. . So MAIN DISPLAY 1 will be change, DISPLAY 2 too , but button and others(label for example) need be static. Big Thanks for all help, sorry i don't have any code with this problem. Because i don't know how this make... 回答1: Ok, so if you have a UI that won't change it's content you have to consider the following

How to shrink UILabel spacing between lines without label being clipped?

为君一笑 提交于 2020-01-06 07:01:40
问题 I have a label which I am trying to shrink the spacing in between lines. I tried many things including changing the height multiple, min/max line spacing etc. When I changed the heigh multiple the label seemed to get clipped on top. I'm adding images to show as an example: This is a regular attributed label with default settings. Constraints: Leading 20, trailing 20, align center to Superview and Align Y to superview This is the same label but with the height Multiple set at 0.7 which

iOS - NavController & Custom Views

霸气de小男生 提交于 2020-01-06 04:46:28
问题 The Crash: -[UIImageView setParentViewController:]: unrecognized selector sent to instance 0x58701e * Termintating app due to uncaught execption 'NSInvalidArgumentExecption', reason: '-[UIImageView setParentViewController:]: unrecognised selector sent to instance 0x58701e0' This occurs when I'm trying to push a custom UIViewController that is made without IB. When I do this with IB it works but it's not exactly what I need. What is being called for my delegate -(void)switchToTrailerOne {

Keeping values between view controllers

北慕城南 提交于 2020-01-06 03:53:11
问题 I have an ItemAddViewController, which presents itself as a modal view. One of the fields pushes a new view controller, CategorySelectionViewController, which allows the user to select a single category. ItemAddViewController.h @property (nonatomic, retain) Category *category; CategorySelectionViewController.h @property (nonatomic, retain) Category *category; CategorySelectionViewController.m - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

Move a pixel through screen with swift

ε祈祈猫儿з 提交于 2020-01-06 03:45:09
问题 I'm interested in having a VC with objects and others (static, not necessarily dynamic) and apart from that, I want to have a pixel (one or four, depending if it can be seen for the human eye) moving around the borders of the screen (so in the bounds). I attach a photo of what I need: So I need that the "pixel" move indefinetely doing a square and I also need to know where it is to do something in my code (in swift) 回答1: You can use a solution something to Swift 2 UIView

dismissModalViewController from another modalViewController

半城伤御伤魂 提交于 2020-01-06 02:17:46
问题 So I have a viewController A that presents a modal viewController B. Then B presents a viewController C. What I'm trying to do is to dismiss viewController B since I dont need it anymore. Is there a simple way to dismiss B and keep C on the screen as a child of A maybe? 回答1: Obviously, as many have said, this in a textbook world would/should be a delegate situation. Where A presents B and B presents C . Then when C is done it tells B which dismisses C and then B tells A to dismiss B . I would

dismissModalViewController from another modalViewController

邮差的信 提交于 2020-01-06 02:17:06
问题 So I have a viewController A that presents a modal viewController B. Then B presents a viewController C. What I'm trying to do is to dismiss viewController B since I dont need it anymore. Is there a simple way to dismiss B and keep C on the screen as a child of A maybe? 回答1: Obviously, as many have said, this in a textbook world would/should be a delegate situation. Where A presents B and B presents C . Then when C is done it tells B which dismisses C and then B tells A to dismiss B . I would

How to present view controller properly?

丶灬走出姿态 提交于 2020-01-06 02:16:05
问题 I have a pretty simple application with a couple of UIViewControllers (say VC_A and VC_B ). Every screen has a button that allows to switch to another screen (no UINavigation is used). App schedules a local notification, which, when expired, should present another view controller ( VC_N - no matter what screen is active at the moment). The problem is that sometimes application throws: 'NSInternalInconsistencyException', reason: 'Attempting to begin a modal transition from <VC_A: 0x2021e0> to