Finder window refresh issue (Yosemite ) - objective-c

I am working on Finder Sync extension to apply badges on files and folders ...
I want to refresh icon for particular file/folder in Finder application.
is there any way to refresh a finder window programmatically on mac OS Yosemite ???
Apart from creating and deleting a file...

I had this problem too. I had a .app i wanted to change the icon of.
Structure of my .app:
...noida.app/
...noida.app/Contents/
...
...noida.app/Contents/Resources
...noida.app/Contents/Resources/myicon.icns
...noida.app/Contents/MacOS
...
...noida.app/Contents/plist.Info
Now I would change the icon in the resources folder. Then I made new files in all folders. It wouldn't work. The only place that i could make a new file tha twould update the icon was in the ...noida.app/ so i made new file at ...noida.app/junk folder and then it updated.
Very interesting.

Related

VB.Net 2010 Resources Not Working After Importing

When I go to set the Image on a regular Button, and get to the Select Resource dialog, I can select an imported resource, but the preview does not show up. This is true for all of the imported resource images, not just one of them. If I try to go on and hit OK, it still says "(None)" in the Image property of the Button.
I've tried deleting the resource files and re-importing, both from the Select Resource dialog, and from Project Settings -> Resources. Under Project Settings -> Resources, the images show up just fine. All of the images are PNG's and were previously working yesterday.
Any suggestions?
I was able to resolve this by doing the following:
Remove all image resources from the program.
Look through all of *.Designer.vb files of for lingering references to the any of the image resources (I found a few).
Close completely out of Visual Studio.
Re-open the project.
Add the image resources back.

How to intercept double click event on a folder on osx?

experts. what I want is like this: I create a folder named RootDir, then I double click the folder in Finder , I hope I can intercept the action and trigger specific action such as mounting this RootDir to another folder named MountDir and then open MountDir, not RootDir.
How should I do it (Using objective-c)?
my platform is mountain lion (osx10.8) and I've tried using fsevent to monitor, but i don't think i can catch the action of folder open/close....
And is it the only way for me to use Finder injection to achieve this function?
any suggestions would be appreciated.
You can associate AppleScript scripts with folders. Take a look at Folder Actions Reference
A Folder Action script is executed when the folder to which it is
attached is opened or closed, moved or resized, or has items added or
removed.

Force item icon refresh in Finder 10.8.2

