• 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: Today is messed up
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Today is messed up


  • Subject: Re: Today is messed up
  • From: Derek Chesterfield <email@hidden>
  • Date: Sun, 10 Aug 2003 15:06:39 +0100

As a novice myself, I don't know for certain. BUT, I guess you should initialise way with something. And the release ISN'T required, since you didn't alloc the object, or retain it. Although my sketchy understanding leaves me to believe that it doesn't hurt to release autorelease pool objects (although I might be wrong about that).

On Sunday, August 10, 2003, at 9:58 AM, Wesley Penner wrote:

I'm having trouble with this bit of code. Can anyone explain why?

- (int)setupDates {
int way;
NSCalendarDate *today = [NSCalendarDate calendarDate];
[today years:NULL months:NULL days:&way hours:NULL minutes:NULL
seconds:NULL sinceDate:startDate]; // <-- debugger stops here
way++;
....
[today release]; // <-- is this really necessary? Added when the
problems started to try and circumvent them
}

The first time through it performs as expected, assigning way to be the
number of days since startDate (set elsewhere). However, when I reset
startDate and call this a second time, it ends with "EXC_BAD_ACCESS".
(By the by, what does that mean anyway? I found no reference in the
documentation.)

The debugger shows that within the variable today there is a problem:
*((((((today)->isa)->cache)->buckets)[0]->method_types) [-[Controller
setupDates]0-Thread-1] :: out of scope
_______________________________________________
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.

  • Follow-Ups:
    • Re: Today is messed up
      • From: Charles Srstka <email@hidden>
    • Re: Today is messed up
      • From: "Alastair J.Houghton" <email@hidden>
References: 
 >Today is messed up (From: Wesley Penner <email@hidden>)

  • Prev by Date: Re: Today is messed up
  • Next by Date: Re: Scrolling Thumbnails (Like Preview)
  • Previous by thread: Re: Today is messed up
  • Next by thread: Re: Today is messed up
  • Index(es):
    • Date
    • Thread