error: cocoapods `force_encoding': can't modify frozen String (FrozenError)

 

sudo gem update xcodeproj

 

'기타' 카테고리의 다른 글

[Realm] 하위 class 추가  (0) 2023.05.24
[Git] gitignore  (0) 2023.03.26
[Xcode] Test Coverag  (0) 2023.02.21
[Xcode] Key Bindings  (0) 2023.02.14
[Xcode] 시뮬레이터 재설정  (0) 2023.02.13

class 내에 하위 class 선언 불가

같은 레벨로 선언해야함

 

오류 메시지: Thread 1: "RLMObject subclasses cannot be nested within other declarations. Please move _TtCC5_4Person14Dog to global scope."

class Dog: Object {
    @objc dynamic var name = ""
    @objc dynamic var owner: Person? // Properties can be optional
}

class Person: Object {
    @objc dynamic var name = ""
    @objc dynamic var birthdate = Date(timeIntervalSince1970: 1)
    let dogs = List<Dog>()
}

 

 

 

 

추가한 object 타입의 class는 모두 configuration에 추가해야함

 

오류 메시지: Invalid class subset list:\n- 'Dog' links to class '_TtCC5_4Person14Dog', which is missing from the list of classes managed by the Realm

let config = Realm.Configuration(objectTypes: [Dog.self, Person.self])
let realm = try! Realm(configuration: config)

'기타' 카테고리의 다른 글

[cocoapods] pod init 안될 때  (1) 2023.07.26
[Git] gitignore  (0) 2023.03.26
[Xcode] Test Coverag  (0) 2023.02.21
[Xcode] Key Bindings  (0) 2023.02.14
[Xcode] 시뮬레이터 재설정  (0) 2023.02.13

1. plist

Information Property List > App Transport Security Settings > Allow Arbitrary Loads = YES

 

설 정 안했을 때 오류: Code=-1001 "The request timed out."

 

 

 

 

2. URL

IP주소를 URL로 사용

localhost X

127.0.0.1 X

var components = URLComponents(string: "http://_I_._P_._주_._소_:_포트_")

 

URL 잘못 작성했을 때 오류: Code=-1004 "Could not connect to the server."

 

 

* IP 확인 방법

설정 > 네트워크 > IP 주소

 

 

 

[Behavioral Patterns] - Observer

이 글은 refactoring guru의 - Observer 부분을 읽고 번역 및 정리한 글입니다.

velog.io

위 블로그를 보고 따라함

 

 

 

 

 

 

공부하면서..

 

Subject 클래스를 작성할 때,

Observer protocol 타입의 배열을 선언하고

메소드의 매개변수로 Observer protocol 타입을 받음

이후 배열에 매개변수로 받아온  Observer가 있는지 contains 하니 아래와같은 오류 남

error: Cannot convert value of type 'any Observer' to expected argument type '(any Observer) throws -> Bool'

 

냅다 equal 갈겨보니 오류남. protocol type은 비교할수 없나봄?

error: Type 'any Observer' cannot conform to 'Equatable'

 

그래서 그냥 id 변수를 만들고 Observer protocol 상속하는 클래스 이름을 넣어서 id값만 비교했다

 

 

 

 

그리고 블로거가 공부하는 사이트 들어가보니 스위프트 언어도 지원중... 예.. 나도 이용해야지.,,

 

 

Observer in Swift / Design Patterns

Usage examples: The Observer pattern is pretty common in Swift code, especially in the GUI components. It provides a way to react to events happening in other objects without coupling to their classes. Identification: The pattern can be recognized by subsc

refactoring.guru

 

 

gitignore.io

Create useful .gitignore files for your project

www.toptal.com

 

 

 

'기타' 카테고리의 다른 글

[cocoapods] pod init 안될 때  (1) 2023.07.26
[Realm] 하위 class 추가  (0) 2023.05.24
[Xcode] Test Coverag  (0) 2023.02.21
[Xcode] Key Bindings  (0) 2023.02.14
[Xcode] 시뮬레이터 재설정  (0) 2023.02.13

+ Recent posts