Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9121351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:50:34+00:00 2026-06-17T05:50:34+00:00

I’ve been looking around and it looks like VDKQueue is a more modern version

  • 0

I’ve been looking around and it looks like VDKQueue is a more modern version of UKKQueue, but I’m having trouble implementing it (I’m not great at Cocoa yet).
I have this so far but I’m at a bit of a loss on what else I need (or if this is even right):

VDKQueue *kqueue = [[VDKQueue alloc] init];
[kqueue addPath:path notifyingAbout:VDKQueueNotifyAboutWrite];
[kqueue setDelegate:self];

This answer seems to nicely outline how to set it up, I just don’t really understand it.
Now that I have VDKQueue initialized, how to I set what happens when the file is modified?

Cocoa Monitor a file for modifications

From the other answer:

Implementation was pretty straightforward:

  • let your controller be the VDKQueueDelegate; (I added <VDKQueueDelegate> to my AppDelegate.h)
  • declare a VDKQueue* ivar / property; (Is this VDKQueue *kqueue = [[VDKQueue alloc] init];?)
  • setup delegate method VDKQueue:receivedNotification:forPath:; (How do I do this?)
  • init the queue and set its delegate to the controller itself; (is this this [kqueue setDelegate:self];?)
  • add resources to watch with addPath:notifyingAbout:. (Added this line [kqueue addPath:path notifyingAbout:VDKQueueNotifyAboutWrite];)

Then just do your business in the delegate method.

Possibly the delegate method from the code?

//
//  Or, instead of subscribing to notifications, you can specify a delegate and implement this method to respond to kQueue events.
//  Note the required statement! For speed, this class does not check to make sure the delegate implements this method. (When I say "required" I mean it!)
//
@class VDKQueue;
@protocol VDKQueueDelegate <NSObject>
@required

-(void) VDKQueue:(VDKQueue *)queue receivedNotification:(NSString*)noteName forPath:(NSString*)fpath;

@end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T05:50:35+00:00Added an answer on June 17, 2026 at 5:50 am

    There are a couple of ways, both of them documented in the VDKQueue header file.

    Method A: Notifications

    Add an observer on the NSWorkspace’s notification center for the various VDKQueue notifications, listed in that header file. The notification center will call your block (or send a message to your own observer object, if you use that older but still perfectly valid method) when the VDKQueue sends a notification you’re observing for.

    Method B: Delegate

    You’re already setting yourself as the delegate, which is one of the steps.

    Step 1 is to declare that you conform to the VDKQueueDelegate protocol. If you’re not already doing this, you should be getting a warning about it, since setDelegate: requires an object that conforms to the protocol.

    Step 2 is to fulfill that promise by actually implementing all of the required methods of the protocol. There’s currently only one.

    Step 3 is to set yourself as the delegate.

    In your implementation of VDKQueue:receivedNotification:forPath:, which is the method you implemented in step 2, you do whatever you want to do to react to what just happened to the file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been looking around but I have not found a problem like this.
So I've been looking around for days now and I can not find any
I've been looking around to see if you can use footer like this: <form>
I've been looking around everywhere and trying everything but i cannot seem te get
I've been looking around for an answer to this, but all of the SAX
I have been looking into Ember.js , and it looks really great, but one
I have been looking around for an answer to my question but couldn't find
I've been looking into Akka lately and it looks like a great framework for
I have been searching around and it looks like this question has been asked
I've been looking around for a similar question, but I couldn't find one. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.