Guest User

Untitled

a guest
Jan 23rd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. @Parcelize
  2. data class MyModel(
  3. var name: String = "",
  4. var is_locked: Boolean = true,
  5. var is_one_size: Boolean = false,
  6. ) : Parcelable
  7.  
  8. private fun initMyModelList(model: MutableList<MyModel>) {
  9. //i want to access is_locked from here with destruction but i cant ? IDE telling me the type is an int but its clearly defined as a Boolean
  10. for((is_locked) in model){
  11. //what i want to do in here is access the is_locked var of the model list and change all of them in a loop. im trying to use Destructuring in loop as a conveience. why is it not working ?
  12. //how can i make the call signature look like this--- > is_locked = true instad of model.is_locked =true
  13. }
  14. }
Add Comment
Please, Sign In to add comment