Can anyone lead me to any useful link for forcing file icon refresh in new 10.8.2 version of Finder?
I'm working on this problem for last few days and I have tried almost any solution which can
be found on internet, but those are all old samples which are compatible with old versions of Finder and do not work on newer versions of Finder (which are rebuilt on Cocoa framework).
I tried to use few commands from apple script tool to update files in Finder ('update item with necessity'), I tried few plugins from internet (nudge, finder-Refresh...), I also tried support for communication with external Mac application through ScriptingBridge framework (although very useful) but nothing gave me a desired result.
I have noticed that NSWorkspace class contains two methods: iconForFile and setIcon:forFile,
and although I could integrate this two functions in application, iconForFile function is returning image of reduced quality, so I'm stuck in that direction also.
Any idea or suggestion will be highly appreciated.
If you need to update one Application icon, just touch the App.app folder.
Close the finder windows and issue the command:
touch /Applications/App.app
Create a visible file and delete it. This will refresh finder window.
To reset for every application under Mountain Lion, try the following in Terminal:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -seed -r
That will kill all existing objects in launch services and reseed them recursively from the standard locations (/Applications, etc).
If you have a specific application whose data you need to override existing information, you can try:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f <path>
Although I've had limited luck with the latter working in some cases, so you may end up doing the former afterwards.
Type into Terminal
killall Finder
Then
killall Dock
I had this problem too. I had a .app i wanted to change the icon of.
Structure of my .app:
...noida.app/
...noida.app/Contents/
...
...noida.app/Contents/Resources
...noida.app/Contents/Resources/myicon.icns
...noida.app/Contents/MacOS
...
...noida.app/Contents/plist.Info
Now I would change the icon in the resources folder. Then I made new files in all folders. It wouldn't work. The only place that i could make a new file tha twould update the icon was in the ...noida.app/ so i made new file at ...noida.app/junk folder and then it updated.
Very interesting.
I was just fighting with this on 10.10 (although it's been a problem for years now) and the only solution I found to force refreshing a bundles icon in the Finder was to:
Open the "Get Info Window" of the bundle you want to update and select the icon by clicking on it.
Paste another image as the icon (you could have copied this from another file or from any other location with this pasteboard data).
Press return and make sure the icon changed in the Finder.
Delete the icon by pressing the delete key.
After that the bundles icon was refreshed to the new .icns file in the bundles resource folder.

How do I implement a static library from libPusher in Objective-C (Xcode 4.2)?

Please show me how I can add and implement the libPusher library to my Objective-C iOS project
This is my first post on StackOverflow
I've just started working in Objective-C iOS app development for a company that I co-founded with a couple of colleagues. Our first app needs to have the libPusher library implemented in its porject. Right now, I'm at a crossroads completing the following task of adding and implementing it on Xcode 4.2:
Simply copy libPusher-combined.a and the contents of the headers directory into your Xcode project..
Source: http://github.com/lukeredpath/libPusher/wiki/Adding-libPusher-to-your-project
What does it mean by "copy"ing those files, and where should it be copied to? Can anybody who has experience with libPusher give me specific details as a list and source code on how to execute this so I can understand it better? I would truly appreciated any help, it will get our company up and running for us getting our app functioning and ready for reviewing submission to Apple Developer staff. The link I've provided will tell you more on what I'm talking about, if I need to specify anything I'll create a new post. Thanks!
What "copy" means in this context is that you want to drag and drop the .a (library) file and the header files (all the .h files) into your new Xcode project (to be precise: the file inspector is the list of files along the left side of the workspace window).
To copy anything to an Xcode project, find it in the finder, highlight all of the files you want to copy over (or just take the folder it comes in), then drag everything over the Xcode icon in the dock.
If Xcode is full screen (lion), the icon will kind of blink, then enter Mission Control mode, you then hold the files over the correct project and drop them into the Xcode file tree.
Make sure that your application is checked as a target for those files!!
If Xcode is not full screen, just drag the files or folder into the Xcode file tree and they will be added.
To link to a static library, just navigate to the name of your project>Info>Framworks. Click the plus, then select your framework if it isn't already there.

is this problem resolved? image view with folder reference

Anybody know a workaround for this problem described under:
"When you add the folder as a reference ("blue folder") it adds that folder to your bundle and not just the files in that folder. This means that when you want to reference a file in that folder, you have to reference it by doing foldername/myfile.png (because you have to dive into that folder, instead of just files in the root of the bundle).
I haven't found a way around this, so if you need to reference a file in a folder like that - be it in IB or a method like imageNamed: you need to do foldername/filename otherwise it won't be found."
It works when I create groups instead of folder references though.
Oh and I was wondering, if I add a folder with pictures in it with "Create groups for any added folders" selected, is all the structure going to be lost and everything will be on the root in my app bundle on the phone? Because if I go with the finder in my dev project, I can see that xcode copied my folder with all the pictures in it. But if it's true and no structure is kept, it means that I can't have two images with the same name in different folders in my dev project, correct? and even if all my images are in a folder "images" in my dev project, I still access them directly (foo.png not images/foo.png) in xcode, right?
EDIT
OK after adding the User paths (thanks to #Matthew Frederick) I can now see the filename of my images in the dropdown of IB and they show up on the interface! Problem is, it does not add the folder in the dropdown (I only see filename.png not images/filename.png), so when I compile, it looks for filename.png instead of "images/filename.png", so it does not work. I have to put images/filename.png manually in the IB dropdown, but then the image does not show in IB...
Interface Builder will only look for potential graphics/media in your target's header search paths, so if you want access to anything that's not loose in your project folder you'll need to add those paths.
Fortunately it's easy.
In the Project Navigator click on your project, and then in the main area click on your target.
Click the Build Settings tab and scroll down to the Search Paths section.
In the User Header Search Paths subsection double-click on the area in the Project column (3rd column over) and a small dialog will appear:
Click the + button, then type the path to your added folders, relative to the project's base folder, then click Done. The paths should be specified in the form of /yourPathName.
Poof, now IB can see the graphics inside the folder, and will present them as "folderName/imageName" in it's various dropdown menus and such.
Note: This is also true for .h and .m files and anything else inside a folder inside your project's folder: adding paths tells the compiler other places to look (hence the folders you see in my screenshot, "Human Data Classes" and "Machine Data Classes," where I keep my Core Data class files as created by mogenerator).