iOS
-
[xcode]this class is not key value coding-compliant for the key 에러 원인/해결iOS/error log 2021. 4. 2. 03:43
this class is not key value coding-compliant for the key 자주 보이는 xcode 에러다. Interface Builder 의 구성 에러 설정한 IBOutlet이 없어졌거나 할경우 발생. Tab Bar Controller에 배치한 nib의 경우 Tab Bar Controller 내의 오브젝트클래스랑 nib의 클래스가 일치하지 않는 경우에도 발생. nib에서 Tab Bar Controller의 각 View Controller을 대상 클래스랑 정확히 연결할것 이다. 보통은 금방 해결되는데 이상한 데서 해결이 안될때가 있다. 나같은 경우에는 커스텀 뷰를 만들어두고 nib으로 레지스터하는 부분에서 에러가 발생했는데 알고보니 IBoutlet연결할때 한 개만 file's ..
-
[swift] 오늘이 포함된 일주일 날짜 불러오기 Date(timeIntervalSinceNow:)iOS 2021. 4. 2. 01:10
프로젝트 하다가 못쓰게 된 코드가 있어서 남겨본다. 오늘이 3월31일 수요일이라면 일주일 시작 날짜(ex.월요일) 부터의 1주일간의 날짜를 불러오는 법이다. let formatter = DateFormatter() formatter.dateFormat = "MMM-dd-e-EEEE"//e는 1~7(sun~sat) let day = formatter.string(from:Date()) let today = day.components(separatedBy: "-") // [0] = MMM, [1] = dd, [2] = e(1), [3] = EEEE(Sunday) guard let interval = Double(today[2]) else{ return } startDay = Date(timeIntervalS..
-
[xcode/swift] Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set? 에러 해결iOS/error log 2021. 3. 7. 17:26
[WindowScene] Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set? 라는 에러가 뜨고 initial controller 설정을 했는데도 안된다면 info.plist 설정을 바꿔주면 된다. info.plist > Application Scene Manifest > Scene Configuration > Application Session Role > Item 0 > Storyboard Name 을 시작하고싶은 스토리보드 이름으로 바꿔주면 됨
-
[xcode] Build input file cannot be found : info.plist 경로 오류 xcode 에러 해결iOS/error log 2021. 3. 6. 23:49
Build input file cannot be found: (경로)/info.plist 이런오류를 접했다. 디렉토리를 찾아보면 실제와 다른 경로가 찍혀있다. 설정에서 info.plist 경로를 실제위치와 같이 바꿔주면 된다. TARGETS >> Build Settings >> info.plist 검색 >> info.plist File 항목을 실제 경로로 바꿔주면 잘 실행된다.
-
[swift] tableView 끝에 도달했을때 감지, 무한 스크롤iOS 2020. 8. 9. 00:06
많은 어플, 모바일웹 등에서 사용하는 기술이다 일정 리스트를 불러와서 쭈르륵 보여주고, 스크롤이 바닥에 닿으면 다음 글들을 보여주는 식! 무한 스크롤 기능을 구현해보려했다. 처음에는 scrollViewDidScroll 메소드를 이용해서 다음과 같이 구현했다 func scrollViewDidScroll(_ scrollView: UIScrollView) { if self.tableView.contentOffset.y > tableView.contentSize.height-tableView.bounds.size.height { page += 1 thisUrl = baseUrl + String(page) loading(url: thisUrl) tableView.reloadData() } } 이렇게 코드를 짰더니..
-
[duplicate symbol for architecture x86_64]error in Xcode 해결iOS/error log 2020. 7. 15. 18:16
duplicate symbol '_main' in: /Users/dohan/Library/Developer/Xcode/DerivedData/codingtest-dkaatpqrrfoxtfdsqgwfktsagrbd/Build/Intermediates.noindex/codingtest.build/Debug/codingtest.build/Objects-normal/x86_64/racelist.o /Users/dohan/Library/Developer/Xcode/DerivedData/codingtest-dkaatpqrrfoxtfdsqgwfktsagrbd/Build/Intermediates.noindex/codingtest.build/Debug/codingtest.build/Objects-normal/x86_64/..