iPhone dev./Objective C general 썸네일형 리스트형 UIImage 용량 줄이기 UIImage에 imageWithCGImage: scale: orientation: 이라는 함수가 있지만, scale로 크기만 조절할 수 있을 뿐, 이를 NSData로 옮겨도 용량은 그대로이다.그림의 실질적인 용량이 줄기위해선 UIGraphics... 함수로 image를 다시 그려야 한다.다음 예제 코드를 참고한다:(http://stackoverflow.com/questions/5012695/how-to-reduce-the-uiimage-size) UIImage *image = [actualImage you want to resize]; UIImage *tempImage = nil; CGSize targetSize = CGSizeMake(196,110); UIGraphicsBeginImageContext.. 더보기 “_OBJC_CLASS_$_”, referenced from: error in xcode 4.3.2(코드 옮겼을 때) 2down votefavoriteSo today I ran into a major problem. I got a problem involving my viewcontroller on xcode 4.3.2 as seen in this error message:Undefined symbols for architecture i386: "_OBJC_CLASS_$_SecondViewController", referenced from: objc-class-ref in Birdflix_ProViewController.o "_OBJC_CLASS_$_ThirdViewController", referenced from: objc-class-ref in Birdflix_ProViewController.o "_OBJC_CLA.. 더보기 Cyclic한 import 해결(xcode unknown type name) stackoverflow.com 참조: 요약하자면 .h에서는 @class로 선언만 해주고 .m에서 실제로 #import하라는 얘기이다. 4down votefavoriteshare [g+]share [fb]share [tw]I got code like this:Match.h:#import #import "player.h" @interface Match : NSObject { Player *firstPlayer; } @property (nonatomic, retain) Player *firstPlayer; @end Player.h:#import #import "game.h" @interface Player : NSObject { } - (Player *) init; //- (NSInteger)numberOf.. 더보기 Objective C 에서 sha512 사용하기 1. This function will hash a string using SHA512. The resulting string is a hex representation of the hash: + (NSString *) createSHA512:(NSString *)source { const char *s = [source cStringUsingEncoding:NSASCIIStringEncoding]; NSData *keyData = [NSData dataWithBytes:s length:strlen(s)]; uint8_t digest[CC_SHA512_DIGEST_LENGTH] = {0}; CC_SHA512(keyData.bytes, keyData.length, digest); NSData *out = .. 더보기 이전 1 다음