// 선언 @interface RenderView : UIView { CADisplayLink *displayLink; } // 초기화 displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(runLoop)]; [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; // 루프함수 -(void)runLoop { NSLog(@"runLoop"); [self setNeedsDisplay]; }
iOS에서는 리눅스의 clock_gettime()함수가 존재하지 않는다. 따라서 리눅스 코드를 포팅할때는 아래와 같은 대체함수를 사용하여야 한다. #include #include #ifdef __MACH__ #include #include #endif struct timespec ts; #ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time clock_serv_t cclock; mach_timespec_t mts; host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock); clock_get_time(cclock, &mts); mach_port_deallocate(mach_..
#import @interface RenderView : UIView { CGImageRef imageRef; char *rawData; int rb, w, h; CGColorSpaceRef colorSpace; } @end #import "RenderView.h" @implementation RenderView - (id)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; NSLog(@"initWithCoder"); colorSpace = CGColorSpaceCreateDeviceRGB(); w = self.bounds.size.width; h = self.bounds.size.height; rb = 4*w; NSLog..
이번에 티맥스OS의 발표를 보고 너무나 안타까워서 오랫동안 윈도우 프로그래머로서의 경험을 살려서 MS윈도우 호환OS 만드는 방법을 생각해 봤다. 내가 MS윈도우 호환OS를 만든다면 MySQL 호환 DBMS인 MariaDB와 같은 방식으로 만들었을 것 같다. MariaDB는 이름만 MariaDB이지만 터미널에서 mysql 명령어 실행파일로 동작하며, MySQL C API의 이름도 심지어 똑같다. 함수명을 예를 들면 mysql_connect() 등. 사실상 쓰는 사람의 입장에서는 MySQL인지 MarisDB인지 모른다. 태생이 MySQL 소스코드에서 출발해서 그렇지만... 티맥스의 가장 큰 고객은 대한민국 정부이다. 그리고 아래아한글(HWP) 처럼 공공기관의 MS워드를 대체하는 것처럼, MS윈도우를 대체하는..
내 앱의 뱃지 알림의 갯수를 런쳐쪽에 전달을 해주어야 런쳐에서 내 앱의 뱃지 갯수를 그려준다. 그래서 다음과 같이 앱에서 설정해 주어야 한다. public static String getLauncherClassName() { Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); PackageManager pm = AmandaApp.getAppContext().getPackageManager(); List resolveInfos = pm.queryIntentActivities(intent, 0); for (ResolveInfo resolveInfo : resolveInfos) { String ..
소스단위로 되어 있는 iOS 라이브러리를 프로젝트에 폴더단위로 드래그앤 드롭을 하게 되면 안에 있는 .a 라이브러리 파일들이 Build Settings에 Linked Frameworks and Libraries에 자동으로 추가가 되지 않는다. 따라서 항상 소스단위의 iOS 라이브러리를 프로젝트에 추가할때는 프로젝트의 폴더에서 오른쪽 버튼을 누른후 'Add Files to (ProjectName)'을 사용해야 한다.
- Total
- Today
- Yesterday