• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: something I can't understand
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: something I can't understand


  • Subject: Re: something I can't understand
  • From: Agha Khan <email@hidden>
  • Date: Wed, 29 Jul 2009 12:20:55 -0700


Thank you for reply.

I am working with Windows for 15 years but new to Objective-C.
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.


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__


I have no choice but to abandoned that approach and save that data somewhere else.

Thank you helping me. I am not sure how can we report that bug to Apple.

Best regards
Agha

On Jul 29, 2009, at 11:56 AM, Dragos Ionel wrote:

Actually it was my mistake as pointed by Glenn and Wagner.

My apologies to have misled.

Dragos
iphodea.com


On Wed, Jul 29, 2009 at 2:40 PM, Agha Khan <email@hidden> wrote:
Hi Dragos lonal:
I didn't mention they have readonly attributes. How can we remove readonly attribute?


Thanks for reply.

Agha
On Jul 29, 2009, at 6:35 AM, Dragos Ionel wrote:

verticalLoc and x are readonly values, you cannot assign them.

use the frame property, first to retrieve it, change the x value and then to reassign to the button.

something like

CGFrame frame = pPngButton.frame;
frame.x = ...;
pPngButton.frame = frame;

Dragos


On Wed, Jul 29, 2009 at 3:24 AM, Agha Khan <email@hidden> wrote: Hi: Thank you for your reply. Oh yes. It an Objective-C class.

regardless I place (bVerticalDisplay == YES) or not. The function silently fails, with no warnings.
The I decided to
pPngButton.verticalLoc.x = (bVerticalDisplay == YES) ? 250 : 410;
This time I got warning.



error: lvalue required as left operand of assignment

Many thanks

-Agha




On Jul 28, 2009, at 7:59 PM, Kiel Gillard wrote:

On 29/07/2009, at 12:52 PM, Agha Khan wrote:

Hi:
I have a struct
@interface PngButton : UIButton
{
@public
       bool OffPos;
       CGPoint horizontalLoc;
       CGPoint verticalLoc;
}
@property (assign) bool OffPos;
@property (assign) CGPoint horizontalLoc;
@property (assign) CGPoint verticalLoc;
@end

No, you have an Objective-C class.

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);

I get an error
error: lvalue required as left operand of assignment

Why it is not working? I shouldn't get this error.
Any help will be very much appreciated.

Do you get any warnings?

Try this and see what happens:
pPngButton.verticalLoc = CGPointMake((bVerticalDisplay == YES ? 250.0 : 410.0), 50.0);


Kiel


_______________________________________________

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




_______________________________________________

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


  • Follow-Ups:
    • Re: something I can't understand
      • From: Bill Bumgarner <email@hidden>
References: 
 >something I can't understand (From: Agha Khan <email@hidden>)
 >Re: something I can't understand (From: Kiel Gillard <email@hidden>)
 >Re: something I can't understand (From: Agha Khan <email@hidden>)
 >Re: something I can't understand (From: Dragos Ionel <email@hidden>)
 >Re: something I can't understand (From: Agha Khan <email@hidden>)
 >Re: something I can't understand (From: Dragos Ionel <email@hidden>)

  • Prev by Date: Re: something I can't understand
  • Next by Date: Re: Fun (or not) with NSArrayControllers and CoreData.
  • Previous by thread: Re: something I can't understand
  • Next by thread: Re: something I can't understand
  • Index(es):
    • Date
    • Thread