- 복잡한 선 드로잉이나 웹의 캔버스같은 2차원 드로잉 라이브러리
코어 그래픽스 프레임워크의 핵심

- UIView의 CALayer에 직접 그릴때 사용된다.

- Core Graphics Framework와 CoreGraphics/CoreGraphics.h가 포함되어 있어야 한다.

- Graphical Context : 쿼츠를 작성할 장소 - 프린터, PDF파일, 윈도우, 비트맵 이미지
각 UIView의 코어 애니매이션 레이어인 CALayer와 자동으로 연계되어 작업하게 된다.

- drawRect: 메소드 오버라이드
- UIGraphicsGetCurrentConext 메소드 호출로 현 컨텍스트를 조회한다.
- UIGraphicsBeginImageContext,  UIGraphicsEndImageContext : 프로그램의 다른 곳에서 사용할 수 있는 이미지를 생성하거나 수정하기위해 비트맵 컨텍스트를 생성한다.

- setNeedsDisplay을 사용하면 drawRect 함수가 불려 다시 그려지게 된다.

- setNeedsDisplay 를 사용했을 때 drawRect함수가 제때 불려지지 않는 경우 다음과 같이 쓰면 업로드 된다.
[self performSelectorOnMainThread:@selector(setNeedsDisplay) withObject:0 waitUntilDone:NO];

