'iPhone'에 해당되는 글 23건
- 2010.08.05 [iPhone] AVFoundation 빌드오류에 관해
- 2010.07.31 [iPhone] Compass 구현하기
- 2010.07.10 [iPhone] iAd 붙여넣기
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
#import <XX.h>
#import <XXX.h>
@interface 클래스명 : 슈퍼클래스명 <CLLocationManagerDelegate>{
.....내용.....
}
- (void)viewDidLoad { //viewcontroller 라고 가정 CLLocationManager *locationManager=[[CLLocationManager alloc] init]; locationManager.delegate=self; locationManager.desiredAccuracy=kCLLocationAccuracyNearestTenMeters; [locationManager startUpdatingHeading];//heading값 호출 시작
.....내용.....
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading{
headingData = newHeading.magneticHeading;//heading 값 중 자기장 값 가져오기
NSLog(@"Magnetic heading value : %f", headingData);//로그로 확인
...기타 추가 구현....
}
- (void)bannerViewDidLoadAd:(ADBannerView *)banner
{
if (!self.bannerIsVisible)
{
NSLog(@"bannerViewDidLoadAd -----");
[UIView beginAnimations:@"animateAdBannerOn" context:NULL];
// assumes the banner view is offset 50 pixels so that it is not visible.
banner.frame = CGRectOffset(banner.frame, 0, 50);//50
[UIView commitAnimations];
self.bannerIsVisible = YES;
}
}
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{//NSLog(@"didFailToReceiveAdWithError");
if (self.bannerIsVisible)
{
NSLog(@"didFailToReceiveAdWithError");
[UIView beginAnimations:@"animateAdBannerOff" context:NULL];
// assumes the banner view is at the top of the screen.
banner.frame = CGRectOffset(banner.frame, 0, -50);//-50);
[UIView commitAnimations];
self.bannerIsVisible = NO;
}
}