Notice
Recent Posts
Recent Comments
Link
ยซ   2024/05   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Archives
Today
Total
๊ด€๋ฆฌ ๋ฉ”๋‰ด

lgvv98

[RxSwift] Reentrancy anomaly was detected. Error ๋Œ€์‘ ๋ณธ๋ฌธ

iOSํ”„๋กœ์ ํŠธ/๐Ÿชท ๋‘๊ตฟํ•ด์ปคํ†ค(HappyHouse)

[RxSwift] Reentrancy anomaly was detected. Error ๋Œ€์‘

๐Ÿฅ• ์บ๋Ÿฟ๋งจ 2021. 9. 4. 14:59

โœ… ์ด๋ฒˆ ์‹œ๊ฐ„์—๋Š” rxswift๋ฅผ ์‚ฌ์šฉํ•˜๋‹ค๊ฐ€ ๋งŒ๋‚œ ์—๋Ÿฌ์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณผ ์˜ˆ์ •์ด์•ผ

์ด๋Ÿฐ ์—๋Ÿฌ๋ฅผ ๋งŒ๋‚œ ์ƒํ™ฉ์€ rxSwift๋ฅผ ์ ์šฉํ•˜์—ฌ ํ…์ŠคํŠธํ•„๋“œ์˜ ๊ธ€์ž์˜ ์ตœ๋Œ€ ๊ธธ์ด๋ฅผ ์ •ํ•ด์ค„๋•Œ ๋ฐœ์ƒํ–ˆ์–ด. 

 

 

โœ… ์•ž์˜ ํฌ์ŠคํŒ…์„ ์ฐธ๊ณ ํ•˜๋ฉด ์กฐ๊ธˆ ๋” ์ข‹์•„! 

2021.09.04 - [๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ] - [RxSwift] Textfield maxLength

 

[RxSwift] Textfield maxLength

โœ… ์ด๋ฒˆ ์‹œ๊ฐ„์—๋Š” rx๋ฅผ ์ด์šฉํ•˜์—ฌ ํ…์ŠคํŠธ ํ•„๋“œ์˜ ์ตœ๋Œ€ ๊ธ€์ž ๊ธธ์ด๋ฅผ ์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณผ ์˜ˆ์ •์ด์•ผ. ์ €๊ธฐ ๋ณด๋ฉด ๋…„,์›”,์ผ์˜ ๊ฒฝ์šฐ์—๋Š” ๊ธ€์ž ๊ธธ์ด๋ฅผ ์ œํ•œํ•  ํ•„์š”๊ฐ€ ์žˆ์–ด. ์˜ˆ๋ฅผ ๋“ค๋ฉด, ๋…„๋„์˜ ๊ฒฝ

rldd.tistory.com

 

โœ… ๋ฐœ์ƒํ•œ ์—๋Ÿฌ์˜ Text

โš ๏ธ Reentrancy anomaly was detected.

  > Debugging: To debug this issue you can set a breakpoint in /Users/hamlitjason/HappyHouse/HappyHouse/Pods/RxSwift/RxSwift/Rx.swift:96 and observe the call stack.

  > Problem: This behavior is breaking the observable sequence grammar. `next (error | completed)?`

    This behavior breaks the grammar because there is overlapping between sequence events.

    Observable sequence is trying to send an event before sending of previous event has finished.

  > Interpretation: This could mean that there is some kind of unexpected cyclic dependency in your code,

    or that the system is not behaving in the expected way.

  > Remedy: If this is the expected behavior this message can be suppressed by adding `.observe(on:MainScheduler.asyncInstance)`

    or by enqueuing sequence events in some other way.

 

โœ… ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•œ ์ƒํ™ฉ์—์„œ ๋‚ด๊ฐ€ ์ž‘์„ฑํ•œ ์ฝ”๋“œ

๋‚ด๊ฐ€์ž‘์„ฑํ•œ ์ฝ”๋“œ1

