Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- error
- SwiftStyle
- apns
- http
- self
- struct
- Git
- 회고
- PushNotification
- Refresh
- SWIFT
- array
- SWIFTUI
- segue
- ScrollView
- escaping
- Switch
- uikit
- list
- protocol
- 화면전환
- viewlifecycle
- calendar
- 구조적특징
- 고차함수
- 글또
- class
- 점진적로딩
- IOS
- NotificationCenter
Archives
- Today
- Total
목록indexoutofrange (1)
seong_hye, the developer

❗️ "Index out of range" error 해결 ❗️Swift에서 가장 자주 마주하게 되는 오류라고 할 수 있음 Index out of range = 배열이나 컬렉션의 범위를 벗어난 인덱스에 접근할 때 발생하는 에러 🔹 자주 발생하는 원인- 인덱스를 하드코딩 했는데 값이 없을 경우let arrays = [1, 2, 3, 4, 5]for i in 0...5 { // error ~> 갯수는 5개지만 인덱스는 0~4까지임} - 빈 배열에서 접근 시도var arrays = []print(arrays[0]) // error ~> 아직 값이 들어오지 않았음 - 비동기 작업에서 배열 변경 후 접근var arrays = []arrays.getArray()...if ( ... ) { arrays.remove..
IOS/Error
2022. 10. 28.