본문 바로가기

iOS

(28)
Delegate 패턴 구현중에 delgate = nil 오류 나타난 오류 및 막힌점 RandomStudy 프로젝트 제작 중, 할 일을 추가하는 popUpView로 present 후, 데이터 추가한 뒤 dismiss로 돌아왔을때, 데이터를 전달하는 과정에서 어떻게 구성해야 할지 막히게 되었다. 델리게이트 패턴을 사용했지만 delegate = nil로 위임자를 못찾는 오류 두번째 접근방법: Delegate 두번째 방법은 delegate 방법이다. PopUpVC에서 프로토콜을 선언해 데이터를 추가한다면, 프로토콜안 메서드를 데이터 받는 VC에서 메서드를 구현해 데이터를 최신화 해보려고 한다. // AddPopUpViewController.swift protocol AddPopUpViewControllerDelegate: AnyObject { func sendedData..
아이폰에 넣은 앱이 SQLite의 DB를 불러오지 못한 에러 최근에 앱을 만들때, 로컬저장소 UserDefaults를 이용하다가 SQLite로 변경한 적이 있었다. 오토레이아웃을 확인하고, 앱 사용자의 느낌을 받기위해 핸드폰에 직접 넣고 돌려봤는데 DB생성오류가 계속 뜨는것이었다. 열심히 구글링 해본 결과 아래 사이트에서 도움을 받았다. https://stackoverflow.com/questions/67097212/sqlite-db-create-error-in-real-ios-device SQLite db create error in real iOS device I'm trying to learning swiftUi and I've included SQLIte in my project. I've successfully created db, tables and f..
SQLite3에 대하여 Swift 앱 제작중에 있어서 서버로 보내기엔 너무 간단하지만, 앱이 종료되도 저장이 가능한 저장소를 이용했었다. 주로 UserDefaults를 이용했었다. UserDefaults: https://developer.apple.com/documentation/foundation/userdefaults UserDefaults | Apple Developer Documentation An interface to the user’s defaults database, where you store key-value pairs persistently across launches of your app. developer.apple.com 이는 Key-Value 값이 한쌍으로 저장되는 기본 데이터베이스인데, 해당하는 키를 부르면 ..
iOS 레이아웃 이해하기 ※본 글은 아래 링크의 문서를 번역한것입니다 (구글 번역으로 보면 명시된 객체 이름들이 뒤죽박죽되서 보기편하게 하기위해서 적습니다.) https://tech.gc.com/demystifying-ios-layout/ Demystifying iOS Layout Some of the most difficult issues to avoid or debug when you first start building iOS applications are those dealing with view layout and content. Often, these issues happen because of misconceptions about when view updates actually occur. Understanding ..