Skip navigation.
 
mlRe: Newbie question: chrash on [tableview reloadData]
FROM : Fritz Anderson
DATE : Thu Nov 21 21:50:40 2002

There's your problem: Neither dirEnumerator nor currentName came to you
by a 'copy,' 'new,' or 'alloc' method, and you never retained them, so
they were not yours to release. They were either autoreleased when you
got them, or referred to objects whose owners would release them for
you.

The release messages are where the error occurred, but it didn't mature
to a crash until it came time to refresh the NSTableView. It had
nothing to do with your NSMutableArray at all.

   -- F

On Thursday, November 21, 2002, at 02:30  PM, Terje Tjervaag wrote:

> Thanks to you who have replied.  I have now found the exact source of
> the crash.  From the source code listed below, if I comment out the
> [dirEnumerator release] line, like I have done below, the app runs
> fine.  I suppose then I am not meant to touch the
> NSDirectoryEnumerator after I have created it, but I really don't
> understand why this is affecting my NSMutableArray 'files' after I
> have finished filling it with filenames from the directory
> enumerator.  Anyone care to explain?
>
> NSDirectoryEnumerator *dirEnumerator = [[NSFileManager defaultManager]
> enumeratorAtPath:[path stringValue]];

...
>    while (currentName = [dirEnumerator nextObject]) {
...
>    }
>
>    // Make sure objects are released
>    //[dirEnumerator release];
>    //[currentName release];
>
>    // Refresh table
>    [self updateUI];
>

  --
Fritz Anderson - Consulting Programmer - Chicago, IL
Mail:        <<email_removed>>
Risumi:    <http://resume.manoverboard.org>
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlhow to crash on normally ignored exceptions Brian Redman Nov 21, 00:39
mlRe: how to crash on normally ignored exceptions Dan Wood Nov 21, 05:55
mlRe: how to crash on normally ignored exceptions Vince DeMarco Nov 21, 06:17
mlRe: how to crash on normally ignored exceptions Brian Redman Nov 21, 06:22
mlRe: how to crash on normally ignored exceptions Marcel Weiher Nov 21, 14:48
mlRe: how to crash on normally ignored exceptions David Remahl Nov 21, 15:02
mlNewbie question: chrash on [tableview reloadData] Terje Tjervaag Nov 21, 18:14
mlRe: Newbie question: chrash on [tableview reloadData] Warren.Burton Nov 21, 19:03
mlRe: Newbie question: chrash on [tableview reloadData] Fritz Anderson Nov 21, 20:25
mlRe: Newbie question: chrash on [tableview reloadData] Terje Tjervaag Nov 21, 20:25
mlRe: Newbie question: chrash on [tableview reloadData] Terje Tjervaag Nov 21, 21:30
mlRe: Newbie question: chrash on [tableview reloadData] Fritz Anderson Nov 21, 21:50
mlRe: how to crash on normally ignored exceptions matt neuburg Nov 22, 14:29
mlRe: how to crash on normally ignored exceptions David Remahl Nov 22, 14:35