Dev/iOS2012. 4. 9. 23:20

너무 어이가 없어서 블로그에 남깁니다.

회사 동료가 스노우 레오파드(snow leopard) OS 에 XCode 4.2 를 설치하려고 했으나, 계속해서 알 수 없는 원인으로 설치 실패가 발생 했습니다.

구 버전들을 삭제하고 재설치 했으나, 여전히 같은 증상.

결국 해결 방법을 찾았는데

방법은 현재 OS의 날짜를 2012년 1월 이전 으로 설정하면 정상적으로 설치가 됩니다.

OS, XCode 버전 올리게 할려고 별 짓을 다하는군요.

출처 : http://stackoverflow.com/questions/9964528/xcode-installation-failed

Posted by 놀란
Dev/C#2012. 3. 23. 21:38

정적 메소드(Static Method)는 클래스의 인스턴스를 생성하지 않아도 호출이 가능한 메소드를 말한다. 정적 메소드는 static 키워드를 이용해서 선언한다.



인스턴스 메소드(Instance Method)는 이름처럼 클래스의 인스턴스를 생성해야만 호출할 수 있는 메소드를 말한다. 


Posted by 놀란
Dev/Unity3D2012. 3. 16. 12:25

PLATFORM 종류

UNITY_EDITOR Define for calling Unity Editor scripts from your game code.
UNITY_STANDALONE_OSX Platform define for compiling/executing code specifically for Mac OS (This includes Universal, PPC and Intel architectures).
UNITY_DASHBOARD_WIDGET Platform define when creating code for Mac OS dashboard widgets.
UNITY_STANDALONE_WIN Use this when you want to compile/execute code for Windows stand alone applications.
UNITY_WEBPLAYER Platform define for web player content (this includes Windows and Mac Web player executables).
UNITY_WII Platform define for compiling/executing code for the Wii console.
UNITY_IPHONE Platform define for compiling/executing code for the iPhone platform.
UNITY_ANDROID Platform define for the Android platform.
UNITY_PS3 Platform define for running Play Station 3 code.
UNITY_XBOX360 Platform define for executing XBbox 360 code.
UNITY_NACL Platform define when compiling code for Google native client (this will be set additionally to UNITY_WEBPLAYER).
UNITY_FLASH Platform define when compiling code for Adobe Flash.


UNITY 버전 

UNITY_2_6 Platform define for the major version of Unity 2.6.
UNITY_2_6_1 Platform define for specific version 1 from the major release 2.6.
UNITY_3_0 Platform define for the major version of Unity 3.0.
UNITY_3_0_0 Platform define for the specific version 0 of Unity 3.0.
UNITY_3_1 Platform define for major version of Unity 3.1.
UNITY_3_2 Platform define for major version of Unity 3.2.
UNITY_3_3 Platform define for major version of Unity 3.3.
UNITY_3_4 Platform define for major version of Unity 3.4.
UNITY_3_5 Platform define for major version of Unity 3.5.

TEST CODE

C# Example: JavaScript Example:


Posted by 놀란
Dev 기타2012. 3. 15. 19:15

windows 에서는 탐색기를 통해서 동일한 디렉토리를 옮길 경우, 병합(merge)가 되지만 맥에서는 병합이 아닌 대치(replace) 가 됩니다.

삽질에 삽질을 경험한 뒤에 처리한 결과는 command 창에서 명령어로 copy 해줬습니다.


