typedef1 15. Objective-C typedef, type casting typedefObjective-C의 typedef는 Swift의 typealias와 동일한 기능을 수행한다.둘 다 기존 타입에 새로운 이름을 부여하여 가독성을 높이고 코드의 간결성을 유지하는 데 사용된다. //Swift typealias MyUnsignedInt = UInt let value: MyUnsignedInt = 10 Objective-C typedef// 이제 BYTE는 unsigned char 대신 쓰이게 된다.// 구별을 위해 주로 대문자로 작성한다.typedef unsigned char BYTE;BYTE b1; 구조체의 typedef 사용typedef struct Musics { NSString *title; NSString *artist; int playTimeSec;}.. 2024. 5. 17. 이전 1 다음