[출처 : http://jerryan.egloos.com/2688961 ]

애플에서 권장하는 아이콘 크기는 아래와 같다.


App Store Icon

  • 512x512 (scaled down to 175x175 for display in the store)

Application Icon

  • 114x114 (iPhone 4)
  • 57x57 (older iPhones)
  • 72x72 (iPad)

Spotlight Search Results and Settings Icon

  • 58x58 (iPhone 4)
  • 50x50 (Spotlight results for iPad)
  • 29x29 (settings for iPad and older iPhones)

Document Icon

This is a new icon type in iOS 4. It’s used if your app creates a custom document type. The iPad uses the document icon in two different sizes.

  • 320x320 (iPad)
  • 64x64 (iPad)
  • 44x58 (iPhone 4)
  • 22x29 (older iPhones)

http://www.microsoft.com/download/en/details.aspx?id=18140

 Microsoft Remote Desktop Connection Client for Mac 2.1.1

Mac에서 원격으로 윈도우즈에 접속할 수 있게 해주는 프로그램입니다. 

그런데 사용해보니 한영 전환이 키보드로 안되네요.  이거 안되면 불편해서 못쓰죠.

윈도우즈에 키보드3번을 설치해서 shift-space로 전환을 하게 하면 가능할지 나중에 해봐야겠습니다. 

Recently I opened a fairly old xCode project in xCode 4.0 and received the following error

error: Illegal Configuration: Pattern colors on iOS versions prior to 3.0

The error is due to incompatibilities with older nib/xib files prior to version 3.0

To fix the error or make the warning go away change the Deployment type in theInterface Builder Document settings below:

Interface Builder Document i os 2.2

Setting this to 3.0 or above will fix the error, the why’s and where for’s are beyond me and to be honest I don’t care as long as the little red triangles go xCode is happy and so I am happy.


출처 : http://lambert.tistory.com/416

최근에 기업용 아이폰 앱을 In-house 방식으로 배포해 보았다. 엔터프라이즈 계정의 경우 iTunes, iPhone Configuration Utility 또는, 지금 이야기하려는, In-house 방식으로 앱을 배포할 수 있다. 이 방식들 중 In-hous를 통한 배포 방식이 사용자가 접근하기 가장 쉬운 방법이 아닌 가 한다. 

이 것은 OTA(Over the Air)로 AdHoc 앱 배포하기(에서는 데스트 용이어서 프로파일 배포에 관애 언급을 안했는데 실제 배포를 위해서는 애드혹 배포 역시 프로파일이 필요하다.)와 거의 같고, 몇 가지 설정만 주의하면 된다. 애드혹 배포와 다른 점만 살펴 본다. 가장 큰 차이는 배포용 프로비저닝 프로파일을 같이 사용해야 한다는 것이다. 자세한 내용은 Distributing Enterprise Apps for iOS 4 Devices의 내용을 참고 하라.

1. Share Archived Application 설정
다음 그림과 같이  Share Archived Application 설정 시, Distribute for Enterprise...을 선택한다. 물론 배포용 프로비저닝 프로파일을 선택하고...


그리고 이어 나타나는 세부 설정 항목에 관련 내용을 채운다. 물론 애드혹 배포와 다른 점은 없다. 다만 앱 배포 시 사용할 아이콘(사전 준비!)들을 설정해 준다. 물론 해당 웹서버의 URL을 사용한다. 설정을 끝낸 후, 저장위치를 선택하여 실제 생성하려는 앱의 이름을 입력하면 *.ipa와 *.plist 파일이 생성될 것이다.


2. 웹서버에 배포용 페이지 준비
위에서 언급했듯이, 이 때 OTA(Over the Air)로 AdHoc 앱 배포하기 차이가 있다. 다음 그림과 같이 두 개의 링크가 필요하다. 하나는 프로비저닝 프로파일을 위한 것이고 다른 하나는 앱의 다운로드를 위한 것이다.



<a href="http://192.168.0.46:8080/inhouse/MyApp.mobileprovision">Install Provisioning Profile</a>

<a href="itms-services://?action=download-manifest&url=http://192.168.0.46:8080/inhouse/MyApp.plist">클릭하시면 MyApp. 앱을 설치하실 수 있습니다.</a>

이 외에도 Distributing Enterprise Apps for iOS 4 Devices 배포 시 다음과 같은 사실에 주의해야 한다.
  • 배포 인증서 만료에 맞춰 1년에 한 번씩 업데이트(최소)
  • 앱 업그레이드 시 기존 데이터를 유지하기위해서는 동일한 bundle-idenfier을 사용해야 한다.
  • oscp.apple.com과 ax.init.itunes.apple.com 서버들은 3 ~7일 동안만 캐시를 유지한다.(앱 런칭 시 해당 서버에 접속한다.)


tabbar 프로젝트로 시작해서
각 탭에 tableView를 넣는 것을 하다가 위와 같은 에러를 콘솔창에 찍고는 프로그램이 종료된다.
하루종일 고생끝에 구글에서 답을 찾았다.

클래스, xib 파일 모두 다 잘 셋팅이 되었다면 xCode 왼쪽아래 Targets 라고 되어 있는 곳을 열어서
모른다고 하는 클래스의 파일이 있는지 확인한다.

없다면 위쪽 코드부분에서 드래그해서 넣어준다.

그리고 실행하면 잘 된다. 

원래는 자동으로 넣어주어야 할 것 같은데 버그인지...
출처
http://ishimitsujin.blogspot.com/2011/03/id-sel.html

<호출하고자 하는 오브젝트 클래스>

interface에 다음과 같이 넣어두자.

id target;

SEL selector;


<호출하는 오브젝트 클래스>

- (void) example {

SampleObj* obj = [[SampleObj alloc] init];

obj.target = self;

obj.selector = @selector(callbackFunc);

//or

obj.selector = @selector(callbackFunc:);// 변수를 받을때 ":"를 반드시 붙여야함.!!!

...

}

- (void) callbackFunc {

}

//or

- (void) callbackFunc:(id)sender {


}


//sampleObject에서의 처리.

if([self.target respondsToSelector:self.selector]) {// 응답할수 있는지 체크하고.

[self.target performSelector: self.selector]; // 부른다.

//or

[self.target performSelector: self.selector withObject:@"아무거나..배열도되고 스트링도 되고."]; // 오브젝트를 변수로 넣어서 부른다.

}


출처

http://ishimitsujin.blogspot.com/2011/03/https.html

아이폰개발: https로 요청하기....

요청하기....

NSURL *url;

NSMutableURLRequest *request;

NSURLConnection *connection;

//NSString *httpBody;

//URL reques 할당.

url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@", AUTHENTICATION_URL, phoneNumberFld.text]];

request = [[NSMutableURLRequest alloc] initWithURL: url];

connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];

[connection release];

[request release];


