BLOG main image
for our next (37)
Dev (32)
iOS (12)
Unity3D (16)
Android (4)
Mac (1)
Windows (2)
FreeTalk (1)
Shell (1)
Private (0)
Visitors up to today!
Today hit, Yesterday hit
daisy rss
tistory 티스토리 가입하기!
'Dev/iOS'에 해당되는 글 12건
2021. 12. 14. 10:45

TestFlight 에 올릴때

버전(CFBundleShortVersionString)이 올라가면 빌드넘버(CFBundleVersion)는 다시 처음부터 시작됨.

 

예)

- XCode 13 의 manageAppVersionAndBuildNumber 때문에 내부에서 관리하던 빌드넘버가 꼬여버림

-- 1.xx.xx => 2 로 되어 버림

- 강제로 내부에서 관리하는 빌드넘버에 +1 을 해서 사용 (2.xx 로)

 

버전이 올라가면서 1.xx 로 내려가도 문제 없음

 

2012. 5. 10. 13:40

- (NSString *)getModel {

    size_t size;

    sysctlbyname("hw.machine", NULL, &size, NULL, 0);

    char *model = malloc(size);

    sysctlbyname("hw.machine", model, &size, NULL, 0);

    NSString *sDeviceModel = [NSString stringWithCString:model encoding:NSUTF8StringEncoding];

    free(model);                              

    if ([sDeviceModel isEqual:@"i386"])      return @"Simulator"//iPhone Simulator

    if ([sDeviceModel isEqual:@"iPhone1,1"]) return @"iPhone1G";   //iPhone 1G

    if ([sDeviceModel isEqual:@"iPhone1,2"]) return @"iPhone3G";   //iPhone 3G

    if ([sDeviceModel isEqual:@"iPhone2,1"]) return @"iPhone3GS"//iPhone 3GS

    if ([sDeviceModel isEqual:@"iPhone3,1"]) return @"iPhone4"//iPhone 4 - AT&T

    if ([sDeviceModel isEqual:@"iPhone3,2"]) return @"iPhone4"//iPhone 4 - Other carrier

    if ([sDeviceModel isEqual:@"iPhone3,3"]) return @"iPhone4";    //iPhone 4 - Verizone

    if ([sDeviceModel isEqual:@"iPhone4,1"]) return @"iPhone4S";   //iPhone 4S

    if ([sDeviceModel isEqual:@"iPod1,1"])   return @"iPod1stGen"; //iPod Touch 1G

    if ([sDeviceModel isEqual:@"iPod2,1"])   return @"iPod2ndGen"; //iPod Touch 2G

    if ([sDeviceModel isEqual:@"iPod3,1"])   return @"iPod3rdGen"; //iPod Touch 3G

    if ([sDeviceModel isEqual:@"iPod4,1"])   return @"iPod4thGen"; //iPod Touch 4G

    if ([sDeviceModel isEqual:@"iPad1,1"])   return @"iPadWiFi";   //iPad Wifi

    if ([sDeviceModel isEqual:@"iPad1,2"])   return @"iPad3G";     //iPad 3G

    if ([sDeviceModel isEqual:@"iPad2,1"])   return @"iPad2WiFi";      //iPad 2 (WiFi)

    if ([sDeviceModel isEqual:@"iPad2,2"])   return @"iPad2GSM";      //iPad 2 (GSM)

    if ([sDeviceModel isEqual:@"iPad2,3"])   return @"iPad2CDMA";      //iPad 2 (CDMA)

    if ([sDeviceModel isEqual:@"iPad3,1"])   return @"iPad3GWiFi";      //iPad 3G (WiFi)

    if ([sDeviceModel isEqual:@"iPad3,2"])   return @"iPad3G4G";      //iPad 3G (4G)

    if ([sDeviceModel isEqual:@"iPad3,3"])   return @"iPad3G4G";      //iPad 3G (4G)

    

    NSString *aux = [[sDeviceModel componentsSeparatedByString:@","] objectAtIndex:0];

    

    //If a newer version exist

    if ([aux rangeOfString:@"iPhone"].location!=NSNotFound) {

        int version = [[aux stringByReplacingOccurrencesOfString:@"iPhone" withString:@""] intValue];

        if (version == 3) return @"iPhone4";

            if (version >= 4) return @"iPhone4s";

        

    }

    if ([aux rangeOfString:@"iPod"].location!=NSNotFound) {

        int version = [[aux stringByReplacingOccurrencesOfString:@"iPod" withString:@""] intValue];

        if (version >=4) return @"iPod4thGen";

    }

    if ([aux rangeOfString:@"iPad"].location!=NSNotFound) {

        int version = [[aux stringByReplacingOccurrencesOfString:@"iPad" withString:@""] intValue];

        if (version ==1) return @"iPad3G";

        if (version >=2) return @"iPad2";

    }

    //If none was found, send the original string

    return sDeviceModel;

}


