No response to button clicking


#1

I have all of the code for the application but when I run it in the simulator and click on a button nothing happens any ideas?


#2

Have you tried to place a breakpoint in the method that you expect to be called (showQuestion: or showAnswer:)? If you place a breakpoint there and it is not called when you tap on the buttons, make sure your connections are set up in Interface Builder. See the section titled “Setting Targets and Actions” starting on page 17 in the 2nd edition of the book.


#3

Hi,

I started programming with the version of Xcode 4.3.2 and SDK 5.1. Same thing happened, the whole project was MVC as indicated by the book but … the buttons were not doing ‘click’. I solved commenting a line:

// self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

If you comment the method works quite well, I can change the color icluso background to the main window:

/*

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    // Override point for customization after application launch.
    // self.window.backgroundColor = [UIColor whiteColor];
    // [self.window makeKeyAndVisible];

    return YES;
    }

*/

Bye!!


#4

[quote=“sexitan0”]Hi,

I started programming with the version of Xcode 4.3.2 and SDK 5.1. Same thing happened, the whole project was MVC as indicated by the book but … the buttons were not doing ‘click’. I solved commenting a line:

// self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

If you comment the method works quite well, I can change the color icluso background to the main window:

/*

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    // Override point for customization after application launch.
    // self.window.backgroundColor = [UIColor whiteColor];
    // [self.window makeKeyAndVisible];

    return YES;
    }

*/

Bye!![/quote]

Also using XCode 4.3.2 and experienced the same issues that the button cant be clicked on launch. However, i commented out the chunk of code mentioned above in xAppDelegate.m > Under @synthesize window, and now it works! Thanks sexitan0… but any idea why that section of code was interfering with proper launch?