Xcode Documentation Generator - xcode

I've looked at Headerdoc and Doxygen for documenting source code, but they both seem to need the developer to do most of the leg-work first. In Visual Studio, typing \\\ generates the skeleton for documentation including the parameters expected by a method. There's also Ghostdoc which guesses what the method does based on its name and parameters. Is there anything similar for Xcode?

There is also Appledoc, which creates a variety of documentation from comments in your source, docsets, html that looks just like the Apple docs.

You can use VVDocumenter plugin, it's a very handy plugin for XCode documentation.
After that you can find the method (or any code) you want to document to, and type in ///, the document will be generated for you and all params and return will be extracted into a Javadoc style, which is compatible with Appledoc, Doxygen and HeaderDoc. You can just fill the inline placeholder tokens to finish your document.

Download the XCode package manager: Alcatraz which can be done easily with the following command:
curl -fsSL https://raw.github.com/supermarin/Alcatraz/master/Scripts/install.sh | sh
Restart XCode and you will find a new option in the Window toolbar menu labed 'Package Manager'. You can then install VVDocumenter from there.
Once you install VVDocumenter you'll need to restart XCode again, but after you reload Xcode you can then type /// to get help writing comments which will later be used to write your documentation.

Related

How to package an unsigned Firefox WebExtension?

I'm trying to develop an extension to run on the FirefoxDeveloperEdition (which doesn't require signing) on mac.
I followed the "Your first WebExtension" guide and everything works fine when using the "Load temporary add-on". But when I try to package it and install it using the "install add-on from file", it shows "this add-on could not be installed because it appears to be corrupt".
I zip all the files (borderify.js, manifest.json, icons, without the container folder) and change the suffix to .xpi. Is this the correct way of packaging? some answers mention that there should be a "install.rdf" ?, if so, how can I create that file? it seems there is no guide on the docs.
UPDATE:
I've tried using the mac builtin "compress n items", xpi file, also tried using web-ext build, xpi file. they all end up with the same error alert.
UPDATE 2:
I've set xpinstall.signatures.required false in about:config.
My firefox version is: 51.0a2 (2016-10-17) (64-bit)
Is there anyone able to load the unsigned xpi? Is it a Firefox bug? or is it just me?
If you want to install .xpi, you need to provide an id.
Add this to your manifest.json root
"applications": {
"gecko": {
"id": "borderify#mozilla.org",
}
}
It's not particularly well documented, specifically this page tells that "add-on will be assigned a randomly-generated temporary ID when you install it in Firefox.". However, that only seems to work for installing over about:debugging - xpi installation still requires an ID. It might be any string, since you've running it on DevEdition with disabled checks anyway.
Goes without saying, that would not work on release Firefox.
P.S: Ctrl-Shift-J will open a browser console that will usually contain additional information about the extension installation error - might be useful next time.

Xcode 8 auto-generated quick help documentation

