본문 바로가기
[ios] NSError** 에 대한 nullable, nonnull warning 처리 [ios] NSError** 에 대한 nullable, nonnull warning 처리 원래는 제대로 NSError** 에 대해서도 nullability 체크를 해주려면, 아래와 같이 바뀌어야 한다.(NSError**) error => (NSError* __nullable * __nullable) error 그러나 가독성이나 코드 유지 측면에서 봤을 때, 너무 좋지 않다.차라리 필요한 곳에만 nullability 를 넣고, warning 을 생성하지 않는 것이 방법일 수도 있다.이 경우에는 이를 넣어주면 된다. #pragma clang diagnostic ignored "-Wnullability-completeness" diagnostic ignored, nonnull, nonnull warning 처.. 2017. 11. 8.
[ios] Core Data 사용 시  Cocoa error 1570 [ios] Core Data 사용 시 Cocoa error 1570 -필수 field 가 채워지지 않았다는 의미이다.Simple!! cocoa error 1570, coredata 1570, coredata error 1570, [ios] Core Data 사용 시 Cocoa error 1570, 필수 field 2017. 11. 7.
[ios/tutorial] Core Data - Creating and Saving Managed Objects [ios/tutorial] Core Data - Creating and Saving Managed Objects https://developer.apple.com/library/watchos/documentation/Cocoa/Conceptual/CoreData/CreatingObjects.html#//apple_ref/doc/uid/TP40001075-CH5-SW1 Creating Managed Objects -NSManagedObject 는 Core Data 의 model object 이다.NSManagedObject 는 2개의 element 를 갖는다. entity description ( NSEntityDescription 과 managed object context ( NSManagedObjec.. 2017. 11. 6.
[ios/tutorial] Core Data - Creating and Modifying Custom Managed Objects [ios/tutorial] Core Data - Creating and Modifying Custom Managed Objects https://developer.apple.com/library/watchos/documentation/Cocoa/Conceptual/CoreData/LifeofaManagedObject.html#//apple_ref/doc/uid/TP40001075-CH16-SW1-NSManagedObject 는 generic class 이다. Creating Custom Managed Object Subclasses -@interface MyManagedObject : NSManagedObject @property (nonatomic, strong) NSString *title;@prop.. 2017. 11. 5.
[ios/tutorial] Core Data - Fetching Objects [ios/tutorial] Core Data - Fetching Objects https://developer.apple.com/library/watchos/documentation/Cocoa/Conceptual/CoreData/FetchingObjects.html#//apple_ref/doc/uid/TP40001075-CH6-SW1 -NSFetchRequest 를 이용해서 존재하는 data 를 fetch 해올 수 있다. Fetching NSManagedObject Instances -NSManagedObjectContext *moc = …;NSFetchRequest *request = [NSFetchRequest fetchRequestWithEnityName:@“Employee”]; NSError *e.. 2017. 11. 4.
[ios/tutorial] Core Data - Initializing the Core Data Stack [ios/tutorial] Core Data - Initializing the Core Data Stack https://developer.apple.com/library/watchos/documentation/Cocoa/Conceptual/CoreData/InitializingtheCoreDataStack.html#//apple_ref/doc/uid/TP40001075-CH4-SW1 -Core data stack 은 core data 를 초기화하고, external data store 와 app 사이를 중재하는 역할을 하는 framework 집합을 이야기한다. -stack 은 다음 세 가지로 구성된다. NSManagedObjectContextNSPersistentStoreCoordinatorNSMana.. 2017. 11. 3.
[ios/tutorial] Core Data - Creating a Managed Object Model [ios/tutorial] Core Data - Creating a Managed Object Model https://developer.apple.com/library/watchos/documentation/Cocoa/Conceptual/CoreData/KeyConcepts.html#//apple_ref/doc/uid/TP40001075-CH30-SW1 -model layer 를 관리하는 framework를 core data 라고 부른다.많은 것을 자동화시켜서 제공한다. -Core data 의 schema 는 managed object model 로 mapping 된다. ( NSManagedObjectModel )이 model 은 소위 table 이라고 부르는 entity 들의 집합이다. Creatin.. 2017. 11. 2.
[ios] Nullable & NonNull annotation [ios] Nullable & NonNull annotation -안드로이드에 보면 @Nullable, @NonNull 이라는 annotation 이 있어 API 사용에 대한 혜안을 주기 편리하다. -iOS 에도 있을까? -있다._Nullable 과 _Nonnull 이 그것이다. --(NSString* _Nullable)informationWithId:(NSString* _Nonnull)id; 위와 같은 문법으로 사용하면 된다. -_Nullable 과 _Nonnull 대신 nullable 과 nonnull 로 사용해도 된다.대신 이 경우에는 괄호의 처음에 온다.-(nullable NSString*)informationWithId:(nonnull NSString*)id; -property 에도 nullab.. 2017. 10. 30.
[ios] ARC 와 Toll-free bridging [ios] ARC 와 Toll-free bridging Toll-Free Bridging -ARC 는 Objective-C 의 Object 만을 대상으로 한다.Core Foundation 범주의 Object 들은 대상이 아니다. -Core Foundation API 를 사용할 경우 개발자가 수동으로 메모리 관리를 해야 한다.CoreFoundation Objective-C 클래스간의 타입 캐스팅을 할 수 있으며,이 때 아무런 cost 없이 작업을 할 수 있다 하여 Toll-Free bridging 이라고 부른다. -Toll-Free bridging 을 할 때 주의할 점은 메모리관리 주체를 이전하느냐 마느냐이다. __bridge -Objective-C Object Core Foundation 변환하고 싶을 .. 2017. 10. 29.
반응형