델리게이트에선....

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data

{

//NSLog(@"did receivedata [%@]byte",[NSString stringWithUTF8String:(const char*)[data bytes]]);

//if([data length] > 0)

[responseData appendData:data];

}


- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response

{

NSLog(@"didReceiveResponse");

NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;

NSLog(@"Headers = [%@]", [httpResponse allHeaderFields]);

[responseData setLength:0];

}


- (void)connectionDidFinishLoading:(NSURLConnection *)connection

{

NSLog(@"connectionDidFinishLoading");

//JSON처리는 이쪽에서 행할것!

//NSString* recvString = [NSString stringWithUTF8String:(const char*)[responseData bytes]];

NSString *recvString = [[NSString alloc] initWithData:responseData

encoding:NSUTF8StringEncoding];


dispRecvData.text = [NSString stringWithFormat:@"", recvString];

[self checkJsonValue:dispRecvData.text];

}


- (void)connection:(NSURLConnection *)connection

didSendBodyData:(NSInteger)bytesWritten

totalBytesWritten:(NSInteger)totalBytesWritten

totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite

{

NSLog(@"didSendBodyData");

}

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error

{

NSLog(@"didFailWithError");

return;

}

// 나중에 필요하면 주석을 풀어 사용하세요.

//- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace {

// NSLog(@"canAuthenticateAgainstProtectionSpace");

// return [protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust];

//}


//인증처리가 필요해요!!!!

- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {

NSLog(@"didReceiveAuthenticationChallenge");

if ([challenge previousFailureCount] == 0) {

[[challenge sender] useCredential:[NSURLCredential credentialWithUser:KUSER password:KPASS persistence:NSURLCredentialPersistenceForSession] forAuthenticationChallenge:challenge];

} else {

[[challenge sender] cancelAuthenticationChallenge:challenge];

}

}


SFHFKeychainUtils 사용법
http://gorgando.com/blog/tag/sfhfkeychainutils

SFHFKeychainUtils 다운로드
https://github.com/ldandersen/scifihifi-iphone/tree/master/security/



Simple iPhone Tutorial: Password Management using the keychain by using SFHFKeychainUtils

May 23rd, 2010 admin 11 comments

Keychain is really a pain to use, and I didn’t want to spend the time to figure it all out, so I went looking for a framework that would do the dirty work for me. I found SFHFKeychainUtils and it has been super slick! In this tutorial, I’ll show you how to leverage SFHFKeychainUtils in order to save a username/password to keychain and also retrieve the password given the username. Just follow these simple steps:

1. Get SFHFKeychainUtils

I found it on GitHub at http://github.com/ldandersen/scifihifi-iphone/tree/master/security/ – just get the SFHFKeychainUtils.h and SFHFKeychainUtils.m files and add them to your project.

2. Import it

In the implementation file where you want to save or retrieve the password, be sure you import the SFHF Keychain Utils header file as shown below:

#import “LoginViewController.h”
#import “SFHFKeychainUtils.h”
@implementation LoginViewController

3. Save a Username/Password

xCode SFHFKeychainUtils iPhone Keychain Example





Here you can see how simple it is to add the username/password to the iPhone’s keychain. The storeUsername:andPassword:forServiceName:updateExisting:error method will take care of all the work for us if we give it the correct parameters. I am getting the username and password from two UITextFields in the app called usernameField and passwordField, respectively. The Service Name can be anything you want, as long as you remember it as you’ll need to enter that same string value in order to retrieve the password (see step 4).

4. Retrieve the Password from Keychain

xCode SFHFKeychainUtils iPhone Keychain Example




As you can see, it’s not any more difficult to retrieve the password from keychain using SFHFKeychainUtils. I specified my username “Gorgando” and the same service name we used before “myApp”. The password that corresponds to this username and service name in the keychain will be returned as an NSString.

So don’t be afraid to use the keychain! It is the most secure way to store passwords in an iPhone application. Both plists and the Settings.Bundle are very insecure ways to store passwords because the passwords are stored in plaintext, visible to anyone who accesses them. Let me know if you have any questions – good luck!

+ Recent posts