본문 바로가기

🍎 iOS/문제해결10

Build fails with "Command PrecompileSwiftBridgingHeader failed with a nonzero exit code" 해결 Xcode에서 무언가 잘못 눌러서 생긴 오류로 꽤나 시간을 잡아먹었다. 왜 이런 오류가 나오게 되었는지는 잘 모르겠으나 프로젝트의 Targets - Build Settings로 들어가서, Swift Compiler-General - Objective-C Bridging Header에 무언가 추가되어 있음을 확인할 수 있다. 나는 해결 후 임의로 Test/Test-Bridging-Header.h라고 적어놨지만, 아마 프로젝트 파일 경로를 따라 생성되어있을 것이다. 이렇게 지워주고 Run또는 Build해보면 정상적으로 Xcode가 동작하는 것을 확인할 수 있다. 2022. 6. 22.
SwiftUI: Circular dependency between modules..(해결) 처음 생성한 프로젝트명과 import된 라이브러리명 간의 충돌. 흔히 공부하려는 내용을 프로젝트명으로 설정하다가 생기는 오류. 따라서, 새 프로젝트를 (다른 이름으로) 생성하여 기존의 코드를 그대로 옮기면 해결이 되는 간단한 문제. **참고자료** https://stackoverflow.com/questions/52545418/circular-dependency-between-modules-realm-and-realmswift-error-in-swift Circular dependency between modules 'Realm' and 'RealmSwift' error in Swift I installed RealmSwift via Cocoapod. Even though I did not add Rea.. 2022. 6. 7.
SwiftUI: Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value(해결) Optional관련 에러 중 nil값이 나타났을 때의 오류이다. 내 코드에 이 오류 자체가 왜 나타났을까?를 고민했었다. 알고 보니 당연한 내용인데, 모를 때는 참 답답해.. Image(uiImage: UIImage(data: info.photoImage ?? self.image)!)에서 1. info.photoImage?? self.image는 옵셔널 info.photoImage가 nil이라면 기본값으로 self.image를 호출하겠다는 의미이다. 2. UIImage(data: ...)!는 이미지 데이터를 관리하는 객체인 UIImage에 이미지 데이터 (data:...)를 넣을 것이고, nil값이 없도록 강제하는 !를 사용한 것. 3. 그럼 nil값이며 기본값 self.image를 호출하는데, nil값.. 2022. 6. 1.
SwiftUI: RecordList생성되지 않는 오류 해결방법 ◉ Problem 1. Recording(녹음기능)을 구현하려고 했으나, RecordingList가 Recording 후 List에 파일이 올라오지 않는 문제가 발생. 2. Recording파일을 삭제하면, Recording했던 파일이 다시 나타난다. ◉ 문제가 발견된 Code import SwiftUI struct ContentView: View { @ObservedObject var audioRecorder: AudioRecorder var body: some View { VStack{ RecordingList(audioRecorder: AudioRecorder()) Recordingbtn(audioRecorder: AudioRecorder()) } } } - 이 코드에 포함되어 있는 AudioRec.. 2022. 5. 9.