ibaction

How to access IBOutlets declared in superclass?

。_饼干妹妹 提交于 2019-12-18 12:20:28
问题 I'm currently refactoring a couple of view controllers that share a few IBOutlet s and IBAction methods. I moved the outlet declarations and the IBAction method into a superclass, cutting these out of the subclasses. Now, when I open up Interface Builder, I find that I can't see the outlets or actions declared in the superclass. The connections still exist, as I'd wired them up before the refactoring, but they're grayed out. (It's important to note that the connections also WORK, as my action

how to access from UICollectionViewCell the indexPath of the Cell in UICollectionView

妖精的绣舞 提交于 2019-12-17 22:17:59
问题 i want to animate the UICollectionViewCell when action is called. i have done UICollectionViewCell in Interface Builder , the UICollectionView also. Now i want to get the correct indexPath at my actionBtnAddToCard method. thats the way i try it now (method in ProduktViewCell.m): - (IBAction)actionAddToCart:(id)sender { XLog(@""); // see this line NSIndexPath *indexPath = ??** how can i access the correct indexPath**??; SortimentViewController *svc = [[SortimentViewController alloc]

IOS: one IBAction for multiple buttons

帅比萌擦擦* 提交于 2019-12-17 10:44:18
问题 In my project I must control action of 40 buttons, but I don't want to create 40 IBAction, can I use only a IBAction, how? 回答1: If you're using interface builder to create the buttons, simply point them at the same IBAction in the relevant class. You can then differentiate between the buttons within the IBAction method either by reading the text from the button... - (IBAction)buttonClicked:(id)sender { NSLog(@"Button pressed: %@", [sender currentTitle]); } ...or by setting the tag property in

UIButton events. What's the difference?

こ雲淡風輕ζ 提交于 2019-12-17 07:03:09
问题 I've encountered a problem where my button should remain "pressed down" while it shows popover called from it. Popover is selector for some filter and filter is shown on button itself. When I tap on it and it shows popover it becomes deselected no matter what. I think I have to redefine it's behavior on touch event and make it respond not to standart touch up inside . Then I wondered what are other events responsible for? But I couldn't find events list in iOS library and in StackOverflow are

UIButton events. What's the difference?

ε祈祈猫儿з 提交于 2019-12-17 07:03:01
问题 I've encountered a problem where my button should remain "pressed down" while it shows popover called from it. Popover is selector for some filter and filter is shown on button itself. When I tap on it and it shows popover it becomes deselected no matter what. I think I have to redefine it's behavior on touch event and make it respond not to standart touch up inside . Then I wondered what are other events responsible for? But I couldn't find events list in iOS library and in StackOverflow are

Can't create IBAction ctrl-dragging UIButton to ViewController (Xcode Version 7.2)

蹲街弑〆低调 提交于 2019-12-13 13:31:50
问题 In the middle of my creating the app, xcode quit allowing me to ctrl-drag UIButtons to VCs for creating IBActions. This happens on every VC (nine in all). It does allow for creating Outlets, though. (Pls see image -> no Action selection is showing) xcode Version 7.2 (7C68) build target is ios9. Is there a way to fix this? 回答1: Some things to try: Make sure you are using one of the "Sent Events" to create the IBAction - not a Triggered Segue (that will do what you are describing) or other

How to call IBAction in subview?

旧城冷巷雨未停 提交于 2019-12-13 08:52:23
问题 When I try to call IBAction in root view it works, but when I call in subView app creashes. Code: - (IBAction)webButton:(id)sender { NSLog(@"doesn't print log"); } Here is ss off crash: http://dl.dropbox.com/u/77033905/urlInSafariCrashesUp.png Thank's for help UPDATE: Example code: http://dl.dropbox.com/u/77033905/IBActionSubView.zip 回答1: When you create your SubViewController, the variable sub that points to it is local to the addSubViewButton: method and will be released when that method

How to perform modalSegue?

时光总嘲笑我的痴心妄想 提交于 2019-12-13 06:29:13
问题 I'm building an iOS app. I have integrated facebook login in my app and implemented modal segue means when user logged in successfully it goes on next view. I'm facing a problem that is after logged in i'm not able to go on next view.one thing more i'm not able to do that when user already logged in on my app through facebook and come back after closing the app it should be on Next ViewController not on login screen again. Storyboard flow is: Login screen --> Modal Segue --> Navigation

Updating text in ViewController using Save function

核能气质少年 提交于 2019-12-13 03:06:38
问题 I'm having a hard time figuring out how to implement the save function to update text in a View Controller. I've been working from the Wenderlich tutorial: https://www.raywenderlich.com/160519/storyboards-tutorial-ios-10-getting-started-part-2 but that is for a TableViewController and uses .append to add saved items to an array, which I can't use since I'm using a simple View Controller. I want a string that's saved in a TableViewController to be displayed in the View Controller. This is what

can an (IBAction) method be sent a message?

你说的曾经没有我的故事 提交于 2019-12-13 03:00:55
问题 I want to delay between each output result for say, 1 second. The very last line of the following code is throwing an error "Use of undeclared identifier 'dealCard'", but I have declared it in the header file as shown below. - (IBAction)startPause:(id)sender { if ([self.deal length]>cardNum) { timer = [NSTimer timerWithTimeInterval:1.0 target:self selector:@selector(dealCard) userInfo:nil repeats:NO]; card.text = [NSString stringWithFormat:@"%i",cardNum]; [timer fire]; } } - (void) dealCard{