uistoryboard

Add a restart button to my storyboard viewcontroller to link to its self

感情迁移 提交于 2019-12-25 05:11:54
问题 I have a viewcontroller in my storyboard that is a game. I have added a restart button and linked it to the same viewcontroller so that when the player dies they can click that and the game will start all over again. My problem is that when you click it and it restarts the game starts glitching. Any suggestions or solutions. I cant use a unwind seague so what should I do. 回答1: It really depends on your code, specifically in your viewDidLoad. Create an IBAction for that restart button in your

Add a restart button to my storyboard viewcontroller to link to its self

↘锁芯ラ 提交于 2019-12-25 05:11:49
问题 I have a viewcontroller in my storyboard that is a game. I have added a restart button and linked it to the same viewcontroller so that when the player dies they can click that and the game will start all over again. My problem is that when you click it and it restarts the game starts glitching. Any suggestions or solutions. I cant use a unwind seague so what should I do. 回答1: It really depends on your code, specifically in your viewDidLoad. Create an IBAction for that restart button in your

If statement based on whatever the previous view controller was

无人久伴 提交于 2019-12-25 03:38:45
问题 Here is what I go so far: - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; if (preivousViewController isEqualToString:@"...") { if ([self.filteredArray count] == 0) self.person = self.users[indexPath.row]; else self.person = self.filteredArray[indexPath.row]; self.mugshot = cell.imageView.image; [self performSegueWithIdentifier:@"SelectPerson" sender:self]; } else { if ([self

Initialization of a custom UIView in a UIViewController using a storyboard

雨燕双飞 提交于 2019-12-25 02:47:57
问题 I have a custom UIViewcontroller and wanted to initialize and assign a custom UIView which I assigned to an IBOutlet before. I'm using a storyboard. Can anybody give me hints where to call the designated initializer of the custom UIView? **MyCustomUIView.h** @interface MyCustomUIView : UIView @end **MyCustomUIView.m** @implementation MyCustomUIView - (id)initWithNumberOfHeaderRows:(NSUInteger)headerRowCount numberOfHeaderColumns:(NSUInteger)headerColumnCount frame:(CGRect)frame { self =

Storyboard parent-child relationship not representing what is returned by “superview”

前提是你 提交于 2019-12-25 02:41:55
问题 The Collection View Cell is subclassed in the following way: I have this layout in a collection view. On each button when it is created, I call the following code: [cell.imageButton addTarget:self action:@selector(galleryImageButtonClicked:event:) forControlEvents:UIControlEventTouchUpOutside]; Which calls this: -(void)galleryImageButtonClicked:(id)sender event:(id)event { if ([sender isKindOfClass:[UIButton class]]) { NSLog(@"Yay, it's a UIButton."); SCCollectionViewCell*

How to dismiss a collection of UIViewController objects that were loaded dynamically in Xcode 4

99封情书 提交于 2019-12-25 00:01:30
问题 I am having some trouble with dismissing a collection of UIViewController objects. I do not know of an elegant way to dismiss all loaded modal UIViewController objects at once. I make use of the "storyboard" in Xcode 4, but I do not use Segues to map the screens. I use dynamic code, like so: It all starts in MainViewController.m. I load [myMenuController] (a menu list). When the user selects an option from the menu, it then loads [myTicketController]. After some user interaction there, it

Storyboard still shows 'ghost' tab bar item after tab bar removal

倖福魔咒の 提交于 2019-12-24 21:10:07
问题 In our current project we had a tab bar controller, and every corresponding view had a tab bar controller. Lately we decided to use another navigation approach and we removed the tab bar controller. Unfortunately the tab bar items in the views seem to be unremovable in the SB. In the running app they are not visible. We even tried to reconnect them to a tab bar controller, but no avail. Also, they don't show up in the document outline. Is there anyone who can spread some wisdom how to remove

How to set value for NSString in another view controller from one viewcontroller

隐身守侯 提交于 2019-12-24 19:26:32
问题 I'm using Xcode 4.3.2 & iOS 5.1 simulator, and in my project I am using two View Controllers: testingViewController, and detailView. I want to set values for an NSString in detailView once I didSelect tableViewCell in testingViewController. For that i used following code: testingViewController.h testingViewController.m detailView.h detailView.m I get null values for both wordName and wordMeaning in the console. Anyone have a solution? Thanks in Advance! 回答1: If you have a storyboard segue

MKMapView show DetailView - How to make a segue

a 夏天 提交于 2019-12-24 19:25:28
问题 I have a MapView, the annotations comes from a property list. Now I would like to see more data in the detail view. Unfortunately I do not how to program the Segue, so that data can be displayed. I hope you understand what I mean. My english is not so good ... I know that there is missing some in the method prepareforSegue. I am using storyboard. In advance thank you for your help ... regards #import "MapViewNewController.h" #import "MapViewAnnotation.h" #import "SetCardController.h"

Inhibit Storyboard Segue from performing segue action

和自甴很熟 提交于 2019-12-24 13:00:21
问题 Question How do I deny a storyboard segue from taking place? Context: I have a static grouped table view of options on the first view controller that is visible (the main menu if you will). I purposely show the UI early to give the user a chance to interact and perceive a fast load response. Other operations that might be importing data for example, happen on a background operation queue. Most of my UI functions are in fact, ready to go as soon as you see them. One menu item (table row) in