問題タブ [didset]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ios - オブジェクトを持つ Swift のプロパティ オブザーバー
「リスト」のクラス ChooserListVC にプロパティ オブザーバーを追加しようとしています。
これらは、追跡したい ChooserSaves の変数です。
実装しているクラスでこれを設定する方法がわかりません。
私はこのようなことをしようとしました:
ただし、これは、セグエがリストを割り当てるときに一度だけ機能します。コードの他のビットを変更するたびにlist.chooserItems
、正しい行をトリガーするようにするにはどうすればよいですか?
ios - Objective-Cで「swiftのdidset」を実装するには?
Swift ( http://www.raywenderlich.com/からリリースされた本「iOS Animations by Tutorials:Chapter 12」より):
上記の構文をobjective-cに実装するにはどうすればよいですか? 私は以下のように photoLayer と image のプロパティを設定することだけを知っています:
didset{...}
しかし、objective-c 構文を使用してパーツを実装する方法がわかりません。助けてください!
swift - 文字列変数を設定して常に小文字にするにはどうすればよいですか?
文字列変数を設定し、常に小文字にしたいと考えています。
これは私のコードです:
しかし、私がそれを使用すると、無限ループに陥ります。どうすればこの問題を解決できますか?
ios - Use of didSet property observer in custom UITableCell to update TextView
I have a table that displays a list of pupils and their chosen subjects. The pupil's name are displayed as table section headers and each chosen subject is displayed as table rows for each section. I have a simple class to store the pupil's name as a string and their subjects as an array as follows:
In my custom TableViewCell I have a didSet property observer to track any changes to each pupil's chosen subjects (i.e. I have a textView that the user can click on and modify or change a subject. My didSet is currently as follows:
My cellForRowAtIndexPath in my TableViewController is as follows:
I'm puzzled at how to take the data from the tableView of each pupil and pupil's subjects and use didSet to set the pupil's name and list of subjects so I can monitor the textViews and update changes to the model as required. I much appreciate any assistance.
swift - Swiftプロトコルでの「didSet」、「get」、「set」の使用は何ですか?
Protocol または Delegate の呼び出し中に set メソッドまたは get メソッドを使用する場所
ios - swift ios この例で didSet を使用する理由
この例でなぜ didSet が使用されたのかを理解しようとしています。画像を表示するページコントローラーの一部 (画像スライダー)
コード:
同じコードを試してみましたdidSet
が、速度などの変化に気付かなかったのに、なぜそれが使用されているのですか?
swift - 初期化時にSwiftトリガーdidSet
このコードが初期化時に didSet をトリガーする理由
何か案が?didSetをトリガーすべきではありませんか?誰か助けて!
更新:私の視点はこれで
testSet()
、_value = false
同じことをしていますtestSet()
が、外部init()
にあるため、testSet()
トリガーさdidSet
れ_value = false
ません。どうして?!
「didSet」を引き起こすのは、オプションのタイプやその他の理由ではないと思います。
xcode - いつ/どのように - アウトレット -> didSet
アウトレットの didSet が実際にいつ/どのようにトリガーされるのだろうか?
例えば :