Are Objective-C function names stored in text? - objective-c

I don't remember where I heard about it, (I think I was searching up on how selectors worked and it ended up not being exactly the same as a callback function) and I can't confirm it. But more importantly than that, is there a way I could get a list of the function names from another application?

See class-dump.

You can sometimes see a list of the method names in an application. Find the .ipa file for the app (possibly in the Music->iTunes->Mobile Applications directory on a Mac). Make a copy of one of the ipa files and change it from .ipa to .zip. Unzip the file and in the Payload folder, there's a file with the same name as the app. Right click on it and "Show Package Contents". In there, you'll find another file with the same name as the app (with no extension). This is the executable file for the app. If you open it in a text editor like BBEdit, you'll sometimes be able to see some method names, as well as a list of the frameworks the app is built against. You can find the path name where things were kept too, often with the developer's name.
For example, looking into the Japanese dicitonary Daijirin, I can see these methods:
-[HMWebSupport openMONOKAKIDOSupportWithSafariForView:style:]
-[HistoryViewController viewWillAppear:]
I can also see that one of the developers was called Norihito, and he was using SVN: /Users/norihito/Developer/SVN/Mobile/DAIJIRIN/Other
Other applications (like Weightbot) don't show as much information. I don't know the reason it shows up some times and doesn't other times.

Related

PhpStorm Search Everywhere is not working, do you know the solution?

I don't know this is off topic or not, I'm using general channels. Is there a solution for Search Anywhere in PhpStorm. I work with Laravel but when I use the feature I can't find the file even though it exists.
Looking at your screenshot: based on the fact that ALL files in the project tree have that sort of "dirty yellow" background color... it looks like ALL of your files are considered excluded / outside of the project for some reason.
Most likely a user error of some kind. E.g. you may have opened it from a different path (i.e. when symlink is involved), may have c=misconfigured it later somehow (marked folder as Excluded by mistake or whatnot) or maybe even some sort of config file corruption (pretty unlikely).
Anyway, please do this:
Close your project
Go to the project root folder and delete your .idea subfolder (that's where your project settings are stored).
If you have that project still visible in the IDE (Recent Projects on the Welcome screen) -- you may remove it there as well (to avoid any possible confusion).
Now create a new project in PhpStorm from scratch using existing files: just use "Open" and point to the folder with your project.
Please check filter option. If you are doing file search then click on Files tab.

How to use ctags for code documentation

I have some source code that I want to document without touching the code. For every source file (e.g., example.cpp, example.f90, etc.) I would like to have a separate documentation file (e.g., example.cpp.doc, example.f90.doc) that has some metadata (ctag) linking it to the original source file.
Ideally I could open the source file and the documentation file in parallel views in my favorite editor (ViM) and have the two files synced so that they scroll together. In this manner, I can keep my documentation visually inline with the un-touched source code.
I know this is likely to be a unique scenario. But I'm hoping someone else has already figured this out.
Is this even a possibility?
Create the initial .doc structure outside of Vim such that the "metadata" you want to keep is in the same line number as the original file.
Then open the two files in different Vim windows with vim -O example.cpp example.cpp.doc. At this point use :windo set scrollbind to enable scroll binding, which will allow to navigate any of the windows while keeping both in sync.

Embedding an image as a resource in a FireBreath plugin

While using VS (2010), I used to be able to add an image as a resource simply by going to the Resource view and then: Right click project > Add > Resource > Import.
I even asked a question about how to then load it: Loading an image from a resource embedded in a dll, but that changed for some reason.
Now when I try the same thing and save the .rc file, I get this message:
"The resource script FILE_PATH.rc was not created using Microsoft
Visual Studio. Comments, macros, preprocessor directives, and
conditionally included information may be modified and/or removed from
this file during the build process. Replace existing file?"
Even if I click "yes" (in order to just test things) then I get all kind of error messages at compile time:
ResourceCompile:
gen\firebreathWin.rc(8): error RC2144: PRIMARY
LANGUAGE ID not a number
gen\firebreathWin.rc(16): error RC2135: file not found VS_VERSION_INFO
etc...
I have two questions:
What is the correct way to add an image resource which will be added to the compiled plugin using CMake? I searched about it and couldn't find any helping information.
What can be the cause for this change in behavior? since I was able to use the same exact steps before and it worked.
Thanks.
First of all, I wouldn't do this; instead, I'd just put the file in the same directory as your DLL and use the path of DLL to find it.
That said, the "correct" way to do this would be to see what changes are made to the .rc file when you add it in the IDE, copy the .rc file from gen_templates/ in the root of the firebreath directory into your project, and then make those changes to your copy of the file. Any changes you make to the generated file will be overridden any time cmake is run again, which can happen any time your cmake files (CMakeLists.txt, *.cmake) change.

Is it possible to filter out files from the file dialog in IntelliJ?

My specific use case is with an Android project, but this isn't Android specific. I have an IntelliJ-IDEA project with several Android modules which have been localized. If I want to open the file strings.xml, I will pretty much always want the non-localized one (in res/values rather than res/values-fr or whatever). But when I hit <ctrl><shift><n> and type strings.xml, it shows all the 30-zillion localized files and in fact shows them before the non-localized one. I would like to figure out a way to give IntelliJ a hint as to which one I would want, or a way to filter out files from that dialog. Any ideas?
Seems there is a kind of workaround with directory exclusion
http://devnet.jetbrains.com/thread/283525

How to listen to Screen Captures

Is it possible for me to listen to listen to OSX's built in screencapturing so I can handle the files myself rather than osx doing it?
There are a few options.
Just use Ctrl-Cmd-Shift-3 or 4 instead of Cmd-Shift-3 or 4. This does not save the file to the desktop, instead it saves the data in the clipboard/pasteboard. I don't know where's the official mention of this, but here is one. Then you can get the data through NSPasteboard, see here.
You can use FSEvents to be notified whenever a file is created in a specified folder. Then you can rename the screenshot file soon after it was saved to the desktop by the system. Note that the file name of the screenshot depends on the language environment you choose in System Preferences. So, be very careful if you want to make your program work on a non-English machine.
If you just programmatically take the screenshot, you can use the command line tool screencapture, see the man page.
Of course you can hack into the system and take over the handling of Cmd-Shift-3,4, as Snapz Pro does, for example. You know what you're doing if you choose that way.