Re: something I can't understand
Re: something I can't understand
- Subject: Re: something I can't understand
- From: Bill Bumgarner <email@hidden>
- Date: Wed, 29 Jul 2009 12:50:36 -0700
On Jul 29, 2009, at 12:20 PM, Agha Khan wrote:
Well after spending whole 2 days on a such a small problem I
understand this is a bug and Apple has to fix it. The bug is If you
inherit for UIButton then it is not going to work.
Given that this code is really really basic stuff, do you really think
that there would be a bug along this code path?
Pretty darned unlikely. Assuming you are using @synthesize to
synthesize the setter/getter for that property, there are many
hundreds of other code paths that do exactly that and those paths are
executed billions of times per day across all the iPhones in the
world. That is an awful lot of evidence that @synthesize &
properties is working just fine.
So, no, this isn't a bug that Apple has to fix. It is a bug that you
have to fix. Or a bug that you have to demonstrate isn't your bug,
which you haven't done yet.
It worked fine on
CGPoint pt = CGPointMake((bVerticalDisplay == YES) ? 250 :
410,50); // No problem.
but it did not work
CGPoint pt = pPngButton.verticalLoc; // GOt
__TERMINATING__DUE_TO_UNCAUGHT_EXCEPTION__
so I removed that line.
and tried
CGPoint pt = CGPointMake((bVerticalDisplay == YES) ? 250 :
410,50); // No problem.
pPngButton.verticalLoc = pt; // Again GOt
__TERMINATING__DUE_TO_UNCAUGHT_EXCEPTION__
What is the one common case for both of the lines of code that crash?
pPngButton.verticalLoc
Are you absolutely positively sure that pPngButton is actually a valid
object at the point above where the crash happens?
I'd bet you a pitcher of beer it isn't or that you have implemented -
verticalLoc and -setVerticalLoc: incorrectly (if not using
@synthesize). I'd wager that you have not properly retained or may
have over-released the object sometime prior.
Try inserting [pPngButton self] above either of the crashing lines.
More likely than not, *that* will crash.
Some time ago, you wrote:
PngButton* pPngButton = [PngButton
buttonWithType:UIButtonTypeInfoDark];
[pPngButton setFrame:CGRectMake(screenRect.size.width - 70.0, 50.0,
36, 36)]; // No problem
pPngButton.verticalLoc = CGPointMake((bVerticalDisplay == YES) ?
250 : 410, 50.0);
Is this the entirety of your code that refers to pPngButton? Is it
really all contiguous like that? Or does that latter line of code
appear in a different method? Where are you retaining
pPngButton? ...do you stick it in view hierarchy somewhere?
b.bum
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden