 |
 |
|
 |
01-14-2010, 06:41 AM
|
#1 (permalink)
|
|
Registered Member
Join Date: Aug 2009
Posts: 23
|
Crashing with uncaught exception 'NSInvalidArgumentException'
Hi,
I am changing views with this code:
Code:
//Loading old view
MainScreenViewController *mainScreenController = [[MainScreenViewController alloc]
initWithNibName:@"MainScreenView"
bundle:nil];
self.mainScreenViewController = mainScreenController;
[mainScreenController release];
//Loading new view
CreditsViewController *creditsController = [[CreditsViewController alloc]
initWithNibName:@"CreditsView"
bundle:nil];
self.creditsViewController = creditsController;
[mainScreenController release];
//UIAnimation changing over the view
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:window cache:YES];
[mainScreenViewController.view removeFromSuperview];
[self.window addSubview:[creditsViewController view]];
[UIView commitAnimations];
But it crashes with this:
Quote:
2010-01-14 12:32:18.154 AppName[10270:207] *** -[UIViewAnimationState view]: unrecognized selector sent to instance 0xf173f0
2010-01-14 12:32:18.155 AppName[10270:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIViewAnimationState view]: unrecognized selector sent to instance 0xf173f0'
2010-01-14 12:32:18.156 AppName[10270:207] Stack: (
807902715,
2540573961,
808284155,
807854166,
807706786,
11610,
12894,
814709201,
815110321,
815119058,
815114270,
814813151,
814722763,
814748641,
839148405,
807687520,
807683624,
839142449,
839142646,
814752238,
10992,
10846
)
|
I do not know why this is happening?
Last edited by alexstuckey; 04-24-2010 at 10:08 AM.
|
|
|
01-14-2010, 08:58 AM
|
#2 (permalink)
|
|
Registered Member
Join Date: Sep 2009
Location: Germany
Posts: 100
|
Use the debugger and look in which line the error occurs.
That would be my first step.
Best Regards.
|
|
|
01-14-2010, 09:39 AM
|
#3 (permalink)
|
|
Registered Member
Join Date: Aug 2009
Posts: 23
|
Quote:
Originally Posted by PHANTOMIAS
Use the debugger and look in which line the error occurs.
That would be my first step.
Best Regards.
|
Thank you, I just tried it and using breakpoints I have found that the offending line is
Code:
[self.window addSubview:[creditsViewController view]];
Do you have any ideas what is going on?
|
|
|
01-14-2010, 09:41 AM
|
#4 (permalink)
|
|
Registered Member
Join Date: Dec 2009
Location: Washington, DC
Posts: 77
|
I think your second release should be of creditsController not mainScreenController.
|
|
|
01-14-2010, 09:49 AM
|
#5 (permalink)
|
|
Registered Member
Join Date: Aug 2009
Posts: 23
|
Quote:
Originally Posted by inlvrwetrst
I think your second release should be of creditsController not mainScreenController.
|
Thank you so much! I have been trying to fix that myself for hours. It is amazing how you overlook something when you look at it for too long!
Thank you again.
Alex.
|
|
|
01-14-2010, 10:14 AM
|
#6 (permalink)
|
|
Registered Member
Join Date: Dec 2009
Location: Washington, DC
Posts: 77
|
Glad to help!
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 329 |
| 9 members and 320 guests |
| 2Apps1Day, akacaj, Domele, michelle, NSString, SLIC, soohyun, Techgirl-52, v1n2e7t |
| Most users ever online was 1,387, 04-10-2012 at 04:21 AM. |
» Stats |
Members: 175,650
Threads: 94,114
Posts: 402,886
Top Poster: BrianSlick (7,990)
|
| Welcome to our newest member, soohyun |
|