cp -Rf source_dir/* dest_dir


-R 옵션은 재귀적으로 subdirectory 의 내용을 모두 복사하는 옵션이고,

-f 옵션은 중복된 파일이 있을 경우, 덮어쓰기 하라는 옵셥입니다.


Posted by 놀란
Dev/iOS2012. 3. 8. 17:18

view 페이지가 아닌 소스 상에서 현재 윈도우나 뷰를 가져올 일이 생길 때 사용해야함.


현재 어플리케이션의 윈도우 가져오기

UIWindow *window = [[UIApplication sharedApplication] keyWindow];


현재 어플리케이션의 VIEW 가져오기 (index 번호로 VIEW 선택)

UIView *view = [[[[UIApplication sharedApplication] keyWindow] subviews] objectAtIndex:0];



Posted by 놀란
Dev/Android2012. 2. 21. 16:07

샘플 프로젝트를 만들어서 run 을 실행시켰음에도 이런 에러가 발생할 경우에는

rm ~/.android/debug.keystore (Linux or Mac Os X) 으로 삭제해주고 다시 빌드하면 됩니다.

Windows 경우에는 C:\Users\Administrator\.android 폴더 를 지우면 됩니다.

Windows 는 각자 자신의 계정 아래입니다.


출처: http://stackoverflow.com/questions/4954316/your-project-contains-errors-please-fix-it-before-running-it


'Dev > Android' 카테고리의 다른 글

[android] 안드로이드 4가지 구성요소  (0) 2012.02.20
Posted by 놀란
Dev 기타2012. 2. 21. 11:40

Mac terminal 에서 crontab 사용을 위해 crontab -e 실행하고 저장할 때,

crontab: temp file must be edited in place 이라는 메세지가 나타나면서 저장이 안되는 현상이 발생.

이를 해결하기 위해서는 crontab -e 로 열고나서 설정을 바꿔줘야 함.

:set nobackup 

설정하고 나서 저장하면 정상적으로 저장이 됩니다.


Posted by 놀란
Dev/Android2012. 2. 20. 14:35

안드로이드 응용 프로그램은 적절한 권한만 있으면 누구든지 인스턴스화 할 수 있는 4개의 컴포넌트로 구성된다.

    1. 액티비티(activity) - 사용자 인터페이스를 구성하는 기본 단위. 윈도우와 유사한 개념으로 생각하되 정확하게 같지는 않으며 윈도우보다는 더 큰 개념. 눈에 보이는 화면 하나가 액티비티이며 여러개의 뷰들로 구성됨. 응용 프로그램은 필요한 만큼의 액티비티를 가질 수 있으며 그 중 어떤 것을 먼저 띄울지를 지정한다.
    2. 서비스(service) - UI가 없어 사용자 눈에 직접적으로 보이지 않으며 백그라운드에서 무한히 실행되는 컴포넌트이다. (ex - mp3 player, 네트워크 감시 등)
    3. 방송 수신자(Broadcast Receiver) - 시스템으로부터 전달되는 방송을 대기하고 신호 전달시 수신하는 역할을 한다. (ex - 배터리 떨어짐, 사진 찍음, 네트워크 전송 완료 등의 신호) 신호만 대기할 뿐 UI를 따로 가지지는 않으므로 방송 수신시 방송의 의미를 해석하고 적절한 액티비티(activity)를 띄우는 역할을 한다.
    4. 콘텐트 제공자(Content Provider) - 다른 응용 프로그램을 위해 자신의 데이터를 제공함. 응용프로그램 간에 데이터를 공유할 수 있는 합법적인 유일한 장치. (ex - database (주소록 등))


출처: 안드로이드 프로그래밍 정복(한빛 미디어)

Posted by 놀란
Dev/iOS2011. 12. 14. 16:18


NSDate *startTime = [NSDate date];


[~~~ 작업 내용];;;;

    

NSDate *endTime = [NSDate date];


NSLog(@"Completed in %f seconds", [endTime timeIntervalSinceDate:startTime]);



Posted by 놀란
Dev/iOS2011. 10. 26. 15:28

Project -> Build Settings -> Apple LLVM compiler 3.0 - Language

Objective-C Automatic Reference Counting

옵션 YES-NO 설정 값 바꾸면 됩니다.

찾느라 고생했네요. ㅠㅠ

Posted by 놀란
Dev 기타2011. 10. 24. 18:58


터미널에서 레티나 이미지(@2x.png) svn add 할 때 @2x 인식 못할 때에 사용

 for f in *@2x.png; do svn add $f@; done


Posted by 놀란
Dev 기타2011. 10. 13. 15:30

svn 디렉토리가 꼬였을 경우, 커맨드 창에서 .svn 파일(디렉토리)를 일괄 삭제해야할 때가 있다.


그때... find . -name .svn -exec rm -rf {} \; 

하면 현재 선택된 디렉토리 밑에 있는 모든 .svn 을 삭제하게 됨.


Posted by 놀란
Dev/iOS2011. 10. 5. 14:16

Property 옵션 값들이 계속 헷갈렸었는데....


@property (


  1. atomic OR nonatomic
    1. 이 두 속성중 하나를 선택하는 것으로 기본값은 atomic입니다. 이부분은 멀티스레딩에 관련된 부분으로 보통 nonatomic을 사용합니다. 자세한건 개발자 문서 참고
  2. assign OR retain OR copy
    1. setter에서 객체를 지정 받을때 
      1. assign의 경우 주소값만 지정받고
      2. retain의 경우 기존것을 release후 새로 받은걸 retain합니다.
      3. copy의 경우 기존것을 release후 새로 받은걸 copy합니다.
    2. 이부분은 setter에 관련있고 getter와는 관련 없습니다.
  3. readonly OR 없음
    1. readonly설정되면 setter가 없습니다. 말그대로 읽기 전용이죠


- 참고 - 문씨의블로그 (http://lab.smoon.kr/70)

Posted by 놀란
Dev/iOS2011. 9. 27. 16:07

CGAffineTransform landscapeTransform = CGAffineTransformMakeRotation(degreesToRadian(40));

[ImageView setTransform:landscapeTransform];


Posted by 놀란
Dev/iOS2011. 9. 27. 16:04


- (UIImage *)convertImageToGrayScale:(UIImage *)image { 

// Create image rectangle with current image width/height 

CGRect imageRect = CGRectMake(0, 0, image.size.width, image.size.height);

// Grayscale color space 

CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray();

// Create bitmap content with current image size and grayscale colorspace 

CGContextRef context = CGBitmapContextCreate(nil, image.size.width, image.size.height, 8, 0, colorSpace, kCGImageAlphaNone);

// Draw image into current context, with specified rectangle 

// using previously defined context (with grayscale colorspace) 

CGContextDrawImage(context, imageRect, [image CGImage]);

// Create bitmap image info from pixel data in current context 

CGImageRef imageRef = CGBitmapContextCreateImage(context);

// Create a new UIImage object  

UIImage *newImage = [UIImage imageWithCGImage:imageRef];

// Release colorspace, context and bitmap information 

CGColorSpaceRelease(colorSpace);

CGContextRelease(context);

CFRelease(imageRef);

// Return the new grayscale image 

return newImage;

}

파라미터를 추가하면 scale도 변경 가능하네요.


Posted by 놀란
Dev/iOS2011. 9. 23. 16:41


UIImage *origianlImage = [UIImage imageNamed:@"source.png"];

UIImage *flippedImage = [UIImage imageWithCGImage:originalImage.CGImage

scale:1.0 

orientaion:UIImageOrientationLeftMirrored];

orientaion 종류

typedef enum {

    UIImageOrientationUp,            // default orientation

    UIImageOrientationDown,          // 180 deg rotation

    UIImageOrientationLeft,          // 90 deg CCW

    UIImageOrientationRight,         // 90 deg CW

    UIImageOrientationUpMirrored,    // as above but image mirrored along other axis. horizontal flip

    

    UIImageOrientationDownMirrored,  // horizontal flip

    UIImageOrientationLeftMirrored,  // vertical flip

    UIImageOrientationRightMirrored, // vertical flip

} UIImageOrientation;

Posted by 놀란
Dev/iOS2011. 8. 30. 12:02

특정 instance 의 클래스 여부를 확인한다.

- (BOOL)isKindOfClass:(Class)aClass

retrun 값은 BOOL (1, 0) - 해당 클래스에 속하면 YES(1), 아니면 NO(0)

사용법:

id result  일 경우,

[result isKindOfClass:[NSArray class]];


- result가 NSArray 인지 확인!

Posted by 놀란
맛집/강남맛집2011. 8. 21. 16:59

서초역과 예술의전당 방면으로 내려오다 보면 있는 수제버거집입니다.
위치가 애매해서 지도 보고 잘 찾아가셔야 될 것 같네요.
바로 앞에 놀이터가 있으니 놀이터를 찾으시면 좀 더 쉽게 찾으실 수 있을꺼에요.
생긴지는 몇년 됐고, 올초에는 윙스푼에도 등록이 된 검증된 맛집입니다!

주력메뉴는 길벗버거 인데 양이 꽤나 많습니다.
여자분들 이거 혼자 다 드시면 인정할께요. ^^;

길벗버거 전경

길벗 메뉴판입니다.

정말 맛있었던 산 미구엘 생맥주!

길벗버거!

이건 조금 작은 길벗쥬니어 입니다.

이렇게 2인분 먹었네요!

아직 공식적으로는 주지 않지만 버거 케이스를 달라고 하시면 주신다고 합니다.

햄버거는 베어먹어야 제맛!!

 

Posted by 놀란
맛집/기타2011. 8. 17. 03:44

 

부산역에 갈 때마다 꼭 들르는 집입니다.
이번 여름휴가에도 도착하자마자 혼자임에도 불구하고 먹고 왔습니다.

맛이 깔끔하게 잘 나오는 집이에요.
부산역에 도착하셔서 한그릇 드시고, 여행 시작하시면 좋을 듯 싶습니다.
대부분 부산사람들은 돼지국밥 위에 정구지(부추) 듬뿍 올려서 드시더라고요.

부산 역에서 택시정거장 건너편 편의점 옆 골목으로 들어가시면 됩니다.

조금만 걸어가시면 오른쪽에 본전 돼지국밥 집이 있어요!!

기본은 돼지국밥.6000원 입니다.다른 돼지국밥집과 달리 따로국밥 식으로 밥이 따로 나옵니다.

수 많은 방문 흔적들. 개그맨들이 많이 왔나봐요.

 

 

Posted by 놀란
Dev/iOS-cocos2d2011. 8. 5. 12:03

좌표(터치)를 이용하여 특정 스프라이트 터치 체크하는 방법

체크는 CGRectContainsPoint 메소드 사용. 참고:( http://goo.gl/BQ2HQ )

CGRectContainsPoint 에 필요한 인자값은 Rect 와 Point

Rect(사각형 스프라이트) 안에 Point 가 있는지 체크하는 메소드 입니다.

사각형 범위를 가져오기 위해서는 해당 sprite의 position과 width, height 를 이용하여 범위를 가져와야 합니다.

cocos2d 에서는 이것을 boundingBox 메소드를 이용하여 쉽게 가져올 수 있습니다.

CGPoint touchPoint = [touch locationInView:[touch view]];

touchPoint = [[CCDirector sharedDirector] convertToGL:touchPoint];

CCSprite *sprite = [CCSprite spriteWitheFile:@"파일명"];

if (CGRectContainsPoint([sprite boundingBox], touchPoint)) {

    NSLog(@"해당 스프라이트 터치 성공.");

} else {

    NSLog(@"해당 스프라이트 터치 안됨.");

}


진작에 쓸걸... 그동안 position, width, height 계산한걸 생각하면.... -_-;;



Posted by 놀란