uiviewcontroller

Can't link connector from UIImageView declared as an IBOutlet in a class to the corresponding UIImageView on the View Controller in storyboard

女生的网名这么多〃 提交于 2019-12-25 03:43:29
问题 This question is a follow up to: Can't link connector from IBOutlet to View Controller I would now like to link another object of UIImageView called image, defined in class B to the same UIImageView on the ViewController. I wasn't able to do this using the same method. I imagine this is because, the UIImageView on the ViewController is now of custom class B, and the object image is an instance of UIImageView. I tried to cheat xcode by changing back the custom class of the UIImageView to

How can I pass information from one view controller to another? [duplicate]

拜拜、爱过 提交于 2019-12-25 03:26:35
问题 This question already has answers here : Passing Data between View Controllers (43 answers) Closed 5 years ago . This is a Q&A Style Post If I want to pass parameters, such as an NSString , NSArray , or NSDictionary , from one view controller to another, what is the easiest way to do this? 回答1: There are multiple ways to achieve this, but two of the cleanest methods would involve passing the parameter(s) into a custom init method for the next view controller, or setting the parameter(s) as a

presentModalViewController not working properly

时间秒杀一切 提交于 2019-12-25 02:47:57
问题 I have 3 views. I want to do the following: A presents B modally A dismisses B A presents C modally I have setup a delegate pattern where A is B's delegate. This is how I am presenting and dismissing in B: [delegate dismissB]; //this is just [self dismissModalViewControllerAnimated:NO] [delegate presentC]; //this is just [self presentModalViewController:c animated:NO]; For some reason my app crashes when I execute this code with no debugger results (I have NSZombieEnabled). When I comment out

CoreData TableView inside UIViewController

China☆狼群 提交于 2019-12-25 02:29:09
问题 I want to re-write a view I made in my app to improve the layout. Originally I implemented a TableViewController that uses CoreData as its source. This view worked well for me until I needed to add more views in the TableViewController that would act indipendent of the table and don't scroll out of the screen as more rows are added. The initial implemetnation is as follows based on the apple guide to NSFetchedResultsController: CoreDataTableViewController.h: @interface

What's the Best Way to Send Parameters to a UIViewController?

拜拜、爱过 提交于 2019-12-25 02:21:49
问题 I ask this question because it appears that viewDidLoad gets called before the main block of the initializer does and the class variables I'm initializing in the initializer are turning up nil in viewDidLoad. For your reference, I'm doing this entire viewcontroller programmatically and I've created a custom initializer so I can take in various parameters to be used in my viewcontroller. My custom initializer calls UIViewControllers designated initializer of course. Basically, I'm curious

AFNetworking restore progress bar after view reopened

自古美人都是妖i 提交于 2019-12-25 01:49:44
问题 within my app i have a UIViewController with a UIProgressView and a button to start a download with the AFNetworking library. How can i resume the download progress bar, after than the viewController is closed and then reopened? this is my code: ViewController.m [...] - (void) updateProgress:(float)progress forOperation:(AFHTTPRequestOperation *)operation { self.downloadprogress.progress = progress; } - (void)downloadTest:(NSString *)cid { NSString *string = [NSString stringWithFormat:@"%@get

Using a protocol and a delegate

折月煮酒 提交于 2019-12-25 01:49:06
问题 I am trying to get some code in a view working. I have declared a delegate and it does not get instantiated, any Idea what I am missing? I have tried to summarise how I have done this below. I think that the issue is that somewhere, my dataSource delegate needs to be instantiated. I have a View called graph view and a delegate that is in the viewcontroller GraphViewController. I know that the method in GraphView is doing something as it calls the AxisDrawing helper class and draws in Axes.

Is it possible to have 2 view controllers from 2 different storyboards to be active on the screen simultaneously?

流过昼夜 提交于 2019-12-25 01:44:47
问题 I am trying to develop something on the lines of the Uber app. I have to keep the 2 view controllers in separate storyboards. I need to pull up a drawer like in Uber over a View controller which has a scnview. In simpler term and taking Uber as an example, I need a way to accomplish the same interaction where the mapViewController is in one storyboard and the drawer having the driver details to be in another storyboard. 回答1: You can implement this feature in many other ways as well, But

Get NSClassFromString from Array of Strings - Swift

强颜欢笑 提交于 2019-12-25 01:43:11
问题 I am trying to write a function that loads a particular view controller from my array of string>. However I'm struggling with this concept in swift - I achieved this in Objective - C. static NSString const *const viewControllerClassName[3] = {@"one", @"two", @"three"}; . // get the name of the class of the viewcontroller that will be shown on this page const NSString *className = viewControllerClassName[1]; Class class = NSClassFromString((NSString *)className); UIViewController *controller =

UIViewController, displayed modally, dismisses itself upon device rotation

旧时模样 提交于 2019-12-25 01:01:08
问题 I've got a UIViewController that I'm using as a login view that's displayed modally above a UISplitViewController. Once the user has successfully logged in, the modal view is dismissed. The master view controller in the split view controller has a left bar button item to logging out. Once the logout button is tapped the login view controller is displayed modally again. If the user rotates the devices at this time, the modal login view is being dismissed. I have no idea how to catch this. When