Let me first explain the context here. I am developing an iOS 6.1 application using Xcode 4.6. I have created a table view controller in which I have connected 4 views. The first view is the main view, the one which I am working on.
Right now I have two buttons on the main view. A yes and a no button. I have created a viewcontroller_main subclass and connected it to my main view by altering its class in the identity inspector.
I have created my own class myclass which has one function called go. In my viewcontroller_main.h I have added an -(IBAction)button_no and another for the yes. I then linked them by clicking the main view and connecting the functions to the buttons via the connections inspector.
Now here is where my problem is. My yes button currently just logs 'yes' to the console via NSLog i.e.
//viewcontroller_main.m
- (IBAction)button_yes {
NSLog(@"Yes was pressed");
}
However, my no button creates an object myclass* myname and then it does myname.go. I have another NSLog function to display "no" in the go method implementation in the myclass.m file.
//viewcontroller_main.m
- (IBAction)button_no {
myclass* myname;
myname.go;
}
//myclass.m
- (void)go {
NSLog(@"no was pressed")
}
How do you explain this behaviour? Why would I not see a console log when calling myname.go?