Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ユーザー辞書を保存後に読み込み直していたバグを修正 #86

Merged
merged 3 commits into from
Jan 8, 2024

Conversation

mtgto
Copy link
Owner

@mtgto mtgto commented Jan 8, 2024

#27 でNSFilePresenterを使ったファイル監視を導入しましたが、読み込み時に使用している coordinate(readingItemAt:options:error:byAccessor:) の使い方に誤りがあり、ユーザー辞書を保存したあとに必ず読み直すようになってしまっていました。

readerの説明に「ブロックに渡されるURLを使うこと」とあるのを読み飛ばしていました。

A Block object containing the file operations you want to perform in a coordinated manner. This block receives an NSURL object containing the URL of the item and returns no value. Always use the URL passed into the block instead of the value in the url parameter.
https://developer.apple.com/documentation/foundation/nsfilecoordinator/1407416-coordinate

このバグを修正します。

@mtgto mtgto merged commit 734c20a into main Jan 8, 2024
2 checks passed
@mtgto mtgto deleted the coordinate-read-bug branch January 8, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant