Wszystko Wszystkie Archiwum quwer quwer 05.02.2019, 23:22:40 1 + pętla forEach iteruje sie po obiekcie(balances), ten obiekt posiada pole, które jest listą(balance), a to pole jest longiem. wyglada to tak println( it.balances.forEach { it.balance!! } )iPokaż całość Bruno_ Bruno_ 06.02.2019, 06:40:04 via Wykop Mobilny (Android) 2 + println( it.balances.forEach { it.balance!! as Balance } )Albo co jest lepszym rozwiązaniem it.balances.forEach { println(it) } another_throwaway23 another_throwaway23 06.02.2019, 08:12:22 via Wykop Mobilny (Android) 2 + @Bruno_: @quwer: albo it.balances.forEach { balances ->balances.balance?.let { println(it) }}w ten sposób ustrzegasz się przed NPE
quwer quwer 05.02.2019, 23:22:40 1 + pętla forEach iteruje sie po obiekcie(balances), ten obiekt posiada pole, które jest listą(balance), a to pole jest longiem. wyglada to tak println( it.balances.forEach { it.balance!! } )iPokaż całość
Bruno_ Bruno_ 06.02.2019, 06:40:04 via Wykop Mobilny (Android) 2 + println( it.balances.forEach { it.balance!! as Balance } )Albo co jest lepszym rozwiązaniem it.balances.forEach { println(it) }
another_throwaway23 another_throwaway23 06.02.2019, 08:12:22 via Wykop Mobilny (Android) 2 + @Bruno_: @quwer: albo it.balances.forEach { balances ->balances.balance?.let { println(it) }}w ten sposób ustrzegasz się przed NPE
wyglada to tak
println( it.balances.forEach { it.balance!! } )
i
Albo co jest lepszym rozwiązaniem
it.balances.forEach { println(it) }
albo
it.balances.forEach { balances ->balances.balance?.let { println(it) }
}
w ten sposób ustrzegasz się przed NPE