uiviewcontroller

Fill a CoreData entity from different viewControllers

三世轮回 提交于 2019-12-25 04:59:53
问题 I built a Core data model with different entities for my database, on my iPad app. I do want to access these attributes (and fill the dBase) from different viewControllers. For instance, there are UITextFields in viewController A, and another UITextField in viewController. I'd like the seized information to fill different attributes from my Core Data entity... Is that possible? What is the best practice to do so? My problems : I declare the objects with type "entity" in viewController A I

How to properly pass NSArray / NSMutableArray from one UIViewController to another

痞子三分冷 提交于 2019-12-25 04:53:43
问题 An iphone app I'm working on is terminating periodically ... and I have a feeling it is because of how I'm accessing a shared NSArray amongst several view controllers. So ... What is the best way to pass NSArray/NSMutableArray amongst several ViewControllers ... all of which can modify and/or set it to nil or whatever? Thanks 回答1: There are two approaches, generally speaking. In the first approach, when you instantiate your next view controller, you could set an array property to "inherit"

Pass a NSString from Child to Parent for ModalViewController

落花浮王杯 提交于 2019-12-25 04:47:09
问题 My parent ViewController class contains a UISearchBar. I have a UIButton that will push on a new ViewController via the code below AddViewController *addViewController = [[AddViewController alloc] initWithNibName:@"AddView" bundle:nil]; [self presentModalViewController:addViewController animated:YES]; [addViewController release]; In the AddViewController the User is presented with a TableView of animal names. On the - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:

Passing an NSDictionary to a ViewController from AppDelegate

时间秒杀一切 提交于 2019-12-25 04:37:13
问题 This is related to a question I asked earlier, but the original question was answered. Hope it's okay to open a new question, if not, feel free to delete it. I'm trying to build a simple iPhone application using tableviews and a tabbar. Every view is the same programmatically, except for the title and the kind of data which needs to be displayed. Except for that they all behave the same. Currently code in my AppDelegate handles the distribution of viewcontrollers to the different tabs and

Howto Size the Modal View programmatically (SWIFT)

梦想与她 提交于 2019-12-25 04:27:37
问题 I simply want to present a small option dialog over an existing main UIViewController/UIView , so that on an IPad I would see a small Dialog and in the Background I will see the Main View. I managed to show a UIViewController/UIView in a modal view style as follow: func showoptions(){ let storyboard = UIStoryboard(name: "Main", bundle: nil) let controller = storyboard.instantiateViewControllerWithIdentifier("Options") as! UIViewController controller.modalPresentationStyle =

adding check box to one of sections in UITableView

女生的网名这么多〃 提交于 2019-12-25 04:17:10
问题 I create a table view controller programmatically that contains different sections I want to add 3 rows with check mark box in my third sections (I used storyboard!) would you please give me some hint that how can I do that .. my question is how can I set checkbox in left side for my third sections here is the picture:instead of Please set your code: having 3 rows with check mark box in Absence Code sections Here is my view in storyboard: Here is the code: - (void)viewDidLoad { [super

How can I show a modal view in response to a notification as a new window? (no parent vc)

爷,独闯天下 提交于 2019-12-25 04:17:09
问题 I am having a lot of issues handling my incoming local notifications. My app is using storyboards and has a tabbarcontroller as the rootviewcontroller. Currently I launch the modalviews from 'didReceiveLocalNotification' in the following manner: MedicationReminderViewController *vc = [[MedicationReminderViewController alloc] initWithNibName:@"MedicationReminderViewController" bundle:nil]; vc.notificationInfo = [[NSDictionary alloc] initWithDictionary:notification.userInfo];

ipad objective c using removeFromSuperview to remove UICollectionViewController throws an error

拈花ヽ惹草 提交于 2019-12-25 04:14:28
问题 So I'm customizing this control I found since I think it works very well except with this issue of mine: http://www.cocoacontrols.com/controls/fsverticaltabbarcontroller I wanted to load a UICOllectionViewCOntroller instead of a regular ViewController whenever an item is tapped on the sidebar. So I did this modification when selecting an item: - (void)setSelectedIndex:(NSUInteger)selectedIndex { NSLog(@"selected Index is %@", [NSNumber numberWithInt:selectedIndex]); NSLog(@"_selected Index is

ios 8.1: Type 'ViewController' does not conform to protocol 'UICollectionViewDataSource'

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 04:12:27
问题 I'm getting the following error when compile swift application (iOS 8.1) Type 'ViewController' does not conform to protocol 'UICollectionViewDataSource' at "class ViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate" line I've just checked few posts here but no one helps me to solve this problem. Here's the code of ViewController.swift file: import UIKit class ViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate { var

iOS - Custom keyboard, updating text field in parent view

痞子三分冷 提交于 2019-12-25 03:45:22
问题 I am implementing a custom keyboard and need to update the original textField when buttons are touched on that keyboard. I have tried following the answer to this question: Return Inputs to UITextfield with custom inputView but I don't find it very clear. In statViewController I have defined my textField xValue , and created an instance of my keyboard: DCKeyboard *dckXValue = [[DCKeyboard alloc] initWithNibName:@"DCKeyboard" bundle:nil]; The next line of the answer uses self, so I take it