목록Programming (41)
ㄷㅣㅆㅣ's Amusement
오늘은 간단하게 아이폰/아이패드에서 비디오를 재생시키는 앱을 만들어보자.Today's post is about simple Video Player on iPhone/iPad. 1. 안드로이드의 비디오 뷰와 같이 사용할 수 있도록 UIView를 상속받아 비디오 레이어를 붙여준다.1. To use like an android video view, Inherit UIView and add the video layer to it.123456@import AVFoundation;#import @interface VideoView : UIView@property (strong, nonatomic) AVPlayerLayer *videoLayer;@endColored by Color Scriptercs 12345678..
Xcode/iOS/Objective-c에서 이미지 자르기.Image Crop in Xcode/iOS/Objective-C 1. ImageCropViewController 1) 이미지를 자를 수 있는 뷰 컨트롤러를 만든다. 1) Making View Controller for Image Crop like below. 2) 이미지 자르기 할 영역만 음영처리가 빠져있고, 이미지는 원형으로 자름. 2) We should shade except cropping region. and We're gonna crop in circle. 3) Core Graphics for circular masking. - 이미지를 사각형으로 자를 것이라면 전혀 문제가 없겠지만, 대부분의 이미지 크롭 프로젝트에서는 원형으로 자르기 때..
[iOS/Objective-C]에서 thread를 순차적으로 처리하기.Thread starts when the other Thread ends [on iOS/Objective-C] 여러가지 방법이 있겠지만.... 세마포어를 사용하면 간단하다.There are so many way to do. but, you had better to use semaphore. 1. Create semaphoredispatch_semaphore_t sema = dispatch_semaphore_create(0); 2. Do Threaddispatch_async(......, ^ { // Do something ........ dispatch_semaphore_signal(sema);)}; 3. Wait for semapho..
Here is the simplest way to encrypt/decrypt using CCCRypt on iOS오늘은... iOS에서 CCCRypt를 이용하여 encrypt/decrypt하는 간단한 방법에 대해서 포스팅해볼까 합니다. I had to decrypt json string which is encrypted AES128/CBC-mode/NoPadding. but in iOS, there's no "NoPadding" option, you will hesitate which option you use. 우선... 이 프로젝트를 시작한 계기는.. 서버에서 AES128로 CBC모드에 NoPadding으로 암호화된 json string을 내려주기 때문에 이것을 맞춰주려고 한거였는데, 이노무 CBC..
iOS에서 UIButton으로 작업하다보면 UIControlState에 따라 bacground color도 변경해야 할 때가 있는데, background image는 interface builder에서 변경 가능하지만 bg color는 그렇지 못하다. 따라서 bg clolor를 설정할 수 있는 category를 한개 더 만들어보도록 한다. (Objective-C 코드) 1234567891011121314151617181920#import "UIButton+BgColor.h" @implementation UIButton (BgColor)- (void)setBgColor:(UIColor *)color forState:(UIControlState)state{ // 버튼 백그라운드 이미지를 채우기위한 더미 뷰...
오랜만에 네이버 웹마스터 도구를 들어가봤더니... 왠 로봇거부 에러가 잔뜩!!! ㅡ0ㅡ; robots.txt는 전혀 건드린 적이 없는데 왠 로봇 거부지 ㅡ,.ㅡ?에라 모르겠다 그래서 그냥 스킨에 적용하기로 한다. 네이버는.. 내가 알기로는 크롤러 로봇으로 NaverBot과 Yeti를 사용한다... 그러니까.... 얘네들이 크롤링 할 수 있도록 메타에 추가하면 될듯.위에 파랑색으로 동그라미 친 부분은 다음과 같다. 바로 위에 붙여넣으면 됨. 12345678 Colored by Color Scriptercs 어쩐지 네이버에서 검색누락이 된다거나, 아니면 늦게 등록된다 싶으면 네이버 웹마스터 도구에서 한번 찾아보세요~ http://webmastertool.naver.com
오늘은... iOS에서 지문인식을 통한 인증방법에대해 포스팅을 해봅니다. 우선... 지문인식 다이얼로그는 LAContext로 띄울 수 있는데.... 이것을 쓰면 "enter passcode"를 눌렀을 때 "User fallback"에러메시지가 떨어진 후 passcode입력할 수 있는 방법이 없기 때문에.. 나는 이를 우회할 수 있는 다른 방법을 쓰기로 한다. 1. flow 1) 키체인을 설정하되, 읽을 때 touch id(지문인식)을 요구하도록 설정한다. 2) 키체인을 읽어들이는 쿼리(query)를 실행한다. 1) keychain 설정.12345678910111213141516171819202122232425262728293031323334353637383940414243444546- (void)setK..
문제. 다음은 파일 압축에 활용하기위한 huffman code 작성의 단계이다. 1) A,B로만 이루어진 파일일 때. (A -> B 순서로 빈도수 내림차순) 0 / \ 0 1 --> A : 00, B: 01 2) A,B,C로 이루어진 파일일 때. 0 / \ 0 1 / \ 0 1 --> A: 00, B:010, C:011, (A -> B -> C 순서로 빈도수 내림차순) 문제 : A,B,C,D,E로 이루어진 파일일 때 "E"의 코드로 알맞은 것은? (단, A -> B -> C -> D -> E 순서로 빈도수 내림차순) 가. 0010 나. 0100 다. 0111 라. 0011 위와 같은 문제는 IT기업의 신입 개발자 선발을 위한 필기 문제로 다분히 많이 출제된다.왜냐하면... 누구나 다 트리를 읽는것은 할줄..
1. MMS는 SMS와는 달리 그냥 http-post를 하면 된다. 우선 네트워크 피처를 통해서 MMS 전송요청을 한다.12final ConnectivityManager connMgr = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);final int result = connMgr.startUsingNetworkFeature( ConnectivityManager.TYPE_MOBILE, Phone.FEATURE_ENABLE_MMS);cs 2. result로 Phone.APN_REQUEST_STARTED를 받으면 BroadCastReciver를 등록하고 Phone.APN_ALREADY_ACTIVE가 올때까지 기다린다.1..
안드로이드 webview에서 스크롤할 때 깜박이는 이슈. 이거는 스크롤을 하는 해당 webview에서도 발생할 수 있지만 한 액티비티에 웹뷰가 두 개 이상 있는경우 다른 webview에서 잘 발생함. (4.1.x에서 특히) 아래 코드처럼 추가해주면 깔끔하다. (android:layerType="software")알면 초 간단한데, 모르면 미치고 팔짝 뛸 노릇. 그런데 가끔 팬텍 단말들은 개선되지 않을 수도 있음. 잘가거라 ㅜㅜ 12345678 cs