On Mon, Nov 24, 2008 at 7:39 PM, Cocoa Dummy <[EMAIL PROTECTED]> wrote:
> Any reason why I shouldn't be able to merge the controller and FS classes
> into one?  Essentially, move the delegate functions into the controller

There are a few reasons why I don't think it is a good idea to combine
the two. First of all, when you mount the file system using the
default mountAtPath, the framework will spawn a new thread to process
your file system. In that case, your controller will be running in the
main run loop and also have FS delegate methods being called from
another thread. I think this can lead to some confusion. Another
reason not to mix them is that they do different things. The
controller should be handling the main run loop, while your FS
instance that implements the delegate methods should focus on being a
file system and doesn't need to even know about the controller.

> class.
>  Like:
>
> userFS = [[GMUserFileSystem alloc] initWithDelegate:self isThreadSafe:YES];
>
>
> I had things working and then I did this (where delegate is self) and am now
> getting weird null pointer issues.  The first time the delegates are called,
> it works, but after that references are broken.  Another change is that I am
> not using a NIB file anymore.  I made a class that has mount and unmount
> methods and is called from main.  Everything mounts and the initial files
> show up, but objects that were set, seem to become unset after the first
> round of calls as if the class is getting reinitiated.
> It might be something I did wrong in ObjC, but I am thinking it is not.  I
> have reviewed the code several times.

Without reviewing the code I don't think I can help much here. It
almost sounds like you want a command-line file system and want to
avoid the whole .app stuff altogether? If that is the case, then there
is an example of this using the LoopbackFS. It might be a good idea to
start your file system off this way since it lets you focus only on
the file system part. For the 1.7 tag the file I'm referring to is
here:

http://macfuse.googlecode.com/svn/tags/macfuse-1.7/filesystems-objc/LoopbackFS/loop.m

A comment near the top of the file tells you how to compile from the
shell. This is another reason not to mix your FS and controller
implementation; in this case I can easily create a command line
version that re-uses the same FS implementation as the .app version.

ted

> Thanks.
> Cocoa Dummy
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MacFUSE" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/macfuse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to