@end


2011. 11. 4. 01:26
// 파일의 존재 유무를 검사한다.
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"BountyHunter.sqlite"];
// 파일 존재 유무에 따라 없으면 복사하고 있으면 복사하지 않는다.
BOOL dbExists = [fileManager  fileExistsAtPath:[storeURL path]];
if ( !dbExists )
{
  // 파일이 없는 경우.
  NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"BountyHunter.sqlite"];
  NSError *error = nil;
  BOOL success = [fileManager copyItemAtPath:defaultDBPath toPath:[storeURL path] error:&error];
  if ( !success )
  NSAssert1(0, @"Failed to create writable database file with message '%@'", [error localizedDescription]);
}
  Copyright: http://teddevtalk.blogger.com 이 글은 저작자의 허락 없이 변경하거나 상업적인 목적으로 인용할 수 없습니다. 인용시 출처와 링크를 표기하여 주시기 바랍니다. 

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

CFBundleVersion  (1) 2021.12.14
iOS Model 정보!  (0) 2012.05.10
In App Purchase : invalidProductIdentifiers  (1) 2011.01.14
App 안에 Store Link 달기  (0) 2011.01.10
[Xcode] Build and Archive  (1) 2010.12.22
2011. 1. 14. 16:37
잘 되던 놈이 이 에러를 자꾸 내보낸다..

iPhone 에 심어져 있던 app 을 완전 삭제후 다시 설치해서 하니 잘 작동된다.
(provisioning 파일을 갱신해서 그런가~? 흠..)
2011. 1. 10. 15:03
Application 안에 특정 Application 에 대한 AppStore 링크를 넣을 필요가 있는 경우가 있습니다.

그래서, 사용자가 프로그램에서 특정 버튼을 터치 하면 응용 프로그램이 종료되면서
iPhone /iPod Touch 안의 AppStore 프로그램이 실행되고, 곧장 정해진 프로그램의 페이지로 이동됩니다.

예를 들어, 가장 쉽게 생각할 수 있는 경우로 Full Version - Lite Version 의 두 가지 버전을 릴리즈해서 운영하는 경우를 생각해 볼 수 있겠습니다.
이 경우, 무료로 배포되는 Lite 버전(즉, Free 버전)안에서 어떤 동작을 하면 유료 버전을 구입할 수 있는 앱스토어 페이지가 나타나도록 하면 좋을 것입니다. 물론, 현재는 무료 버전 안에서도 유료 구매가 가능하도록 '프로그램 안에서 구매' 기능이 허용되고 있지만, 각각의 방식에는 장단점이 있는 듯 합니다. 아직 많은 사람들이 가장 전통적인 방법에 속하는 유료/무료 따로 릴리즈 방식을 사용하고 있습니다.


그렇다면, iPhone 프로그램 안에서 앱스토어 링크를 넣는 방법은? 간단히 하자면, 데스크탑에서 iTunes 를 실행한 후 원하는 프로그램의 링크를 얻어서 붙여 넣으면 됩니다. 이 경우 링크는 다음과 같은 형태가 됩니다.


그래서 이것을 사용해서 다음과 같은 코드를 삽입하겠지요.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://itunes.apple.com/kr/app/funny-cartoon-face/id333209093?mt=8"]];



그런데, 이것은 동작은 하지만, 몇 가지 문제가 있습니다.

첫 째로, http 프로토콜을 사용한다는 것입니다. 따라서, iPhone 에서 실제 테스트를 해 보면, 사파리 브라우저가 실행된 다음, 몇 단계의 리다이렉션이 수행되고, 다시 브라우저가 자동 종료되면서 AppStore 가 실행됩니다.
분명 사용자들이 짜증날 것입니다.

두 번째로, 이것은 심각한 문제인데, 바로 주소 안에 '국가 정보'가 들어가 있다는 것입니다. 위에서 예로 들은 URL 안에도 'kr' 이라는 경로명이 있어서, 한국 스토어로 지정되어 있습니다.
그래서, 이 URL은 한국 앱스토어 계정으로 사용하고 있는 사용자들에게는 아무 문제가 없지만, 그 이외의 사용자들은 다른 나라 계정으로 바꾸라는 에러 메시지가 나타나게 됩니다.

하 나의 프로그램으로 전 세계 사람들이 다운로드 받아서 사용하는데, 그 안에 내포된 링크는 특정 국가용 AppStore 링크만 넣을 수 있다는 것은 큰 문제가 됩니다. 사용자의 국가 설정을 일일이 확인해서 적당한 링크로 바꾸자면? 생각만 해도 끔찍하군요.




그러면, 먼저 두 번째 문제의 해결책부터 알아봅시다.

