• 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: strange semi-newbie issue SOLVED with questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strange semi-newbie issue SOLVED with questions


  • Subject: Re: strange semi-newbie issue SOLVED with questions
  • From: Andrew Kinnie <email@hidden>
  • Date: Sun, 8 Feb 2004 20:13:53 -0500

Hmm. using a local variable worked (thanks enormously), and I imagine
using a local variable is better form.

In otherwords, the LineItem class has an instance variable called item,
and an accessor method for it with the same name (which I understood
was standard cocoa practice?). Why would [item price] not return the
same value each time? The textual stuff was just for debugging, but I
guess I don't understand what was wrong with what I did?

Thanks for your help, this has been annoying me for a couple days now.

Andrew

On Feb 8, 2004, at 7:24 PM, String wrote:

>
> Problems w/my ISP and attachments... see below for working test xcode
> project
> Begin forwarded message:
>
>> From: String <email@hidden>
>> Date: February 8, 2004 5:54:38 PM CST
>> To: Andrew Kinnie <email@hidden>
>> Subject: Re: strange semi-newbie issue
>>
>> This code has expected results. I think the problem might be that
>> you have price as a variable and a method.
>>
>>
>> Also, you are sending a message to 'item' 3X to get the same value.
>> Why not init a local variable and do it once ? Also, you are doing
>> the math price * quantity 2X
>>
>> e.g.
>> double p = [item price]
>> NSLog(@....". p);
>> NSLog("@...", q);
>> double pq = p * q;
>> NSLog("@...", pq);
>> return pq;
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Need help moving an NSSlider
  • Next by Date: Re: Converting wchar_t string to NSString
  • Previous by thread: Re: Need help moving an NSSlider
  • Next by thread: adding to my UI
  • Index(es):
    • Date
    • Thread