problem about ibaction-Collection of common programming errors


  • Josh Caswell
    ios xcode interface-builder ibaction iboutlet
    I am using XCode 4.6.3 to try iOS “hello world” like applications. I am able to create actions for UI elements using CTRL+Drag. My question is, how does XCode track which method is associated with a certain element. There is no such indication in the ViewController.m.

  • Justin
    iphone objective-c object ibaction
    I’m sure this is going to sound very weird, but I’ll ask anyway. I have made multiple working applications for the iPhone, but I have to add everything to the original view controller. If I don’t do so, the app crashes. Here is my example:In the view controller:- (IBAction) someAction: (id) sender {NSLog(@”lajkrbgl”);}This works just fine. But, if I do the “Add File” and I choose “Objective-C Class”, and put the same code in, the app just crashes whenever I press the button. How can I add more o

  • Cuzog
    iphone interface-builder modal-dialog selector ibaction
    I’m trying to implement a partial overlay modal in my app with the code from “Semi-Modal (Transparent) Dialogs on the iPhone” at ramin.firoozye.com. The overlay functionality works and it slides the modal into view, but calling any IBAction from the modal’s controller causes an “Unrecognized Selector Sent to Instance” crash.I recreated the basic functionality with that code isolated, and it triggers the same error. To see what I’m talking about, you can download the test project here.I’m sure I’

  • CroiOS
    iphone objective-c ibaction
    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.pngThank’s for helpUPDATE: Example code: http://dl.dropbox.com/u/77033905/IBActionSubView.zip

  • swnsn
    iphone uiviewcontroller uinavigationcontroller ibaction
    i am having an issue where when i call an IBaction from a certain viewcontroller the app crashes, but i can get the desired result elsewhere.basically i have a navigationcontroller buried in a tab bar controller. if i call an IBActions from the first view of the navigationcontroller it works fine, but if i create a view with an initWithNib and push it on to the navcontroller stack and then try to call an IBAction on the instance of the viewcontroller i pushed on the stack the app crashes.when t

  • vodkhang
    iphone objective-c arrays ibaction
    Hey all, I have an array that holds all of the .aif file paths in my app, which I found by using mainBundle and resources.This array needs to be passed down through 2 view controllers to reach where it is actually used. The problem is, it either crashes or logs something totally wrong. When I debug I get an EXC_BAD_ACCESS note at the crash, but not when I run it normally where it just crashes.Here’s the place where it works;- (void)buildDrumTrigger {defaultSounds = [[NSArray alloc] initWithObjec

  • Kheldar
    iphone objective-c ios uitableviewcell ibaction
    I have UItableViewCell created with a nib file, and have put in my cell a button. i hace created an IBAction to associate an action when the the user click the button.but i have a crash and i don’t know what it is the problem, i have set all the things necessary.//in my .h -(IBAction)go; //in my .m -(IBAction)go { NSLog(@”hello”); } but i have a crash and nothing is show in the consol debug.how can i set a button in UITableviewcell and associate with this button an action. thanks for your answe

  • Helium3
    iphone uibutton ibaction
    If I link an IBAction to multiple buttons, if multiple calls to this IBAction where done simultaneously would it cause interference or a crash. Will each one have to wait for the other, or is it concurrent?Thanks

  • Omar
    ios objective-c storyboard viewcontroller ibaction
    I have an IBAction in my project, when user presses button, it should load a new view controller, however the code seems to be crashingMy code is as follows:- (IBAction)PurchaseItem:(id)sender {PurchasedViewController *purchaseContr = (PurchasedViewController *)[self.storyboard instantiateViewControllerWithIdentifier:@”ShowAd”];_purchaseController.productID = @”com.id”;purchaseContr.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;[self presentViewController:purchaseContr animated:YES

  • hanumanDev
    iphone objective-c ios ibaction
    When I run this action from a button in IB the method is called fine. If I run it from code the app crashes with an unrecognized selector sent to instance errorhere’s the method:-(void)bottomCenter:(id)sender {[self popover:sender]; }-(void)popover:(id)sender {//the controller we want to present as a popoverDemoTableController *controller = [[DemoTableController alloc] initWithStyle:UITableViewStylePlain];controller.delegate = self;popover = [[FPPopoverController alloc] initWithViewController:co

  • A Common Man
    iphone ios objective-c nsarray ibaction
    So, I’m trying to run this code in my iPhone App but the app keeps on crashing. Any solutions?- (IBAction)logOutBtnDown:(id)sender {[PFUser logOut];NSArray *quotes;int r;quotes = [NSArray arrayWithObjects:@”R u done yet”,@”Log in again”,@”Try Me”,@”SMD”,@”We can do this all day”,@”IDC your eating up ur RAM”,”Please just connect to the servers”,@”You are not giving up are u”,@”Forget it I quit”,@”Imma tell TDK”,nil];r = arc4random() % 10;[_welcomeLabel setText:[NSString stringWithFormat:@” %@”, [

  • Scar
    objective-c ipad exception ibaction
    I have two custom buttons with same IBAction. It is connected properly via connections inspector. The xib is loaded to a view on another xib which is added as shown belowOnBoardView *onBoardObj = [[OnBoardView alloc]init];[detailView addSubview:onBoardObj.view];The buttons are on the OnBoardView. The IBAction is as shown below.#import <UIKit/UIKit.h>@interface OnBoardView : UIViewController {IBOutlet UIWebView *pdfView;NSArray *pdfNames;IBOutlet UIButton *nextBtn, *prevBtn; }-(IBAction)sho

  • Eshwar Chaitanya
    iphone uipickerview ibaction
    I have a picker view,when the row component of a picker view is selected,it navigates to a view,there I have a button changeGroup.On clicking the button the picker view must appear,but it is not happening! Its crashingHere is my code:- (void)viewDidLoad { groupArr = [[[NSMutableArray alloc]initWithObjects:@”Family”,@”Friends”,@”Office”,@”Acquaintances”, nil]autorelease];agrpPicker.hidden = YES; }#pragma mark- #pragma mark PickerView Datasource-(NSInteger)numberOfComponentsInPickerView:(UIPicker

  • Ash Furrow
    objective-c ios xcode ibaction
    I have a button within interface builder that has a ‘0’ tag on it. The button has a method linked to it called -(IBAction) doTest:(id)sender.I have the doTest method within my .m file as shown below:-(IBAction) doTest:(id)sender {int currentSelection= [sender tag];if (currentSelection == 0){// do something} }However my app crashes with the following error message and I have no idea why. Any help would be appreciated. Thanks.[groceryapp doTest]: unrecognized selector sent to instance 0xc29c00 201

  • Boos1993
    ios xcode ibaction iboutlet
    I was working on my iOS app last night when I went to test it and it crashed on startup. I wasn’t even working on the nib that is causing the crash. Anyways, here is the error code:2/29/12 10:32:05.291 AM Safe Flight: *** Terminating app due to uncaught exception ‘NSUnknownKeyException’, reason: ‘[<UIApplication 0xdd496f0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Airport1.’ *** First throw call stack: (0x2873052 0x33add0a 0x2872f11 0x1ae2032 0x1a

  • JasonClark
    iphone-sdk-3.0 uiviewcontroller crash ibaction
    I have a couple UIViewControllers that I am trying to access an array inside my AppDelegate. When I use an IBAction UIButton and in that method I access my AppDelegate my program dies silently. Nothing in output or the debugger, it just stops. If I run it several times I can see that it is failing to access the array properly.To investigate this problem I created a very basic app.In my AppDelegate.h I declared and set properties for the array#import <UIKit/UIKit.h> @class MyViewController;

  • user1678809
    objective-c xcode switch-statement ibaction
    I’ve looked over the site for a while and I saw a few things but nothing worked for me. Extreme newbie here though.I’m trying to make a 2 component picker, populated from arrays, populated from a dictionary, populated from a plist. The components populate, and I have a button that spins one component. The second button is meant to check answers (the first component has states which they try to match with capitals in the second component), but this is where it always crashes.The error I get is as

  • David West
    ios objective-c uibutton ibaction uistoryboardsegue
    I know the unrecognized selector to instance message is very common but I can’t seem to find what’s causing it in my project. I’m trying to basically segue from one controller to another when a particular button is tapped. I define the segue in storyboard. The buttons however are not created in storyboard, the buttons are created programmatically in a view controller, which is then inherited by the controller that I’m trying to segue from. Here’s the code of what I’m trying to do: First this is

  • Henry
    iphone objective-c xcode cocoa ibaction
    I’m working in Xcode 4.3.2.I am new to Xcode. I’m building an application that must change to different views on button clicks. My files are: AppDelegate.h/.m, GreenViewController.h/.m, SwitchViewController.h/.m, GreenView.xib – I am not using storyboards, but my project demands that I don’t use them (backwards compatibility issues).Here’s my problem (it seems very simple): I’m trying to print to the console when a UIButton (placed in GreenView.xib) is clicked. Here’s my code for GreenViewContro

  • Spectravideo328
    ibaction cs193p uncaught-exception uistepper
    I’m following Paul Hegarty’s CS193P course video (lecture #4 @ 1:05:40 mark) and ran into problems. Please help debug this ‘unrecognized selector sent to instance’ error. The view has three objects – see image (https://docs.google.com/file/d/0B453_F6cDmYzMG1OQW93WVptYUU/edit?usp=sharing)The code// AttributeViewController.m// Attribute#import “AttributeViewController.h”@interface AttributeViewController ()@property (weak, nonatomic) IBOutlet UILabel *label; // collection of w

  • Shizam
    objective-c index nsmutablearray uialertview ibaction
    Ok, so i have a UITableView set up programatically, and it is populated with all the names of the states. When you click on one of the cells, for ex. ALABAMA, a UIAlertView will appear With the title being that of the state you just clicked on (ALABAMA) and a number that correlates to that state, which is in another NSMutable Array. Every state has a differnt number to correlate with it. This number is actually a placeholder text in the UIAlert, and the purpose of the alert is so that you can in

  • user1450221
    ios xcode if-statement uipickerview ibaction
    I have a pickerView and depending on the selection in that pickerView i want a button(calculate button) to perform one of two mathematical operations. The pickerView has one component, and 2 rows male, and female. If the user selects male, and then hits calculate button, i want the program to use one formula. If the user selects female, and then his the calculate button i want the program to use a different formula. I tired using. -(IBaction)caclulate{if ([pickerView isEqual:sexPickerView] )

  • TechZen
    iphone interface-builder selector ibaction
    I’m working on my first real iPhone app, a simple To-Do list application to help me organize stuff, except I’m getting an “unrecognized selector sent to instance 0x”.Specifically:2010-02-20 14:30:09.200 ToDoApp[88562:20b] *** -[NSCFDictionary switchViews:]: unrecognized selector sent to instance 0x3d22de02010-02-20 14:30:09.201 ToDoApp[88562:20b] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘*** -[NSCFDictionary switchViews:]: unrecognized selector sent to

  • Collin Mason
    iphone uiviewcontroller uitabbarcontroller modalviewcontroller ibaction
    I have a Window-based TabBarController app and I’m trying to present a ModalView from one of the tabs (FirstViewController). The app builds just fine and the tabs work, but upon clicking the “Open Modal View” button, it crashes and gives me:Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[UIViewController openModalView]: unrecognized selector sent to instance 0x5d1e930’UPDATE: I have found that the issue is not with presenting the modal view but the crash happe

  • user768113
    ipad uiviewcontroller uiscrollview ibaction inside
    I’m designing an iPad app where little UIScrollViews have their own UIViewController . Those controllers have in their view a button that call an IBAction method. But it isnt working, in fact, it doesnt seem that they are being pressed in the simulator.Here is some code to give you an idea of what im am doing .// In UIViewController A (say the parent or root that have several UIScrollViews)MiniViewController * mini = [[MiniViewController alloc]init];[scrollView1 addSubview:mini.view];//repeat th

  • Link
    iphone ios exception subview ibaction
    I am creating a simple app that let’s the user view movies after clicking buttons. The first screen you see is the Main Menu with 2 buttons. One of them sends the user to a sub view which I coded as this in an IBAction method:ViewConroller *nextView = [[ViewController alloc] initWithNibName:@”NextMenu” bundle nil]; [self.view addSubview:[nextView view]]; [nextView release];This part is fine except that the sub view shows a 20 px bar across the bottom of the previous view. I looked around and non

Web site is in building