Among the new features announced in Xcode 8, we can see
"Auto-generate Quick Help documentation" :
Is this the end of manual code documentation like we can learn on this article from NSHipster ?
Can someone outline the pros and cons of this new feature ? Does it replace tools like Jazzy ?
I couldn't find more information about the new feature.
This refers to Xcode 8 (and later) feature, where you can select a method like this:
func foo(bar: Int) -> String { ... }
... and then press ⌘+option+/ (or choose “Structure” » “Add documentation” from Xcode's “Editor” menu) and it will generate the following comments template for you:
/// <#Description#>
///
/// - parameter bar: <#bar description#>
///
/// - returns: <#return value description#>
It just facilitates the writing of documentation for Quick Help.
Note, while this behavior has changed a bit over time, Xcode can be particular about where the cursor must be when you attempt to do this. For example, the cursor has to be somewhere in the function name, foo in my above example, for this to work. Or just double click on the function name and then press ⌘+option+/
You asked whether this feature replaces tools like Jazzy.
No, it doesn’t replace Jazzy or similar tools. Amongst other things, Jazzy creates stand-alone HTML documentation from this inline documentation. So, it is simply a question of whether you need these stand-alone outputs from Jazzy for any reason. If so, use Jazzy (or similar tool) in conjunction with this integrated documentation. If not (i.e., you are only looking for documentation from within the Xcode IDE), then Jazzy is not needed.
This is most likely related to the fact that ALL hotkeys with a '/' don't work in the current XCode 8 build, if your keyboard requires to press shift to get it.
I.e. on the german keyboard the '/' is shift+7, pressing alt+cmd+shift-7 doesn't do a thing. If you assign i.e. cmd+shift+opt+d, it works just fine.
The shortcut '///', which unfortunately also doesn't work right now, is probably due to the old XCode plugin VVDocumenter, which used exactly this shortcut.
Great feature, lousy QA on the Apple side.

Highlight debug functions

I use PhpStorm for a while now, and it's code inspection and syntax highlighting is great! To further extend this feature, I am looking for a way to alert myself of 'debug functions'. I frequently use functions like var_dump(), exit() or echo '<pre>',print($var),'</pre>'. Unfortunately, I also frequently forget these when deploying some code.
Is it possible to add custom highlighting in PhpStorm for some defined functions with the Inspection-feature, so I am visually notified that some debugging-code is still present? Or a plugin or other feature to accomplish something like that?
Install and use Php Inspections (EA Extended) plugin
Once installed -- Settings/Preferences | Editor | Inspections
One of the inspections this plugin provides called Forgotten debug statements -- find it there (hint: there is a search field -- use it)
This inspection will highlight some standard debug related functions + you can add your own function names.
P.S.
This inspection works with PHP functions only -- it will not find constructions like echo '<pre>',print($var),'</pre>'.
BTW -- why don't you try Xdebug/Zend Debugger for a proper debug experience?

XCode lldb autocomplete

I have searched everywhere but can't seem to get answer. I am using Xcode 6.1.1.
I recall (possibly incorrectly) autocomplete being available in the lldb debug pane of XCode. I am currently typing fully all variables and functions; there must be a better way. Is autocomplete/intellisense available in Xcode?
Many Thanks.
The autocomplete available today in Xcode debugger console is for lldb commands. You can type fr<TAB> v<TAB> instead of frame variable. The autocomplete in lldb often can complete function names, for instance br s -n MyClass::MyMeth<TAB>. Or for a source file, br s -f myfil<TAB> -l 15. But once you're entering an expression (expr, or p, or po), the code completion you're used to seeing in the text editor panes is not available.

Using OSX Security-Scoped Bookmarks in a Firemonkey app

I have been developing an OSX app with Delphi XE3 and running into various problems. The latest one is with the sanboxed version built for the Apple Appstore.
The user has to select an arbitrary folder and the app needs to get access to it. Since there is a problem with the OpenDialog, I had to turn to drag-drop functionality instead.
The user drags a folder to the app, the sandbox gives the app temporary access to it and all works properly.
To preserve the access to this folder when the app is restarted I have to use the so-called "security-scoped bookmarks"
I am having two issues with them:
1) How to add the "com.apple.security.files.bookmarks.app-scope" entitlement to an XE3 firemonkey app? It is not available in the Project Options->Entitlements. If I add it manually in the ".entitlements" file it gets overwritten when the app is built.
So is there a way to add a custom entitlement that is not in the list in the project options?
2) To create the bookmark I should use the NSURL.bookmarkDataWithOptions method. I think it should be used like this, but I am not sure of the exact syntax:
var
URL: NSURL;
Err: NSError;
Data: NSData;
...
URL := TNSURL.Create;
Data := URL.bookmarkDataWithOptions(NSURLBookmarkCreationWithSecurityScope, nil, #Err);
...
Maybe there should be a call to Wrap(...) instead of Create.
I have not yet experimented with it, because it is pointless without the answer to issue 1).
It seems no one has written anything about these problems for Delphi, but I hope someone here has experience with that.
Thanks in advance.
Edit:
For problem 1) I tried to add edit manually the ".entitlements" file in the OSX32 folder and set it to read-only to prevent it from being overwritten. It was too easy to be true of course, because the linker complained that the file can not be modified...
OK, I finally found the way to manually add entitlements that are not available in the Project Options > Entitlements.
Instead of selecting the "App Store" build in the Project Manager you have to select a Normal release build and deploy the application as usual.
The application gets deployed in the PAServer scratch-dir as APP package. Inside this package there is an "Entitlements.plist" file, which is in XML format and can be edited with a text editor. It is quite obvious how to add new entitlements once you open the file.
After it is edited, the app has to be code-signed manually and a package has to be prepared. It is slightly more complicated than using the Delphi IDE, but there are instructions about it on the Embarcadero and Apple websites and it actually went without problems.
Still haven't tried the bookmarkDataWithOptions functions.
An alternative could be to deactivate the checkbox for the entitlements-file in the deployment page.
But attention: Evry time you change between Build/Release or App Store/Normal, delphi activates the checkbox. That means you have to deactivate it again in the deplayment-page, to avoid the transfer of this file to the mac PC.
By the way: Do you have tryed meanwhile the StartAccessingSecurityScopedResource function?
In the MacApi.Foundation unit the function is not declared in the NSURL interface.
Do you have found a way to use this function?

Resources