tags:

views:

39

answers:

1

I am getting the nsMutaryOfDataObject value in the reload function but not getting it in in - (int)numberOfRowsInTableView:(NSTableView *)pTableViewObj... In this function mutablearray is getting nil.

I'm unable to understand why. How can this happen?

A: 

you have to retain the array, the other class that creates it probably releases it.

- (void) setMutableArray:(NSMutableArray *)arr
{
  [instanceVar release];
  instanceVar = nil;
  instanceVar = [arr retain];
}

You should be somewhat more clear with your code though, maybe add some logging calls when you "create" or set the array.

Antwan van Houdt