I've got an issue in a program that uses multiple windows and multiple XIB files. I'm pretty sure this has something to do with ARC, since I used the same code for similar programs back in the days of Garbage Collection, and it worked.
Basically, I create and initialize an instance of my NSWindowController subclass like so:
And I created a custom initializer in my custom window controller that goes like this:
As I said above, I'm sure this has something to do with ARC since similar code worked perfectly fine before ARC was implemented. It's probably a weak reference somewhere, but I'm just not sure where. I declared my window controller array as __strong, but that didn't change anything. Is there any way in the debugging process to see what references, and how many, an object has? Anyone got any ideas where the weak reference is?
Basically, I create and initialize an instance of my NSWindowController subclass like so:
Code:
CLProjectWindowController *__strong newWindowController = [[CLProjectWindowController alloc] initWithProject:selectedProject inManagedObjectContext:_managedObjectContext];
[windowControllers addObject:newWindowController];
And I created a custom initializer in my custom window controller that goes like this:
Code:
- (id)initWithProject:(CLProject *)aProject inManagedObjectContext:(NSManagedObjectContext *)moc {
if (!(self = [super initWithWindowNibName:@"Project"])) return nil;
[self setProject:aProject];
[self setManagedObjectContext:moc];
[self showWindow:self];
return self;
}
As I said above, I'm sure this has something to do with ARC since similar code worked perfectly fine before ARC was implemented. It's probably a weak reference somewhere, but I'm just not sure where. I declared my window controller array as __strong, but that didn't change anything. Is there any way in the debugging process to see what references, and how many, an object has? Anyone got any ideas where the weak reference is?