July 15, 2018

[Tips] macOS/iOS Programming Tips

Autolayout

NSWindow

The page "How do I get default title bar height of a NSWindow" defines following code to get the height of window title bar.

extension NSWindow {
    var titlebarHeight: CGFloat {
        let contentHeight = contentRect(forFrameRect: frame).height
        return frame.height - contentHeight
    }
}

NSTextField

The NSTextField whose "isEnabled" flag is false will have NO width in the NSStackView. To Expand width of it, you have to give constraint to the NSTextField object in the NSStackView.

Sandbox

Open panel and bookmarking

You have to allow read and write access even if write operation is not required. Because updating preference data require write operation. In this case, check the link target on XIB object:

.

Thread

File

Document

Network

iCloud

Xcode

Command line arguments

If you launch the application from Xcode build phases, following command line options are given: -NSDocumentRevisionsDebugMode, YES.

Compile error

What to do when the following error is occurred:
  • resource fork, Finder information, or similar detritus not allowed: See StackOverflow.
  • this class is not key value coding-compliant for the key: The link between XIB object and source code nay be broken
  • /usr/bin/codesign failed with exit code 1: try to clean up keychain.app

Log output

After updating Xcode to Xcode9 (or after my unintended operation), The Xcode does not display the log of compilation process.To display the log, I changed the Xcode Preference:
Xcode menu -> Preference -> Select "Build/Start" item -> Check the "navigator to current log"
By this setting, the compile log is displayed in the current editor view.

Release

July 6, 2018

May 1, 2018

HyperCard like applications

  • ViperCard: Written by TypeScript and worked on HTML5

March 31, 2018

Tagu-Ru

make database from current files. * automatic tag analysis * tag database * database access. how to show it

January 7, 2018

Command line tools

Tools for JSON format data

This is a list of command line tools to operate JavaScript and JSON.