– (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control { MKPointAnnotation* pin = (MKPointAnnotation*)view.annotation; CLLocationCoordinate2D endingCoord = CLLocationCoordinate2DMake(pin.coordinate.latitude, pin.coordinate.longitude); MKPlacemark *endLocation = [[MKPlacemark alloc] initWithCoordinate:endingCoord addressDictionary:nil]; MKMapItem *endingItem = [[MKMapItem alloc] initWithPlacemark:endLocation];Read More →

파일 공유를 위해 share 버튼을 추가한다. UIBarButtonItem *openBtn = [[UIBarButtonItem alloc] initWithTitle:@”Open..” style:UIBarButtonItemStylePlain target:self action:@selector(showFileList:)]; self.shareBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(share:)]; self.navigationItem.leftBarButtonItems = @[openBtn, self.shareBtn];   -(IBAction)share:(id)sender { NSURLRead More →

{ “size” : “29×29”, “idiom” : “iphone”, “filename” : “icon_58x58.png”, “scale” : “2x” }, { “size” : “40×40”, “idiom” : “iphone”, “filename” : “icon_80x80-1.png”, “scale” : “2x” }, { “size”Read More →

몇몇 상황에서 iOS 개발이 안드로이드보다 불편할 때가 있는데, 그 중에 하나가 입력란이 키보드에 가려질 때이다. 안드로이드는 시스템에서 알아서 처리해주는데, iOS는 일일이 바꿔줘야한다. 찾아보니 애플에서 제공해주는 소스가 있는데, 동작을 안한다 -_-Read More →

iAd 프레임웍을 추가한다     #import <iAd/iAd.h> … <ADBannerViewDelegate> #pragma mark – iAD -(void)bannerViewDidLoadAd:(ADBannerView *)banner { [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1]; [banner setAlpha:1]; [UIView commitAnimations]; } – (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSErrorRead More →

#import <Social/Social.h> SLComposeViewController *sheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter]; sheet.view.hidden = YES; [_mainViewController presentViewController:sheet animated:YES completion:^{ [_mainViewController dismissViewControllerAnimated:NO completion:nil]; // hide keyboard }];   출처 : http://stackoverflow.com/questions/18982612/twtweetcomposeviewcontroller-alerts-with-no-twitter-accounts-foundRead More →

트위터 API 이용해서 유저 정보를 가져오면 중간 크기의 이미지가 온다. “profile_image_url” = “http://pbs.twimg.com/profile_images/2624611971/image_normal.jpg”; 이러면 흐릿한 이미지가 오는데, https://dev.twitter.com/docs/user-profile-images-and-banners 에 가보니까 그냥 뒤에 _normal만 지우면 되더라. http://pbs.twimg.com/profile_images/2624611971/image_normal.jpg 를 http://pbs.twimg.com/profile_images/2624611971/image.jpg 로 바꾸면 큰Read More →

#import “ViewController.h” #import “SecondViewController.h” @interface ViewController () @property UIWindow *extWindow; @end @implementation ViewController – (void)viewDidLoad { [super viewDidLoad]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidConnect:) name:UIScreenDidConnectNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidDisconnect:) name:UIScreenDidDisconnectNotification object:nil];Read More →