discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSViewController; loading views from nibs


From: Ivan Vučica
Subject: Re: NSViewController; loading views from nibs
Date: Tue, 19 Apr 2011 12:21:31 +0200



On Tue, Apr 19, 2011 at 00:06, Fred Kiefer <fredkiefer@gmx.de> wrote:

Sorry, only today did I find this mail plus a lot more from you in my spam folder. Don't know why GMX put them there, but it hopefully explains why I didn't reply before.

You are definitely correct about the loadView method. It should be exported in the header file, probably that's why I added it there three months ago :-)

Dunno, I thought I updated GNUstep prior to writing the patch.
 
Looks like your header files don't match the implementation files as the later one seems up to date.

As for the NIB loading code, the method used in the current GNUstep code and the one that you suggest should be almost identical in the result. (Ignoring that your code will only load NIBs from the main bundle, that would be easily fixed)
If the current method results in a segmentation fault then we have a real problem here and just not just ignore it by using a different interface.

I pulled the update just now, and NSViewController.m was updated; these lines were added:

  RETAIN(_topLevelObjects);
  RELEASE(nib);

This does seem like it might fix the problem, I'll try this later on.
 
Is the ZCode application freely available and how would I reproduce the problem with that code?

Of course! It's open for the last few months :D

http://bitbucket.org/ivucica/zcode/

You can reproduce by opening an .xcodeproj file, and clicking on a single file in the groups&files outline view on the left. This  unloads the existing NSViewController subclass instance and loads another one.
 
Most likely the problem has to do with topLevelObjects, but I cannot see the bug at the moment. Maybe it is that I wrote most of the code myself that keeps me from spotting the obvious. Anybody with a bit more insight out there?
Ah, I think finally I see it, topLevelObjects gets set to an autoreleased array and later the NSViewController releases it in its dealloc method. We should have retained it after the NIB loading!
I will try to correct this.

....Uhm, so, yes, that must be the update I pulled :-)

--
Ivan Vučica
ivan@vucica.net
Coming soon for iPhone, Zombie Ball - http://j.mp/zbivmail



reply via email to

[Prev in Thread] Current Thread [Next in Thread]