๐Ÿ’ป ๊ฐœ๋ฐœ

    [iOS / Swift] Exception NSException * "-[UIView setText:]: unrecognized selector sent to instance

    Delegate๋กœ ํŠน์ • Cell์„ ํด๋ฆญํ–ˆ์„ ๋•Œ ์ƒ์„ธ ์ •๋ณด ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•˜๋„๋ก ๊ตฌํ˜„ํ–ˆ๋‹ค. extension ViewController : UICollectionViewDelegate { func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { guard let viewController = self.storyboard?.instantiateViewController(identifier: "DiaryDetailViewController") as? DiaryDetailViewController else { return } let diary = self.diaryList[indexPath.row] ..

    [TIL] 22.08.25

    ๊ณต๋ถ€ํ•œ ๊ฒƒ ๋ถ€์ŠคํŠธ์ฝ”์Šค - iOS ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ์œ„ํ•œ ์Šค์œ„ํ”„ํŠธ ๊ธฐ์ดˆ ์•Œ๊ฒŒ๋œ ๊ฒƒ 1. ์˜ต์…”๋„ // someOptionalParm์— nil์ด ํ• ๋‹น๋  ์ˆ˜ ์žˆ์Œ func someFunction(someOptionalParam: Int?) { // .... } /// someOptionalParm์— nil์ด ํ• ๋‹น๋  ์ˆ˜ ์—†์Œ func someFunction(someOptionalParam: Int) { // .... } nil์ด ํ• ๋‹น๋  ์ˆ˜ ์žˆ๋Š”์ง€ ์—†๋Š”์ง€๋ฅผ ํ‘œํ˜„ nil์˜ ๊ฐ€๋Šฅ์„ฑ์„ ๋ช…์‹œ์ (์ฝ”๋“œ)์œผ๋กœ ํ‘œํ˜„ ๊ฐ€๋Šฅ ์˜ต์…”๋„์ด ์•„๋‹Œ ๊ฒฝ์šฐ nil ์ฒดํฌ ์—†์ด ๋ฐ”๋กœ ์‚ฌ์šฉ ๊ฐ€๋Šฅ nil๋กœ ์ธํ•œ ์˜ˆ์™ธ ์ƒํ™ฉ์„ ์ตœ์†Œํ™” 2. ์˜ต์…”๋„ ํ‘œํ˜„ ๋ฐฉ๋ฒ• // ์•”์‹œ์  ์ถ”์ถœ ์˜ต์…”๋„ var optionalValue: Int! = 10 switch optionVa..

    [TIL] 22.08.24

    ๊ณต๋ถ€ํ•œ ๊ฒƒ ๋ถ€์ŠคํŠธ์ฝ”์Šค - iOS ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ์œ„ํ•œ ์Šค์œ„ํ”„ํŠธ ๊ธฐ์ดˆ ์•Œ๊ฒŒ๋œ ๊ฒƒ 1. ๋งค๊ฐœ๋ณ€์ˆ˜ ๊ธฐ๋ณธ ๊ฐ’ func setUserInfo(name : String, age : Int, region : String = "Deajeon") {} ํ•จ์ˆ˜๋ฅผ ์ •์˜ํ•  ๋•Œ ๋งค๊ฐœ๋ณ€์ˆ˜์— ๊ธฐ๋ณธ์ ์œผ๋กœ ์ „๋‹ฌ๋  ๊ฐ’์„ ๋ฏธ๋ฆฌ ์ €์žฅํ•  ์ˆ˜ ์žˆ์Œ ๊ธฐ๋ณธ ๊ฐ’์„ ๊ฐ–๋Š” ๋งค๊ฐœ๋ณ€์ˆ˜๋Š” ๋งค๊ฐœ๋ณ€์ˆ˜ ๋ชฉ๋ก ์ค‘ ๋งจ ๋’ค์— ์œ„์น˜ํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Œ 2. ์ „๋‹ฌ์ธ์ž ๋ ˆ์ด๋ธ” // ๋‚ด๋ถ€์—์„œ๋Š” ๋งค๊ฐœ๋ณ€์ˆ˜ ์ด๋ฆ„ func greeting(to friend : String, from me : String) { print("Hello, \(friend)!, my name is \(me)") } // ํ˜ธ์ถœํ•  ๋•Œ๋Š” ์ „๋‹ฌ์ธ์ž ๋ ˆ์ด๋ธ” greeting(to : "doko", from : "kodo") ..

    [iOS / Swift] unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard

    TableView๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด์„œ Cell์„ ์žฌ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด extension์œผ๋กœ UITableViewDataSource๋ฅผ ์žฌ์ •์˜ํ•˜๊ณ  ๋นŒ๋“œ๋ฅผ ์ง„ํ–‰ํ–ˆ๋‹ค. extension ViewController : UITableViewDataSource { func tableView(_ tableView : UITableView, numberOfRowsInSection section : Int) -> Int { return self.tasks.count } func tableView(_ tableView : UITableView, cellForRowAt indexPath : IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdenti..

    [Android / Gradle] mockup1/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.

    ์ธํ„ด ๊ธฐ๊ฐ„ ๋™์•ˆ ๊ฐœ๋ฐœํ•œ ์•ฑ์„ ๋ฐฐํฌํ•˜๋ ค๊ณ  ์•ฑ ์•„์ด์ฝ˜ ์ด๋ฏธ์ง€๋ฅผ ์ฒจ๋ถ€ํ•˜๊ณ  Gradle์—์„œ debug -> release ๋กœ ๋ณ€๊ฒฝํ•˜๊ณ  Build Apk ๋ฅผ ๋ˆŒ๋ €๋Š”๋ฐ! ์•„๋ž˜์™€ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋–ด๋‹ค. mockup1/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature. ์„œ์นญ์„ ํ•ด๋ณด๋‹ˆ๊นŒ Gradle ๋ฒ„์ ผ์ด ๋งž์ง€ ์•Š๋Š”๋‹ค. ๋‹ค๋ฅธ ๋ฌธ์ œ๋‹ค~ ์ด๋Ÿฐ ๊ธ€๋“ค์ด ๋งŽ์€๋ฐ ๋ญ”๊ฐ€ ์ด์ƒํ–ˆ๋‹ค. ์ง€๊ธˆ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š” ๋ฒ„์ ผ์ด 7์ธ๋ฐ 4๊นŒ์ง€ ๋‚ฎ์ถฐ์•ผํ•œ๋‹ค๊ณ ? ๊ดœํžˆ ๊ฑด๋“œ๋ ธ๋‹ค๊ฐ€ ๋‹ค๋ฅธ ์˜ค๋ฅ˜๋กœ ํ„ฐ๋ฏธ๋„์ด ํ„ฐ์งˆ ๊ฒƒ ๊ฐ™๋‹ค๋Š” ์ƒ๊ฐ์— ์ฒจ๋ถ€ํ•œ ์•ฑ ์•„์ด์ฝ˜ ์ด๋ฏธ์ง€๋ฅผ ์‚ดํŽด๋ดค๋‹ค. ํŒŒ์ผ๋ช…์€ ic..

    [Flutter] ModalBottomSheet๊ฐ€ ํ‚ค๋ณด๋“œ์— ์˜ํ•ด ๊ฐ€๋ ค์ง€๋Š” ํ˜„์ƒ

    ๋ธ”๋กœ๊ทธ ๋‚ด์˜ ๊ฒŒ์‹œ๋ฌผ์€ PC ๋ฒ„์ „์— ์ตœ์ ํ™” ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ค๋Š˜์€ ModalBttomSheet๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด์„œ ๋ฐœ์ƒํ–ˆ๋˜ ๋ฌธ์ œ์— ๋Œ€ํ•ด ์ ์–ด๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ModalBottomSheet์— TextField๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ‚ค๋ณด๋“œ๋กœ ์‚ฌ์šฉ์ž์˜ ์ž…๋ ฅ์„ ๋ฐ›์œผ๋ ค๊ณ  ํ–ˆ์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ModalBottomSheet๊ฐ€ ํŒ์—…๋œ ํ‚ค๋ณด๋“œ์˜ ๋†’์ด๋งŒํผ ์˜ฌ๋ผ๊ฐ€์ง€ ์•Š์•„์„œ ModalBottomSheet๊ฐ€ ํ‚ค๋ณด๋“œ์— ๊ฐ€๋ ค์ง€๋Š” ํ˜„์ƒ์ด ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์€ ์ƒํ™ฉ์ž…๋‹ˆ๋‹ค. ํ‚ค๋ณด๋“œ๊ฐ€ ํŒ์—…๋˜๋ฉด์„œ ModalBottomSheet๋ฅผ ๊ฐ€๋ ค ์‚ฌ์šฉ์ž๊ฐ€ ์ž…๋ ฅํ•œ ํ…์ŠคํŠธ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์—†๋Š” ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ModalBottomSheet๊ฐ€ ํ‚ค๋ณด๋“œ์— ์˜ํ•ด ๊ฐ€๋ ค์ง€๋Š” ํ˜„์ƒ ์šฐ์„  ModalBottomSheet์˜ ์†์„ฑ์— ๋Œ€ํ•ด ๋ถ„์„ํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋˜ ์ค‘ isScrollContro..

    [Android / Gradle] The current Gradle version is not compatible with the Kotlin Gradle plugin

    ์˜ค๋Š˜ ์ˆ˜๋„๊ถŒ์— ๋น„๊ฐ€ ์—„์ฒญ ๋‚ด๋ ค์„œ ์žฌํƒ์„ ํ•˜๊ฒŒ ๋๋‹ค. ์‚ฌ๋‚ด ๊นƒ๊ณผ ์—ฐ๋™์ด ๋˜์–ด ์žˆ์ง€ ์•Š์•„์„œ ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒˆ๋กœ ์ƒ์„ฑํ•ด์„œ ๋นŒ๋“œ๋ฅผ ํ•˜๋Š”๋ฐ ์•„๋ž˜์™€ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค. Gradle ๋ฒ„์ ผ๊ณผ Kotlin Gradle Plugin ๋ฒ„์ ผ์ด ๋งž์ง€ ์•Š์•„ ์ƒ๊ธฐ๋Š” ์˜ค๋ฅ˜์˜€๋‹ค. ์นœ์ ˆํ•˜๊ฒŒ๋„ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์„ ์•Œ๋ ค์ค€๋‹ค. android/gradle/wrapper/gradle-wrapper.properties๋ฅผ ์ˆ˜์ •ํ•˜๋ฉด ๋œ๋‹ค. ์•Œ๋ ค์ค€ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•๋Œ€๋กœ ๋ฒ„์ ผ์„ 6.7.0์—์„œ 6.7.1๋กœ ๋ณ€๊ฒฝํ–ˆ๋Š”๋ฐ ์ •์ƒ์ ์œผ๋กœ ๋นŒ๋“œ๊ฐ€ ๋๋‹ค. Gradle ๋ฒ„์ ผ์€ ์•„๋ž˜ ๋งํฌ์—์„œ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. Gradle Distributions services.gradle.org

    [Flutter / Dart] What is Equatable?

    ๋ธ”๋กœ๊ทธ ๋‚ด์˜ ๊ฒŒ์‹œ๋ฌผ์€ PC ๋ฒ„์ „์— ์ตœ์ ํ™” ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ค๋Š˜์€ Equatable์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. BLoC์— ๋Œ€ํ•œ ๊ธ€์„ ์“ฐ๊ธฐ ์ „์— BLoC์—์„œ ์‚ฌ์šฉํ•˜๋Š” Equatable์— ๋Œ€ํ•œ ์ •๋ฆฌ๊ฐ€ ์šฐ์„ ์ ์ด๋ผ๊ณ  ์ƒ๊ฐํ–ˆ์Šต๋‹ˆ๋‹ค. ๋ฐ”๋กœ ๋ณธ๋ก ์œผ๋กœ ๋“ค์–ด๊ฐ€๋ณด์ฃ ! ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ๋จผ์ € ์‚ดํŽด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. class Person { final int pid; final String name; final int age; Person(this.pid, this.name, this.age); } void main() { Person p1 = new Person(20221234, "kodo", 25); Person p2 = new Person(20221234, "kodo", 25); (p1 == p2) ? print("same") : ..

    [Flutter] BLoC ํŒจํ„ด์œผ๋กœ ์ž๋™ ๋กœ๊ทธ์ธ, Splash Screen ๊ตฌํ˜„ํ•˜๊ธฐ - 1

    ๋ธ”๋กœ๊ทธ ๋‚ด์˜ ๊ฒŒ์‹œ๋ฌผ์€ PC ๋ฒ„์ „์— ์ตœ์ ํ™” ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ค๋Š˜์€ ํ”Œ๋Ÿฌํ„ฐ์—์„œ ์ž๋™ ๋กœ๊ทธ์ธ์™€ Splash Screen์„ ๊ตฌํ˜„ํ•ด๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ์ž๋™ ๋กœ๊ทธ์ธ์€ ์•ฑ ๊ฐœ๋ฐœ์„ ์ ‘ํ•ด๋ดค๋‹ค๋ฉด ํ•œ ๋ฒˆ์ฏค์€ ๊ตฌํ˜„ํ•ด๋ดค์„ ๊ธฐ๋Šฅ์ด๋ผ๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. SharedPreference๋ฅผ ํ™œ์šฉํ•ด์„œ ๊ตฌํ˜„ํ•˜๋Š”๋ฐ ์˜ค๋Š˜์€ ์กฐ๊ธˆ ๋‹ค๋ฅธ ๋ฐฉ์‹์œผ๋กœ ์ ‘๊ทผํ–ˆ์Šต๋‹ˆ๋‹ค. ๋ฐ”๋กœ BLoC๋ฅผ ํ†ตํ•ด์„œ ๊ตฌํ˜„ํ•˜๋Š”๋ฐ์š”, BLoC๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ž๋™ ๋กœ๊ทธ์ธ๊ณผ Splash Screen์„ ํ•˜๋‚˜์˜ ๋กœ์ง์œผ๋กœ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•œ๋ฒˆ ์‹œ์ž‘ํ•ด๋ณด์ฃ . ๋ฐ”๋กœ BLoC๋กœ ๊ตฌํ˜„ํ•˜์ง€ ์•Š๊ณ  ๊ธฐ์กด์˜ ๋ฐฉ์‹์œผ๋กœ ๊ตฌํ˜„ํ•˜๊ณ  BLoC๋กœ ๋ฆฌํŽ™ํ† ๋งํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์ ‘๊ทผํ•ฉ๋‹ˆ๋‹ค. ๊ธฐ์กด ๋ฐฉ์‹์œผ๋กœ ๊ตฌํ˜„ํ•˜๋ฉด์„œ ๋ฐœ์ƒํ•˜๋Š” ๋ฌธ์ œ์™€ ์ด ๋ฌธ์ œ๋ฅผ ์–ด๋–ค ์‹์œผ๋กœ ํ•ด๊ฒฐํ•˜๋Š”์ง€๊ฐ€ ์ค‘์š”ํ•˜๋‹ˆ๊นŒ์š”. ์ž๋™ ๋กœ๊ทธ์ธ ์•ž์„œ ๋ง์”€๋“œ๋ฆฐ ๊ฒƒ์ฒ˜๋Ÿผ SharedPrefer..

    [Flutter / Dart] What is Singleton?

    ๋ธ”๋กœ๊ทธ ๋‚ด์˜ ๊ฒŒ์‹œ๋ฌผ์€ PC ๋ฒ„์ „์— ์ตœ์ ํ™” ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ •๋ง ์˜ค๋žœ๋งŒ์— ๊ธ€ ์“ฐ๋Š” ๊ฑฐ ๊ฐ™๋„ค์š”. ๋ฏธ๊ตญ์—์„œ ๋Œ์•„์™€์„œ ์ผ๊ธฐ ์“ด ๊ฒŒ ๋งˆ์ง€๋ง‰์ธ๋ฐ ์ฃผ๊ธฐ์ ์œผ๋กœ ์“ฐ๋ ค๊ณ  ํ–ˆ์—ˆ๋Š”๋ฐ 1ํ•™๊ธฐ์— ํ”„๋กœ์ ํŠธ๊ฐ€ ๋„ˆ๋ฌด ๋งŽ์•„์„œ ๋ฐ”๋นด์Šต๋‹ˆ๋‹ค. ๊ธ€ ์“ฐ๊ณ  ์žˆ๋Š” ์ง€๊ธˆ์€ ์—”์”จ์†Œํ”„ํŠธ์—์„œ 7์ฃผ์งœ๋ฆฌ ์ฑ„์šฉ์—ฐ๊ณ„ํ˜• ์ธํ„ด์„ ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ธํ„ด์„ ์ง„ํ–‰ํ•˜๋ฉด์„œ ํ”Œ๋Ÿฌํ„ฐ๋กœ ๊ฐœ๋ฐœ์„ ํ•˜๊ณ  ์žˆ๋Š”๋ฐ ๊ฐœ๋ฐœํ•˜๋ฉด์„œ ์•Œ๊ฒŒ๋œ ๊ฒƒ๋“ค, ์ •๋ฆฌํ•˜๋ฉด ์ข‹์€ ๊ฒƒ๋“ค์„ ์ ์–ด๋‘๊ณ  ์‹ถ์–ด์„œ ์˜ค๋Š˜๋ถ€ํ„ฐ ์ฃผ๊ธฐ์ ์œผ๋กœ ํฌ์ŠคํŒ…์„ ํ•ด๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. (1ํ•™๊ธฐ ํšŒ๊ณ ๋ก์„ ์ž‘์„ฑํ•˜๊ณ  ์žˆ๋Š”๋ฐ ์•„์ง ์ž‘์„ฑ์ด ์•ˆ๋ผ์„œ ๋น„๊ณต๊ฐœ๋กœ ํ•ด๋†จ์Šต๋‹ˆ๋‹ค...) ์‹ฑ๊ธ€ํ†ค ์‹ฑ๊ธ€ํ†ค, ์ „๊ณต์ž๋ผ๋ฉด ๋‹ค๋“ค ๋งŽ์ด ๋“ค์–ด๋ดค์„ ๋‹จ์–ด์ผ ๊ฒ๋‹ˆ๋‹ค. ๋ง ๊ทธ๋Œ€๋กœ ์‹ฑ๊ธ€, ํ•˜๋‚˜์˜ ์ธ์Šคํ„ด์Šค๋งŒ ์กด์žฌํ•˜๋„๋ก ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ธ์Šคํ„ด์Šค๋ฅผ ํ•˜๋‚˜๋งŒ ๊ฐ€์ง€๊ธฐ ์œ„ํ•ด์„œ๋Š” ์–ด๋–ป๊ฒŒ ํ•ด์•ผํ• ๊นŒ์š”? ๋จธ๋ฆฌ ์†์— ๋– ..