๐ŸŸ  ์šฐ์„  ๋‚˜๋Š” ํ…์ŠคํŠธํ•„๋“œ์˜ ๊ธธ์ด๋ฅผ ์ œํ•œํ•˜๊ธฐ ์œ„ํ•ด์„œ ์œ„์™€ ๊ฐ™์ด ์ž‘์„ฑ์„ ํ–ˆ์–ด.

๊ทธ๋Ÿฌ์ž...! ์—๋Ÿฌ๋ฅผ ๋”ฑ ๋งŒ๋‚˜๊ฒŒ ๋˜์—ˆ๋Š”๋ฐ, ๊ทธ๋•Œ ๋‚ด๊ฐ€ํ•œ ์ƒ๊ฐ(๊ตฌ๊ธ€๋ง ํ•˜๊ธฐ ์ „)์œผ๋กœ๋Š” ์•„ ์Šค๋ ˆ๋“œ๋ฅผ ๋ถ„๋ฐฐํ•˜๋Š” ๊ณผ์ •์—์„œ ์–ด๋–ค ๋ฌธ์ œ๊ฐ€ ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ์–ด.

๊ทธ๋Ÿฌ๋‹ˆ๊นŒ TextField๋Š” UI๊ด€๋ จํ•œ ๊ฒƒ์ด๋‹ˆ๊นŒ ๋ฉ”์ธ ์Šค๋ ˆ๋“œ๋กœ ์˜ฌ๋ ค์•ผํ•˜๋‚˜? ์ด๋Ÿฐ ์ƒ๊ฐ์„ ํ™•ํ•˜๊ฒŒ ๋˜์—ˆ์ง€.

๊ทธ๋ž˜์„œ, ์–ด๋–ค ์ƒํ™ฉ์—์„œ ์—๋Ÿฌ๊ฐ€ ๋œจ๋Š”์ง€ ํ™•์ธํ•ด ๋ณด๋ ค๊ณ  subscribe๋กœ ๋ฐ”๊ฟ”๋ณด๊ณ , observe๋ฅผ ํ†ตํ•ด ๋ฉ”์ธ ์Šค์ผ€์ค„๋Ÿฌ๋ฅผ ์ง์ ‘ ์ž‘์„ฑํ•ด ๋ณด์•˜์–ด. 

๊ทธ๋Ÿฐ๋ฐ๋„ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋œจ๋Š” ๊ฒƒ์„ ํ™•์ธํ–ˆ๊ณ , onError๋‚˜ onCompleted, onDisposed๊ฐ€ ์ „๋ถ€ ์‹คํ–‰๋˜์ง€ ์•Š์•˜์–ด.

 

๋‚ด๊ฐ€ ์ž‘์„ฑํ•œ ์ฝ”๋“œ2

 

์ด์ฏค ๋˜๋‹ˆ๊นŒ ๊ตฌ๊ธ€๋ง์„ ํ•ด์•ผ๊ฒ ๋‹ค๊ณ  ๋Š๋‚Œ. 

๊ตฌ๊ธ€๋ง์„ ํ•ด๋ณด๋‹ˆ๊นŒ ๋Œ€์ถฉ ์žฌ์ง„์ž…ํ•˜๋Š” ๊ฒƒ์— ๋Œ€ํ•œ ๋ฌธ์ œ์ž„์„ ๋Š๊ผˆ์–ด.

๊ทธ๋ฆฌ๊ณ  ๋” ๋‹นํ™ฉ์Šค๋Ÿฌ์› ๋˜ ์ ์€, ์—๋Ÿฌ์ฝ”๋“œ๋ฅผ ์ž์„ธํžˆ ๋ณด๋ฉด ์–ด๋–ค ์ฝ”๋“œ๋ฅผ ์ถ”๊ฐ€ํ•˜๋ผ๊ณ  ์ ํ˜€์žˆ๋”๋ผ.........

๊ทธ๋ž˜์„œ ๊ฒฐ๊ตญ์€ ํ•ด๊ฒฐ!

 

์ตœ์ข… ๊ฒฐ๊ณผ

 

 

โœ… ์—๋Ÿฌ ์ฝ”๋“œ์— ๋Œ€ํ•œ ์ด๋ฏธ์ง€

Comments