uiviewcontroller

Adding a spark particle sprite inside a view controller

微笑、不失礼 提交于 2020-01-01 18:24:30
问题 I created an .sks particle emitter based on the spark template. My app is a normal app (not a game). When a user clicks a button, I have a new View controller that shows modally over fullscreen so that I can blur the background. In this modal, I created a view and gave it a class of SCNView see image below: How can I load the particle .sks file to do the animation on that viewController on the Particles view? Update How to load a SceneKit particle systems in view controller? 回答1: As mentioned

iOS difference between AppDelegate and ViewController class [closed]

给你一囗甜甜゛ 提交于 2020-01-01 17:25:08
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 years ago . How do I know what code goes in the AppDelegate class and what code goes in the ViewController class. Both classes have a similar method of viewDidLoad in UIViewController and applicationDidFinishLaunching: in UIApplicationDelegate . I guess applicationDidFinishLaunching: would be

How do I switch between views like home screen

南楼画角 提交于 2020-01-01 17:17:52
问题 How do I switch between multiple UIView 's using one UIViewController just like the iPhone home screen. If you need clarification please ask, don't thumbs down please. 回答1: use a UIScrollView...this sample code from apple does what you want to do 来源: https://stackoverflow.com/questions/1940180/how-do-i-switch-between-views-like-home-screen

How do I “connect” a table view to a view controller

心不动则不痛 提交于 2020-01-01 09:23:15
问题 Alright, I know this is a vague conceptual question, but I really need help here. Thanks in advance if you decide to take the time to read this. I would never even consider writing this much except this is such a great forum with so many helpful people I thought this would be the best place to ask. This is all related to the question here (you don't have to look at it - I explain everything below): Pass parameter when initializing table I've been working for days on the same problem, but I'm

How do I “connect” a table view to a view controller

被刻印的时光 ゝ 提交于 2020-01-01 09:23:13
问题 Alright, I know this is a vague conceptual question, but I really need help here. Thanks in advance if you decide to take the time to read this. I would never even consider writing this much except this is such a great forum with so many helpful people I thought this would be the best place to ask. This is all related to the question here (you don't have to look at it - I explain everything below): Pass parameter when initializing table I've been working for days on the same problem, but I'm

Storyboard crash - coding-compliant key sceneViewController

点点圈 提交于 2020-01-01 08:25:36
问题 I'm getting an intermittent crash using Storyboards in iOS 5. Every so often, I get a SIGABRT when I try to instantiate a new object with a view controller from my Storyboard. It seems like a very generic error, but I can't find anyone else that's seen this. Thanks for your help! SectionLandscapeViewController *sectionViewController = [[UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil] instantiateViewControllerWithIdentifier:@"SectionLandscapeViewController"]; And the crash...

iPhone: Using a NSMutableArry in the AppDelegate as a Global Variable

北慕城南 提交于 2020-01-01 07:24:09
问题 What i'm trying to accomplish is to have an NSMutableArray defined in the AppDelegate. I then have two UIViewControllers. One view is responsible for displaying the array from the AppDelegate. The other view is used to add items to the array. So the array starts out to be empty. View1 doesn't display anything because the array is empty. The User goes to View2 and adds an item to the array in AppDelegate. Then when the user goes back to View1 it now displays one item. Here is how I'm trying to

Why do I keep getting this error when going from ViewController to TableViewController?

本秂侑毒 提交于 2020-01-01 06:26:40
问题 I have this button in my viewController and when I press on it, it should go to the TableViewController. When I do this the app crashes and prints this error in the console. Can someone tell me what Im doing wrong? Thank you! Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] instantiated view controller with identifier "UIViewController-iLh-Fe-Ezq" from storyboard "Main", but didn't get a UITableView.' 回答1: When I got this

Why is this over-releasing? UINavigationController / UITableview

别来无恙 提交于 2020-01-01 04:53:06
问题 I'm pushing a view controller onto my navigation controller's stack from within my TableViewController's didSelectRowAtIndexPath method as so: MyViewController *myViewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil]; MyAppDelegate *appDelegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate]; MyObject *myO = (MyObject *)[appDelegate.myOs objectAtIndex:indexPath.row]; myViewController.amount = myO.amount; [self.navigationController

How can I add a search bar above a UICollectionView?

╄→尐↘猪︶ㄣ 提交于 2020-01-01 04:22:08
问题 I would like to allow users of my app to search for images using a UISearchBar above a UICollectionView . According to my understanding, a UICollectionView must be in a UICollectionViewController to work properly. However, Xcode won't let me put a search bar in a UICollectionViewController . I also can't use a generic UIViewController as the collection view won't work properly. How can I achieve the functionality that I want? 回答1: CollectionView + SearchBar with Swift3 + Storyboard