본문 바로가기
[Objective-C] performSelector: 가 경고를 뿜는다? [Objective-C] performSelector: 가 경고를 뿜는다? http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown -Manual Memory Management 시절에서는 performSelector: 가 OK!! -ARC 의 등장으로 performSelector: 는 경고를 내뿜게 되었고.. -Swift 에서는 performSelector: 를 접근하지 못하게 하고, 문서에도 unsafe 하니 쓰지 말라고 해놓았다. -ARC 이후에 performSelector: 를 쓰고 싶다면 이런 방식으로 사용하는 것이 권장된다.ARC 가 detect 하지 못하는 .. 2017. 12. 9.
[Objective-C] new 대신 alloc init? [Objective-C] new 대신 alloc init? -objective-c 코드에서 대부분 new 대신 alloc init 을 사용한다.그 이유는? -가장 큰 이유는 new 는 custom initializer 를 사용할 수 없다는 것.alloc init 은 alloc initWithSomething 과 같은 custom initializer 를 사용할 수 있다. -두번째는 new 보다는 alloc init 이 더 직관적으로 다가온다.메모리 할당 & 초기화 라는 구문으로 더 명시적이다. -new 는 alloc init 과 같은 효과이다.기본 초기자를 사용할 때는 new 를 써도 되겠지만, 가독성이나 여러가지 면을 고려했을 때 그렇게 하지 않는 것이 좋다. alloc init, alloc initw.. 2017. 12. 8.
[ios] 단말 세부 사항 공부 [ios] 단말 세부 사항 공부 SIM Card ID -ICCID Integrated circuit card identifier. 심카드 외부에 기록된 89 로 시작하는 19자리 숫자 -IMSI International mobile subscriber identity IMSI 값은 450으로 시작하는 15자리 숫자로, 회선에 따라 값이 달라진다. 첫 3자리 MCC(Mobile Country Code) + 다음 2자리 or 3자리는 MNC (Mobile Network Code) + MSIN ( Mobile Subscriber Identification Number ) Phone (Device) ID -MEID Mobile equipment identifier 단말기의 global 한 unique numbe.. 2017. 12. 7.
[ios/tutorial] TabBar Height 조정하기 [ios/tutorial] TabBar Height 조정하기 -UITabBar 를 extends 하고, 아래와 같이 높이를 조정한다.-(CGSize)sizeThatFits:(CGSize)size{ CGSize sizeThatFits = [super sizeThatFits:size]; sizeThatFits.height = 100; return sizeThatFits;} -위의 TabBar 적용은 Storyboard 나 XIB 에서 가능하며,코드로 적용할 경우에는, KVC 를 이용하여 적용할 수 있다.[tabBarController setValue:[[CustomTabBar alloc] init] forKey:@"tabBar"]; customtabbar, extends, KVC, setValue, size.. 2017. 12. 6.
[ios/tutorial] TabBar 기본 [ios/tutorial] TabBar 기본 Tab Bar https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/Bars.html -Tab bar 는 tab bar controller 안에 포함되어 있으며, custom view 들에 대한 display 를 담당한다. -Tab bar 는... 투명하다. 항상 화면 최하단에 위치한다. 한번에 5개 이상 표시하지 않는다. (폰에서) 만약 5개 이상의 아이템이 있다면 4개가 표시되고, More tab 을 두어 나머지 리스트를 표시해야 한다. 모든 orientation 에 대해 같은 높이를 유지한다. badge 를 표시할 수 있다. ( badge 는 빨간 .. 2017. 12. 5.
[ios] Custom TabBar 만들기 [ios] Custom TabBar 만들기 -가장 쉬운 Custom Tabbar 는 버튼부터 시작해서 모두 처음부터 만드는 것이다. -처음부터 구현한 Tabbar lib 은..https://github.com/boctor/idev-recipes/tree/master/CustomTabBar -Tabbar 의 tint color 는 아래의 코드로 바꿀 수 있다.[[UITabBar appearance] setTintColor:[UIColor redColor]]; // iOS 5 + 6;[[UITabBar appearance] setBarTintColor:[UIColor redColor]]; // iOS 7 -https://developer.apple.com/library/ios/documentation/UIK.. 2017. 12. 4.
[ios] NSExpression with CoreData [ios] NSExpression with CoreData http://useyourloaf.com/blog/core-data-queries-using-expressions/https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSExpression_Class/#//apple_ref/doc/uid/TP30001190-SW38 -Query 문 성능 측정을 위해서는 launch arguments 에 다음을 추가해야 한다.-com.apple.CoreData.SQLDebug 1 그럼 Debug Console 에서 아래와 같은 로그를 볼 수 있다.2012-01-19 20:31:37.864 ToDoSync[34.. 2017. 12. 3.
[ios] Objective-C 와 Swift 동시에 사용하기 [ios] Objective-C 와 Swift 동시에 사용하기 https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html Swift Code 에서 Objective-C 코드 사용하기-Swift Code 에서 Objective-C 코드를 쓰려면, Objective-C bridging header 가 필요하다.Xocde 는 Objective-C app 에서 Swift file 을 추가할 때, 혹은 그 반대일 때 이를 쉽게 만들 수 있도록 도와준다. 이 과정을 통해 만들어진 header 파일은 [productModuleName]-Bridging-Header.h 파일명을 갖는다. 이.. 2017. 12. 2.
[ios/tutorial] CABasicAnimation, CATransition, CAKeyframeAnimation, CALayer, CAAnimationGroup ( Core Animation ) [ios/tutorial] CABasicAnimation, CATransition, CAKeyframeAnimation, CALayer, CAAnimationGroup ( Core Animation ) http://warmz.tistory.com/entry/Core-Animation-CABasicAnimation-CAKeyframeAnimation-CATransition-CAAnimationGroup -위 블로그가 CoreAnimation 전체에 대해 잘 정리해놓았다.아래 섹션은 각각의 Part 에 대해 조금 더 세세한 정보를 추가해 놓은 것. CABasicAnimation https://developer.apple.com/library/mac/documentation/GraphicsImaging/Ref.. 2017. 12. 1.
반응형