달력

10

« 2024/10 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
Mac에서 Finder나 Quick View로 png를 볼 때 가끔 제대로 표시가 안되는 경우가 있습니다.
여러 툴을 찾아봤는데 이게 가장 쓸만한거 같네요.
http://www.lynapp.com/index.html

이 툴에 대한 소개는 아래 블로그에 잘 나와있더군요.^^;
http://left.tistory.com/entry/lyn-for-mac

:
Posted by netkorea
2010. 9. 9. 11:41

iPhone Keychain Access 개발 - iPhone/개발 Tip2010. 9. 9. 11:41

GenericKeychain 1.1(http://developer.apple.com/library/ios/#samplecode/GenericKeychain/Listings/Classes_AppDelegate_h.html#//apple_ref/doc/uid/DTS40007797-Classes_AppDelegate_h-DontLinkElementID_3)
을 이용해서 KeyChain에 반영했었는데, 3.1.2에서는 문제가 없었는데 iOS 4.0이상에서 제대로 실행되지 않더군요.

검색해보니 위 링크처럼 1.2가 새로 나와서 적용했는데, 1.1이랑 코드가 거의 안바뀐거 같은데도 온갖 에러가 발생하더군요.

2-3일 고생하다가 http://useyourloaf.com/blog/tag/keychain 에서 방법을 찾았네요.
짜증~ ㅠㅠ

keychain에 등록 중 발생하는 에러코드
http://developer.apple.com/library/mac/#documentation/Security/Reference/keychainservices/Reference/reference.html

Result Codes

The most common result codes returned by Keychain Services are listed in the table below. The assigned error space for Keychain Services is discontinuous: –25240 through –25279 and –25290 through –25329. Keychain Item Services may also return noErr (0) or paramErr (–50), or CSSM result codes (see Common Security: CDSA and CSSM, version 2 (with corrigenda) from The Open Group (http://www.opengroup.org/security/cdsa.htm)).
Result Code Value Description
errSecSuccess 0 No error.

:
Posted by netkorea
http://snipplr.com/view/39706/setting-cocos2d-camera-position-using-ccfollow/

  1. -(void)setPlayerPosition:(CGPoint)position {
  2. CGPoint tileCoord = [self tileCoordForPosition:position];
  3. int tileGid = [_meta tileGIDAt:tileCoord];
  4. if (tileGid) {
  5. NSDictionary *properties = [_tileMap propertiesForGID:tileGid];
  6. if (properties) {
  7. NSString *collision = [properties valueForKey:@"Collidable"];
  8. if (collision && [collision compare:@"True"] == NSOrderedSame) {
  9. return;
  10. }
  11. NSString *collectable = [properties valueForKey:@"Collectable"];
  12. if (collectable && [collectable compare:@"True"] == NSOrderedSame) {
  13. [_meta removeTileAt:tileCoord];
  14. [_foreground removeTileAt:tileCoord];
  15. self.numCollected++;
  16. [_hud numCollectedChanged:_numCollected];
  17. }
  18. }
  19. }
  20.  
  21. ccTime moveDuration = 0.3;
  22. id playerMove = [CCMoveTo actionWithDuration:moveDuration position:position];
  23. id cameraMove = [CCFollow actionWithTarget:_player worldBoundary:CGRectMake(0, 0, (_tileMap.mapSize.width * _tileMap.tileSize.width), (_tileMap.mapSize.height * _tileMap.mapSize.height))];
  24. [_player runAction:playerMove];
  25.  
  26. [self runAction:cameraMove];
  27.  
  28. }

:
Posted by netkorea
2010. 8. 6. 17:18

NSZombieEnabled 개발 - iPhone/개발 Tip2010. 8. 6. 17:18

인터넷 돌아다니다가 우연히 보게되었는데 나중에 디버깅할 때 쓸모있을지 몰라서 올려둡니다.
http://www.cocoadev.com/index.pl?NSZombieEnabled

메모리 할당과 해제는 정말 어렵죠. ^^;
아 할당과 해제가 어려운게 아니라 그걸 제대로 지켜가면서 사용하는게 어렵다고 해야할려나요.
개인적 생각으론 Java나 C#처럼 그냥 알아서 해주든지 C/C++처럼 명시적으로 해주면 좀 더 명확할건데 autorelease랑 factory개념때문에 처음 입문하거나 새로운 Class를 사용하게되는 경우 더 힘들지 않나 싶네요.. 뭐든지 다 마찬가지겠지만 익숙해지면 나아지겠죠. ^^;

아 중요한 NSZombieEnabled에 대한 설명이 없이 잡설만 늘어놨네요.
위 링크에 가시면 자세한 설명이 나와있지만, 간략히 말씀드리면 이놈은 Memory 해제시 실제 해재하지 않고 단지 해제했다는 mark만 달고 해제한 오브젝트에 메시지를 보낼 경우 로그를 남기게 됩니다. 이런게 왜 필요하냐면, 메모리 해제를 한 후 그 해제한 오브젝트를 이용해서 뭔가 할 경우 이상하게(undefined라고 하죠 ^^) 작동해서 그 원인을 찾기가 매우 어렵기 때문에, 해제한 오브젝트에대한 호출을 쉽게 찾기 위해서입니다.  예전에 C++에서도 비슷한 경우에 대한 처리방법에 대한 기사를 읽었던거 같은데 너무 오래전이라 기억이 가물가물하네요. 요즘은 C#을 알게된 뒤론 C나  C++은 소스만 봐도 이상하게 보이는 듯 하네요. ㅎㅎ
:
Posted by netkorea