subview

UIView setDelegate:]: unrecognized selector sent to instance

本秂侑毒 提交于 2020-01-17 05:03:30
问题 I am new to IOS, and Trying to pass two values form a UIViewController to a UIView. I followed few examples,some posts, tried and still no luck. I am getting this error while running the application. The error is .. [MenuComponent setDelegate:]: unrecognized selector sent to instance MenuComent is My UIView. FullVC is my UIViewController. FullVC.h @class FullVC; @protocol MenuComponentDelegate <NSObject> -(void)shareToView:(NSString *)titleString inUrl:(NSString *)urlString; @end @interface

How to add a UITableView as a subview to a UIView in xib?

可紊 提交于 2020-01-17 04:15:27
问题 I have a custom view that I built using xib file. In this custom view, there is a UIView where I would like to add a static UITableView as a subview. The UITableView to be shown here is present on the storyboard and associated to a UITableViewController . I did the following: let vc = (UIStoryboard(name: "Main", bundle: nil)) .instantiateViewControllerWithIdentifier("tableController") as! TableController vc.loadViewIfNeeded() table = vc.table // this is an outlet, I'm sure it is not nil table

How to add a UITableView as a subview to a UIView in xib?

空扰寡人 提交于 2020-01-17 04:15:14
问题 I have a custom view that I built using xib file. In this custom view, there is a UIView where I would like to add a static UITableView as a subview. The UITableView to be shown here is present on the storyboard and associated to a UITableViewController . I did the following: let vc = (UIStoryboard(name: "Main", bundle: nil)) .instantiateViewControllerWithIdentifier("tableController") as! TableController vc.loadViewIfNeeded() table = vc.table // this is an outlet, I'm sure it is not nil table

self.navigationController is nil after adding subview

允我心安 提交于 2020-01-14 04:37:10
问题 here is my productscontroller.h ProductListViewController *productListViewController; ProductGridViewController *productGridViewController; UIButton *flipIndicatorButton; and i am adding list and gridview as a subview like this in my implementation ProductListViewController *listController = [[ProductListViewController alloc] initWithNibName:@"ProductListView" bundle:nil]; self.productListViewController = listController; self.productListViewController.CurrentSale = CurrentSale; [self.view

UIGestureRecognizer subView recognizer problem

跟風遠走 提交于 2020-01-13 03:57:08
问题 The title is hard . The the main case is like this UIView *superView = [[UIView alloc] initWithFrame:CGRectMake(0,0,400,400)]; UIView *subView = [[UIView alloc] initWithFrame:CGRectMake(-200,-200,400,400)]; UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)]; [subView addGestureRecognizer:tapGesture]; [superView addSubView:subView]; OK , you will find that the tap gesture will take effect when you click the area in (0,0,200

UIGestureRecognizer subView recognizer problem

蓝咒 提交于 2020-01-13 03:57:07
问题 The title is hard . The the main case is like this UIView *superView = [[UIView alloc] initWithFrame:CGRectMake(0,0,400,400)]; UIView *subView = [[UIView alloc] initWithFrame:CGRectMake(-200,-200,400,400)]; UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)]; [subView addGestureRecognizer:tapGesture]; [superView addSubView:subView]; OK , you will find that the tap gesture will take effect when you click the area in (0,0,200

Check if UIView is displaying a UIAlertView

自闭症网瘾萝莉.ら 提交于 2020-01-11 03:13:05
问题 Is it possible to determine if the current UIView has a UIAlertView on display (other than setting a variable every time a UIAlertView is created). I'm thinking something along the lines of if ([self.view.subviews containsObject:UIAlertView]) { ... } But that obviously doesn't work. 回答1: This will not work in iOS7 and above. [alertView Show] adds subview on main window I guess. for (UIWindow* window in [UIApplication sharedApplication].windows){ for (UIView *subView in [window subviews]){ if

Sending datasource information only when UIView has been laid out?

大城市里の小女人 提交于 2020-01-06 06:34:16
问题 I am having trouble understanding this. I have been able to do such a project earlier on but now a similar approach isn't working for me. Here is the issue: I have a UIPageViewController that has 4 storyViewControllers . Each storyViewControllers has a custom containerView . I want to add 'n' number of UIViews on the containerView . I am sending the dataSource or 'n' from the view controller. However, I am not able to correctly lay out the subviews on the container view. Essentially I want to

Adding CPTGraphHostingView as a subview

╄→尐↘猪︶ㄣ 提交于 2020-01-05 18:25:10
问题 There isn't a lot of questions about this and none of them were answered in a way that could solve my problem, still sorry if I'm asking something that was asked already. My problem is that I'd like to use core plot to draw a graph inside a view. So I add the view on IB in my appviewcontroller.xib , but thenI can't find how to link that specific zone I just defined on IB to the file's owner. A bit of precision: I managed to use core plot in another application, when it was the main view, but

Autolayout in UIView where is safe to ask computed layout values?

不想你离开。 提交于 2020-01-05 07:48:51
问题 I've got this issue. I'm using a collection view as a subview of the main view of a UIViewController . The collection view is pinned to the superview size, thus it has 4 constraints for lead,trail, top and bottom with constants equal to 0. The cell is a subclass to UICollectionViewCell and is composed by: first header view second header view UITableView The collection view cell is loaded from xib and the interface of the views is made for 4 inches devices. The first header view is pinned at