uiviewcontroller

UIView needs to push a UIViewController (delegation)

烈酒焚心 提交于 2019-12-24 08:59:48
问题 I'm having a hard time getting my head around custom delegation - I would be most grateful if someone could help me: I have a UIViewController with a tab bar controller, and each of these contains a subclassed UIView. In one of the views, I have a UIButton in which I want to load a UIDocumentInteractionController. I already have the code to do this second part, as the document controller needs access to a UIViewController in order to get pushed to the stack. But how can my UIView get access

Objective-C – Getting a UIViewController reference

不羁岁月 提交于 2019-12-24 08:56:06
问题 I'm way in deep water here trying to get ahold of a vc. My App layout looks like this: TabBarController (holds a) -> UINavController for Tab 1 (holds a) -> MyOwnListViewController -> UINavController (modally) (holds a) -> ItemAddViewController -> AddItemToItemViewController Maybe that wasn't very clear, so for clarity, when the app starts I'm on tab 1 and the MyOwnListViewController is visible, then I push a + button in the navigation bar and I'm taken modally to the ItemAddViewController .

Can't restrict UIViewController to Portrait only

狂风中的少年 提交于 2019-12-24 08:39:56
问题 I'm embedding my app in a UINavigationController , I want most of my ViewControllers except one to be Portrait, I've read a lot of questions but could not find a correct answer that works for me. In my target I'm selecting Device Orientation : Portrait , Landscape Right I'm adding this to my first ViewController: -(BOOL)shouldAutorotate{ return NO; } -(NSUInteger)supportedInterfaceOrientations{ return (UIInterfaceOrientationPortrait); } But when I rotate the device left the ViewController

Can't create IBOutlet for UIBarButtonItem in a UIViewController

↘锁芯ラ 提交于 2019-12-24 08:39:43
问题 I'm trying to create an IBoutlet from a UIBarButtonItem to a UIViewController, but when ctrl+clicking and dragging to the controller, I see no indicator whatsoever, and thus it's impossible to create it. Not sure what I'm doing wrong. Here's the screenshot, in case it could clear something up: Thanks a lot in advance! EDIT: I also tried to create the IBOutlet manually with @property (weak,nonatomic) IBOutlet UIBarButtonItem *barButtonItem; and then ctrl+clicking and dragging, but same result.

Objective c - how to display a shorter name of viewController on back button

折月煮酒 提交于 2019-12-24 08:35:13
问题 I almost sure I saw someday that there is some property to set a shorter name of viewController to be display in the back button when it push another viewController and become the back viewController. Can some one remind me what is this property? 回答1: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Custom initialization self.title = @"First View Controller"; // this defines the back

Custom Tab Bar Controller with Navigation Bar

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 07:35:07
问题 I've spent a while looking for a solution to this but haven't found one. I'd like to create a Tab Bar Controller with a navigation bar which is present in all child views. From what i gather, the hierarchy does not allow this, as a tab bar is (equal?) or higher in the hierarchy than a Navigation Controller, and therefor the only simple implementation is to embed each child view of the Tab Bar Controller in a Navigation Controller, like this: I was wondering if there is any technical reason

iOS - Different ViewControllers - how to load them?

梦想与她 提交于 2019-12-24 07:28:21
问题 I’m trying to develop an app that uses 3 different view controllers on the first tab. I have 3 options: 1 - embed the view controllers in an uipageviewcontroller 2 - embed the view controllers in a uiscrollview 3 - use containers controlled by a uisegmentedcontroller - with hidden property true or false… Each of these viewcontrollers are using collectionviews to present photos downloaded asynch from a remote server. Using 3, the photos from all view controllers, loads at the same time, so,

Can I push a modal view controller from within another modal view controller?

荒凉一梦 提交于 2019-12-24 06:20:51
问题 I've got a rootViewController that, at one point, displays a peoplePickerNavigationController. I'm trying to push a second view controller when my user selects a specific contact property, like so: -(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)picker shouldContinueAfterSelectingPerson:(ABPersonRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier { RuleBuilder *ruleBuilder = [[RuleBuilder alloc] initWithNibName:@"RuleBuilder"

Some code not executing in a method called from another ViewController

旧城冷巷雨未停 提交于 2019-12-24 05:55:04
问题 My problem I have a standard UIViewController . With the press of a button, it loads a form sheet modal view controller. When dismissing this modal view with the press of a UIBarButtonItem I call a method by doing: ViewController *main = [[ViewController alloc] initWithNibName:nil bundle:nil]; [main updateLabel]; In the method -(void)updateLabel in the main ViewController I'm setting the text of a label, but the label won't change. But I know the function gets called, because if I do a NSLog(

Accessing a method on a views superview - What is UIViewControllerWrapperView?

蹲街弑〆低调 提交于 2019-12-24 05:49:34
问题 My problem is a follows I have a UIViewController subclass which holds a UISegmentedController and four tableviews that I layed out in interface builder. @interface MultiTableHoldingView : UIViewController{ } @property (strong, nonatomic) IBOutlet DataTV *dsDataTV; @property (strong, nonatomic) IBOutlet EnviroTV *dsEnvironmentTV; @property (strong, nonatomic) IBOutlet LocationTV *dsLocationTV; @property (strong, nonatomic) IBOutlet Note_AnimalTV *dsNoteAnimal; @property (strong, nonatomic)