Re: Found It - Problem with Outline View and Manual Memory Management

2015-05-29 Thread Dave
> On 28 May 2015, at 17:56, Kyle Sluder wrote: > > On Thu, May 28, 2015, at 08:37 AM, Dave wrote: >> Hi, >> >> This is from Apple Sample Code so I thought something as fundamental as >> this would have been dealt with correctly. This is the copy method inside >> the “ImageAndTextCell” class, >>

Re: Found It - Problem with Outline View and Manual Memory Management

2015-05-28 Thread Kyle Sluder
On Thu, May 28, 2015, at 08:37 AM, Dave wrote: > Hi, > > This is from Apple Sample Code so I thought something as fundamental as > this would have been dealt with correctly. This is the copy method inside > the “ImageAndTextCell” class, > > -(id) copyWithZone:(NSZone*) zone > { > ImageAndTextCell

Re: Found It - Problem with Outline View and Manual Memory Management

2015-05-28 Thread Dave
Hi, This is from Apple Sample Code so I thought something as fundamental as this would have been dealt with correctly. This is the copy method inside the “ImageAndTextCell” class, -(id) copyWithZone:(NSZone*) zone { ImageAndTextCell *cell = (BJImageAndTextCell*) [super copyWithZone:zone]; cell.

Re: Found It - Problem with Outline View and Manual Memory Management

2015-05-27 Thread Graham Cox
> On 28 May 2015, at 12:56 am, Dave wrote: > > myCell = (ImageAndTextCell*) [cell copy]; > //*** It’s a “well known”* fact that a copy of an NSCell or an

Found It - Problem with Outline View and Manual Memory Management

2015-05-27 Thread Dave
Sorry, I meant: In I change this to: myCell = (ImageAndTextCell*) [cell retain]; //*** It doesn’t work? Presumably now I think about it, because the Image

Found It - Problem with Outline View and Manual Memory Management

2015-05-27 Thread Dave
Hi, I’ve Found it, please see line marked below. In I change this to: myCell = (ImageAndTextCell*) [cell copy]; //*** It doesn’t work, which is a bit of

Re: Problem with Outline View and Manual Memory Management

2015-05-27 Thread Dave
HI, A bit more on this, firstly the problem seems to be related to the ImageAndTextCell class and secondly looking at the awakeFromNIB method from SourceView, ImageAndTextCell is allocated, the property is set, but then it does nothing with it. I assume that under ARC ImageAndTextCell will be s

Re: Problem with Outline View and Manual Memory Management

2015-05-27 Thread Dave
Hi, Thanks for this, I actually spotted that late last night and I refactored the code to read as below, but it still crashes if I do not retain the "iconImage": - (void)outlineView:(NSOutlineView *)olv willDisplayCell:(NSCell*)cell forTableColumn:(NSTableColumn *)tableColumn item:(id) item {

Re: Problem with Outline View and Manual Memory Management

2015-05-27 Thread Dave
Hi, Sorry, I wasn’t very clear, the VC is my existing VC with the Source Vice Code from “myViewController” code added so this had to be converted to use manual memory management. I also converted the other supporting classes although as you point out, I could have just set the compiler flag. H

Re: Problem with Outline View and Manual Memory Management

2015-05-26 Thread Jens Alfke
> On May 26, 2015, at 11:34 AM, Dave wrote: > > The SourceView project is built using ARC, but my App uses Manual Memory > Management. When I moved the code over, I changed it to use release etc. and > changed any properties or iVar’s to use retain or assign. Why not leave the source files a

Re: Problem with Outline View and Manual Memory Management

2015-05-26 Thread Ken Thomases
On May 26, 2015, at 1:34 PM, Dave wrote: > When I run the App, it displays the Tree View fine and Populates the two > sections, but it crashes due to an over-release if I select a file based item > - I found this by using NSZombies - it gives the error: > > *** -[NSImage release]: message sent

Problem with Outline View and Manual Memory Management

2015-05-26 Thread Dave
Hi, I’ve incorporated the Tree Controller in SourceView. SourceView shows a Split View with a tree structure on the left and either shows the contents of a URL or a List of Files on the right, depending on which item is selected in the left view. The SourceView project is built using ARC, but