Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-14-2010, 06:41 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 23
alexstuckey is on a distinguished road
Default 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.
alexstuckey is offline   Reply With Quote
Old 01-14-2010, 08:58 AM   #2 (permalink)
Registered Member
 
Join Date: Sep 2009
Location: Germany
Posts: 100
PHANTOMIAS is on a distinguished road
Default

Use the debugger and look in which line the error occurs.
That would be my first step.

Best Regards.
PHANTOMIAS is offline   Reply With Quote
Old 01-14-2010, 09:39 AM   #3 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 23
alexstuckey is on a distinguished road
Default

Quote:
Originally Posted by PHANTOMIAS View Post
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?
alexstuckey is offline   Reply With Quote
Old 01-14-2010, 09:41 AM   #4 (permalink)
Registered Member
 
Join Date: Dec 2009
Location: Washington, DC
Posts: 77
inlvrwetrst is on a distinguished road
Default

I think your second release should be of creditsController not mainScreenController.
inlvrwetrst is offline   Reply With Quote
Old 01-14-2010, 09:49 AM   #5 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 23
alexstuckey is on a distinguished road
Default

Quote:
Originally Posted by inlvrwetrst View Post
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.
alexstuckey is offline   Reply With Quote
Old 01-14-2010, 10:14 AM   #6 (permalink)
Registered Member
 
Join Date: Dec 2009
Location: Washington, DC
Posts: 77
inlvrwetrst is on a distinguished road
Default

Glad to help!
inlvrwetrst is offline   Reply With Quote
Reply

Bookmarks

Tags
animation, crash, selector, uiview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» 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
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:01 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0