0

I have a Tab-Bar Application for this iPhone application I am making. I make a simple button on the 3rd view (3rd tab), and give it an IBAction to give an alert view. When I press build and go, everything works out fine. I go onto the 3rd tab, and I press my button. It simply crashes... Why is this happening? Everything I put in this 3rd tab crashes. I create a simple view controller, and write the class files to start over, but I keep getting the same errors.. Everything works fine on my first tab, where I originally got the first view controller..

P.S> It also says Incomplete Implementation of Class 'ThirdViewController'. I don't know why its there..

If anyone can help me out here, i would greatly appreciate it.

Kevin

lab12
  • 6,400
  • 21
  • 68
  • 106

1 Answers1

0

It's and UIAlertView, right ? This class requires the implementation of the protocol UIAlertViewDelegate and the method alertView:clickedButtonAtIndex: to handle the button click, that's why the compiler tell you that it's incomplete.

Anyway i expirienced some problems on the UIAlertView the first time i used it. My issues was on the otherButtonTitles parameters, the list must be terminated by nil, like this:

[myAlert initWithTitle:@"title" message:@"body " delegate:self cancelButtonTitle:@"cancel" otherButtonTitles:@"ok",@"ignore",@"retry",nil];

Anyway, you can find useful debug about the crash into your console, try to post it here.

Cesar
  • 4,418
  • 2
  • 31
  • 37
  • why doesn't it need it in the firstviewcontroller? – lab12 Apr 30 '10 at 02:25
  • I also have the MFMailComposeViewController implemented as well. There are a ton of things I added in this viewcontroller classes.. I don't know why they aren't responding. It just keeps crashing. Everything I put in it crashes.. – lab12 Apr 30 '10 at 02:28
  • I have 2 buttons actually. I also added a button where it opens a mailcomposer. When I press it, it gives me "EXC_BAD_ACCESS" in the debugger. It also gives me obc_msgSend... Can somebody please help me.. :( – lab12 Apr 30 '10 at 02:35
  • I need more information, does it crash after of before entering the the click method ? – Cesar Apr 30 '10 at 02:46
  • Before, it doesn't even show the alert, or compose the email. Right when I click it, it just crashes. – lab12 Apr 30 '10 at 10:57
  • Ok, check if you have any broken link on the items of your view using Interface Builder. If you delete a linked method from the code you have also to clean by hand the link in IB – Cesar Apr 30 '10 at 14:25
  • I made a copy of it here.. (this is not the full version)... I simply copied the code into a new project, but it still will not work. This time in the new project, the button does not reveal the mail composer.. You can download it here.. http://www.heliotop.org/test.zip – lab12 Apr 30 '10 at 18:55
  • downloaded but i think i don't have the right version of the SDK, it crash just after int retVal = UIApplicationMain(argc, argv, nil, nil); in the main... – Cesar May 01 '10 at 00:01
  • Ok, in the code downloaded there is a broken link into IB about the window in mainWindow.xib (there is also a warning) – Cesar May 01 '10 at 00:07
  • Oh, I am using XCode 4.0 from the iPhone Developer website.. Can you point out to me where the broken link is?? – lab12 May 01 '10 at 00:16
  • Wow IT WORKS. I found it.. Thanks alot! – lab12 May 01 '10 at 00:18