애플에서는 앱스토어 링크를 보다 사람이 기억하기 쉬운 형태의 URL을 사용할 수 있도록 지원하고 있습니다. 예를 들어, 위의 링크는 아래의 링크로 대체할 수 있습니다.


프로그램의 이름만으로 쉽게 기억할 수 있는 URL 입니다. 게다가 더 좋은 점은!!  바로 URL 안에 국가를 지정하는 경로명이 없다는 것입니다. 이 하나의 URL 만으로 각 사용자가 가지고 있는 계정에 따라 해당 국가의 스토어 안에서 프로그램을 찾아가게 됩니다.
이 URL 은 따로 신청해서 만들거나 하는 절차가 필요 없습니다. 앱스토어에 등록된 프로그램은 모두 이같은 형태의 URL을 사용할 수 있습니다. 단, 프로그램의 이름이 영문자가 아닌 한글이나, 특수 문자가 들어간 경우에 대해서는 어떻게 사용하는지 아직 찾지 못했습니다.


첫 번째 문제의 해결책으로 돌아가 보겠습니다.

이것도 간단합니다. iPhone Application 안에서 앱스토어 링크를 사용하는 경우, http 프로토콜을 사용하지 말고 다른 것을 사용하면 됩니다. 바로 http:// 대신에 itms:// 을 사용하는 것입니다. 당연히 iPhone 이나 iPod Touch 같은 실제 디바이스에서만 동작합니다. 시뮬레이터에서는 테스트 해볼 수 없습니다.
그래서 결론적으로 다음과 같은 URL을 사용할 수 있을 것입니다.

itms://itunes.com/app/FunnyCartoonFace

itms:// 을 사용하면 사파리 브라우저를 거치지 않고 곧장 AppStore 가 실행될 것입니다. 깔끔합니다.

2010. 12. 22. 12:30
http://theeye.pe.kr/entry/how-to-use-build-and-archive-on-new-xcode

unable to copy dsym file into archive
: Try setting 'Generate Debug Symbols' to true in the build settings of the target you're trying to build and archive.

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

In App Purchase : invalidProductIdentifiers  (1) 2011.01.14
App 안에 Store Link 달기  (0) 2011.01.10
objective C category 내 동일한 함수들  (0) 2010.12.22
xcode weak framework  (0) 2010.12.22
Uninstalling Xcode Developer Tools  (0) 2010.12.21
2010. 12. 22. 03:40
뭐가 호출될지 알 수 없다...

iPhone 에서 작성된 글입니다.

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

App 안에 Store Link 달기  (0) 2011.01.10
[Xcode] Build and Archive  (1) 2010.12.22
xcode weak framework  (0) 2010.12.22
Uninstalling Xcode Developer Tools  (0) 2010.12.21
UIImage to bytes  (0) 2010.11.16
2010. 12. 22. 03:38
project->build settings->general->...

이제안잊어먹겠지...

iPhone 에서 작성된 글입니다.

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

[Xcode] Build and Archive  (1) 2010.12.22
objective C category 내 동일한 함수들  (0) 2010.12.22
Uninstalling Xcode Developer Tools  (0) 2010.12.21
UIImage to bytes  (0) 2010.11.16
Base SDK Missing  (0) 2010.09.09
2010. 12. 21. 14:19

Uninstalling Xcode Developer Tools

To uninstall Xcode developer tools on the boot volume along with the directory, from a Terminal window type:

$ sudo <Xcode>/Library/uninstall-devtools -mode=all

To remove the underlying developer content on the boot volume, but leave the directory and supporting files untouched, from a Terminal window type:

$ sudo <Xcode>/Library/uninstall-devtools --mode=systemsupport

To just remove the UNIX development support on the boot volume, but leave the directory and supporting files untouched, from a Terminal window type:

$ sudo <Xcode>/Library/uninstall-devtools --mode=unixdev

Finally, to just uninstall the directory you can simply drag it to the trash, or from a Terminal window type:

$ sudo <Xcode>/Library/uninstall-devtools --mode=xcodedir

NOTE: The uninstaller that ships with previous versions of the Xcode developer tools will not clean everything off of your system properly. You should use the one installed with these Xcode developer tools.

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

objective C category 내 동일한 함수들  (0) 2010.12.22
xcode weak framework  (0) 2010.12.22
UIImage to bytes  (0) 2010.11.16
Base SDK Missing  (0) 2010.09.09
Couldn't register ** with the bootstrap server. Error: unknown error code.  (0) 2010.09.07
2010. 11. 16. 13:46
//Converting UIImage to NSData
UIImage *image = [UIImage imageNamed: @"canning.png"];
NSData *imageData = UIImagePNGRepresentation(image);

//Converting NSData to Byte array
NSUInteger len = [imageData length];
Byte *byteData = (Byte*)malloc(len);
memcpy(byteData, [imageData bytes], len);

prev"" #1 #2 next