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 07-12-2011, 07:24 PM   #1 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Exclamation Crash

Hey,

I am pretty much loading up a setup view. I am doing that by making "Setup" its own XIB (thats how I want it), then animating it on screen by using UIView animations. I am a little bit in a dilemma here on top of having a crash because if I am loading up this XIB as a subview in say my "TestViewController", and my done method which slides the subview off screen is in my "Setup" view controller, would I just do [self.view removeFromSuperView]; ?

That was my first question/dilemma.

Now the reason I made this thread was because it is crashing in that done method in my setup view controller.

Here is the console log on why it is crashing...
Code:
-[NSPathStore2 doneSetup]: unrecognized selector sent to instance 0x299130
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSPathStore2 doneSetup]: unrecognized selector sent to instance 0x299130'
*** First throw call stack:
Here is my done method...
Code:
- (IBAction)doneSetup {
    
    UIImage *buttonImage = [pictureButton imageForState:UIControlStateNormal];
	NSDictionary *accountInfo = [NSDictionary dictionaryWithObjectsAndKeys:
                                    Ln.text, @"LN", 
                                    buttonImage, @"theImage", nil];
    
    [accounts addObject:accountInfo];
	
	
	if (Name.text == nil) {
		
		UIAlertView *namealert = [[UIAlertView alloc]
								  initWithTitle:@"LN field empty"
								  
								  message:@"There is no name entered in the field"
								  
								  delegate:self
								  
								  cancelButtonTitle:@"Dismiss"
								  
								  otherButtonTitles:nil];
		
		
		
		[namealert show];
		[namealert release];
		
	}
	else if (buttonImage == nil) {
		
		UIAlertView *pa = [[UIAlertView alloc]
						   initWithTitle:@"No picture entered"
						   
						   message:@"There is no picture entered"
						   
						   delegate:self
						   
						   cancelButtonTitle:@"Dismiss"
						   
						   otherButtonTitles:nil];
		
		[pa show];
		[pa release];
		
	}
	
	//if ((buttonImage != nil) && (LN != nil)) {
    
	self.view.center = CGPointMake(160,240);
        [UIView setAnimationDelegate:self];
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDidStopSelector:@selector(removeView)];
        [UIView setAnimationDuration:0.3];
        self.view.center = CGPointMake(160,660);
        [UIView commitAnimations];

	//}
}

- (void)removeView {[self.view removeFromSuperview];}
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8
Objective Zero is offline   Reply With Quote
Old 07-12-2011, 07:27 PM   #2 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

Instead of animating it yourself, why don't you just present it as a modal view?
Domele is offline   Reply With Quote
Old 07-12-2011, 07:28 PM   #3 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

Its not full-screen.
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8
Objective Zero is offline   Reply With Quote
Old 07-12-2011, 07:29 PM   #4 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

That was fast. Anyways it looks like a memory problem because you are messaging a NSPathStore object. Obviously it doesn't have that method so it's crashing.
Domele is offline   Reply With Quote
Old 07-12-2011, 07:41 PM   #5 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 42
Posts: 1,244
dljeffery is on a distinguished road
Default

It's a zombie. Your object is either not being retained or you've inadvertently released it too early. Most likely you just never retained it though.
__________________
Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Old 07-12-2011, 08:08 PM   #6 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

Quote:
Originally Posted by dljeffery View Post
It's a zombie. Your object is either not being retained or you've inadvertently released it too early. Most likely you just never retained it though.
Yea I would say so too because if I take away a memory hogging feature in that view, the app still crashes with EXC_BAD_ACCESS. And what object would are we talking about here?
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8
Objective Zero is offline   Reply With Quote
Old 07-12-2011, 08:12 PM   #7 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

Whatever object has the doneSetup method.
Domele is offline   Reply With Quote
Old 07-12-2011, 08:16 PM   #8 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

The object is a UIButton so you are saying the crash is because of the UIButton itself? If so, is it crashing because I am removing it from the superview?
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8
Objective Zero is offline   Reply With Quote
Old 07-12-2011, 08:19 PM   #9 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

No, like the class that implements doneSetup. Not the caller, the receiver.
Domele is offline   Reply With Quote
Old 07-12-2011, 08:22 PM   #10 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

So it is the class "Setup" that is causing the crash? Little bit confused, shouldn't it be a specific NSObject that is causing it?
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8
Objective Zero is offline   Reply With Quote
Old 07-12-2011, 08:30 PM   #11 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 42
Posts: 1,244
dljeffery is on a distinguished road
Default

Code:
-[NSPathStore2 doneSetup]: unrecognized selector sent to instance 0x299130
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSPathStore2 doneSetup]: unrecognized selector sent to instance 0x299130'
*** First throw call stack:
The crash is because "doneSetup" is getting sent to NSPathStore2, instead of to your object that actually implements "doneSetup". The reason is because you under-retained or over-released your object and it got deallocated, but you're still holding a pointer to it somewhere. And so when you sent the "doneSetup" message to that pointer, it was sent to a different object than you thought the pointer pointed to.
__________________
Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Old 07-12-2011, 08:38 PM   #12 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

Which object are you talking about though? I understand everything else but just not sure which object your talking about.
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8
Objective Zero is offline   Reply With Quote
Old 07-12-2011, 08:47 PM   #13 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

The object that has the method doneSetup. If you were calling addSubview, the object that has the method is a UIView.
Domele is offline   Reply With Quote
Old 07-12-2011, 08:48 PM   #14 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 42
Posts: 1,244
dljeffery is on a distinguished road
Default

Your object that implements "doneSetup"; not sure what the class is called because you didn't show that part of the code.

Turn on NSZombies and re-test.
__________________
Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Old 07-12-2011, 08:56 PM   #15 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

Not sure what you mean by "has". What would have the method in my case? Is there anything wrong with the code I posted? Do you see anything wrong with it?

You probably think I'm a noob but I have been coding for 1+ year so I somewhat know what I am doing here.
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8
Objective Zero is offline   Reply With Quote
Old 07-12-2011, 09:03 PM   #16 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 42
Posts: 1,244
dljeffery is on a distinguished road
Default

Gah... you didn't post the relevant code. You only posted one method, which is the method you're trying to invoke but not reaching.

Seriously, just turn on NSZombie and re-run the app. Then you will know exactly where the call is originating.
__________________
Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Old 07-12-2011, 09:09 PM   #17 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

I already have NSZombie enabled, and that is what the debugger comes out with.
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8
Objective Zero is offline   Reply With Quote
Old 07-12-2011, 09:11 PM   #18 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

What is the name of the .m file where this method is implemented? That's your class.
Domele is offline   Reply With Quote
Old 07-12-2011, 09:12 PM   #19 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 42
Posts: 1,244
dljeffery is on a distinguished road
Default

Quote:
Originally Posted by Objective Zero View Post
I already have NSZombie enabled, and that is what the debugger comes out with.
In that case, the debugger will stop on the line that makes the crashing call to doneSetup. So, where does the debugger stop?
__________________
Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Old 07-12-2011, 09:12 PM   #20 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

Ok well the class name is Setup.m, so it has to be an object inside of it, right? NSZombie is only returning what I posted. I am not using allocations/leaks instrument because I don't think I need to.
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8
Objective Zero is offline   Reply With Quote
Old 07-12-2011, 09:14 PM   #21 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

The instance of Setup is getting released.
Domele is offline   Reply With Quote
Old 07-12-2011, 09:15 PM   #22 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

On this line in my main.m
Code:
 retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([TestAppDelegate class]));
Also says:
Thread 1: SIGABRT
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8
Objective Zero is offline   Reply With Quote
Old 07-12-2011, 09:18 PM   #23 (permalink)
Indie Developer
 
iSDK's Avatar
 
Join Date: Jul 2010
Posts: 1,346
iSDK is on a distinguished road
Send a message via AIM to iSDK
Default

You haven't set the button as a property of the UIViewController (nonatomic, retain), so it is never retained. I presume that the UIButton is declared as
Code:
[UIButton buttonWithType]
And therefore you are given a unretained, autoreleased UIButton. Make the UIButton a property with the attributes given above and you won't get this error.

The line where the error is occurring on is:

Code:
UIImage *image = [myAutoreleasedButton's imageForState:UIControlStateNormal]
iSDK is offline   Reply With Quote
Old 07-12-2011, 09:32 PM   #24 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

The button is created in IB and is not made programmatically.
I tried what you said anyway, and I get EXC_BAD_ACCESS in that same line in my last post with code.
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8
Objective Zero is offline   Reply With Quote
Old 07-12-2011, 09:56 PM   #25 (permalink)
Registered Member
 
Objective Zero's Avatar
 
Join Date: Oct 2010
Posts: 1,210
Objective Zero is on a distinguished road
Default

Even if I comment everything out of the method, it stills crashes with SIGABRT, I have no idea why. I have never seen anything like this before.

It has something do with the class itself, so it looks like I understand more whats going on but still no idea how to fix it. Also if I click anything in the view, it crashes. Why?

Also this is how I present the view, if that makes a difference...
Code:
Setup *sp = [[Setup alloc] initWithNibName:@"Setup" bundle:nil];
        [self.view addSubview:sp.view];
        sp.view.center = CGPointMake(160,660);
        CALayer *imageLayer2 = [sp.view layer];
        [imageLayer2 setMasksToBounds:YES];
        [imageLayer2 setCornerRadius:10.0];
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDuration:0.3];
        sp.view.center = CGPointMake(160,240);
        [UIView commitAnimations];
        [sp release];
__________________
Questions?

Check out my OCR app!
http://itunes.apple.com/app/ocr-pro/id486512712?mt=8

Last edited by Objective Zero; 07-12-2011 at 10:03 PM.
Objective Zero is offline   Reply With Quote
Reply

Bookmarks

Tags
crash

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: 370
9 members and 361 guests
apatsufas, chemistry, Kirkout, leostc, lzwasyc, MarkC, Sami Gh, SamorodovAlex, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

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