ios优酷无法缓存api中视屏怎么才能在iOS中播放

新手求指导。ios App应用程序开发中。我想给应用添加支付功能应该怎么做。需要使用第三方api或_百度知道
新手求指导。ios App应用程序开发中。我想给应用添加支付功能应该怎么做。需要使用第三方api或
手求指导。需要使用第三方api或者第三方框架吗。ios App应用程序开发中。我想给应用添加支付功能应该怎么做
我有更好的答案
按默认排序
os 有自己的支付系统IAP,还有很多第三方支付,如支付宝,银联
要么支付宝 SDK 要么走AIP
用银联支付或者支付宝的ios版sdk
其他类似问题
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁视频: Kik API demo - Sketchee
分享给好友
您需要先安装&,才能下载视频哦
用优酷App或微信扫一扫,在手机上继续观看。
Kik API demo - Sketchee
分享给站外好友
把视频贴到Blog或BBS
flash地址:
<input type="text" class="form_input form_input_s" id="link3" value=''>
<input id="link4" type="text" class="form_input form_input_s" value=''>
Kik API demo - Sketchee
节目制作经营许可证京字670号
京公网安备号
药品服务许可证(京)-经营-发表给力评论!看新闻,说两句。
ctrl+enter快捷提交
发表给力评论!看新闻,说两句。
ctrl+enter快捷提交
发表给力评论!看新闻,说两句。
ctrl+enter快捷提交
48小时点击排行程序写累了,就来玩玩酷跑小游戏吧,嘿嘿。
雨松MOMO送你一首歌曲,嘿嘿。
IOS研究院之使用谷歌地图API在IOS设备上定位到自己(七)
IOS研究院之使用谷歌地图API在IOS设备上定位到自己(七)
围观7956次
编辑日期: 字体:
这两天抽时间学习了一下IOS下谷歌地图的API
现在很多APP中都会使用谷歌的地图。 个人觉得开发起来还是非常的便利的。废话不多说啦,赶快进入今天的正题。如下所示 这是MOMO的手机,这个项目我是在iPhone上调试的,这正是我的手机,模拟器上我没有试过,模拟器肯定是能打开谷歌地图的,但是好像不能定位地点。大家仔细看我下面的代码描述,其实很简单 真的很简单。本来今天晚上不像写这篇博文的,只是今天的北京雨下的太大了,困住了我回家的路,既然困在了公司那么当然要学习一下啦哈哈哈哈哈哈哈哈哈~~~
OK下面是代码片段。
创建一个工程,如下图所示,先将CoreLocation.framework 和 MapKit.framework
引入工程中,前者是负责定位的,后者是负责地图的。
AppDelegate.h
入口类,没什么好说的我就不解释了。
#import &UIKit/UIKit.h&#import "MapViewController.h"&@interface AppDelegate : UIResponder &UIApplicationDelegate&&@property (strong, nonatomic) UIWindow *window;@property (strong, nonatomic) UINavigationController *navController;@property (strong, nonatomic) UIViewController *viewController;@end
AppDelegate.m
12345678910111213141516171819202122232425262728
#import "AppDelegate.h"&@implementation AppDelegate&@synthesize window = _window;@synthesize navController;@synthesize viewController;&- (void)dealloc{&&&&[_window release];&&&&[super dealloc];}&- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{&&&&self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];&&&&&self.window.backgroundColor = [UIColor whiteColor];&&&&self.viewController =&&[[MapViewController alloc]init];&&&&self.navController = [[UINavigationController alloc] initWithRootViewController:self.viewController];&&&&[self.window addSubview:navController.view];&&&&&[self.window makeKeyAndVisible];&&&&return YES;}&@end
主要的东东都写在MapViewController中,请大家仔细看这里。
MapViewController.h
123456789101112131415
#import &UIKit/UIKit.h&#import &MapKit/MKReverseGeocoder.h&#import &CoreLocation/CoreLocation.h&#import &MapKit/MapKit.h&&@interface MapViewController : UIViewController&CLLocationManagerDelegate,MKMapViewDelegate&{&&& //地图视图, 谷歌地图将加载在这个视图中喔&& MKMapView *myMapView ;&& //地图定位管理器&& CLLocationManager *_locManager ;}&@end
MapViewController.m 注意看这个类噢。
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
#import "MapViewController.h"&@implementation MapViewController&- (void)dealloc{&&&&[_locManager release];&&&&[super dealloc];}&- (void)viewDidLoad{&&&&&[super viewDidLoad];&&&&& self.navigationItem.title&&= @"雨松MOMO";&&&&&
myMapView = [[[MKMapView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)] autorelease]; myMapView.delegate = self;&&&&//在这里先让地图视图隐藏起来,&&&&//等获取当前经纬度完成后在把整个地图显示出来&&&&myMapView.hidden = true;&&&&[self.view addSubview:myMapView];&&&&&//创建定位管理器,&&&&_locManager = [[CLLocationManager alloc] init];&&&&[_locManager setDelegate:self];&&&&[_locManager setDesiredAccuracy:kCLLocationAccuracyBest];&& &}&-(void) viewWillAppear:(BOOL)animated{&&&&&[super viewWillAppear:animated];&&&&&//开始使用手机定位,这是一个回调方法,&&&&//一旦定位完成后程序将进入&&&&//- (void)locationManager:(CLLocationManager *)manager&&&&//didUpdateToLocation:(CLLocation *)newLocation&&&&//fromLocation:(CLLocation *)oldLocation&&&&//方法中&&&&&[_locManager startUpdatingLocation];&}&//定位成功后将进入此方法- (void)locationManager:(CLLocationManager *)manager&&&&didUpdateToLocation:(CLLocation *)newLocation&&&&&&&&&& fromLocation:(CLLocation *)oldLocation{&&&&&//得到当前定位后的经纬度,当前经纬度是有一定偏移量的,&&&&//使用另一种方法可以很好的解决这个问题&&&&CLLocationCoordinate2D loc = [newLocation coordinate];&&&&float lat =&&loc.latitude;&&&&float lon = loc.longitude;&&&&&//让MapView使用定位功能。&&&&myMapView.showsUserLocation =YES;&&&&&//更新地址,&&&&[manager stopUpdatingLocation]; &&&&&//设置定位后的自定义图标。&&&&MKCircle* circle = [MKCircle circleWithCenterCoordinate:CLLocationCoordinate2DMake(myMapView.userLocation.location.coordinate.latitude, myMapView.userLocation.location.coordinate.longitude) radius:5000];&&&&&//一定要使用addAnnotation 方法把MKCircle加入进视图,&&&&// 否则下面刷新图标的方法是永远不会进入的 - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id &MKAnnotation&)&&&&//切记!!!!&&&&[myMapView addAnnotation:circle];&&&&& //我们需要通过当前用户的经纬度换成出它现在在地图中的地名&&&& CLGeocoder *geocoder = [[[CLGeocoder alloc] init] autorelease];&&&&[geocoder reverseGeocodeLocation: _locManager.location completionHandler:&&&& ^(NSArray *placemarks, NSError *error) {&&&&&&&&& //得到自己当前最近的地名&&&&&&&& CLPlacemark *placemark = [placemarks objectAtIndex:0];&&&&&&&&& NSString *locatedAt = [[placemark.addressDictionary valueForKey:@"FormattedAddressLines"] componentsJoinedByString:@", "];&&&&&&&&& //locatedAt就是当前我所在的街道名称&&&&&&&& //上图中的中国北京市朝阳区慧中北路&&&&&&&& [myMapView.userLocation setTitle:locatedAt];&&&&&&&& [myMapView.userLocation setSubtitle:@"雨松MOMO在这里噢"]; &&&&&&&&& //这里是设置地图的缩放,如果不设置缩放地图就非常的尴尬,&&&&&&&& //只能光秃秃的显示中国的大地图,但是我们需要更加精确到当前所在的街道,&&&&&&&& //那么就需要设置地图的缩放。&&&&&&&& MKCoordinateRegion theRegion = { {0.0, 0.0 }, { 0.0, 0.0 } };&&&&&&&& theRegion.center= myMapView.userLocation.location.coordinate;&&&&&&&&& //缩放的精度。数值越小约精准&&&&&&&& theRegion.span.longitudeDelta = 0.01f;&&&&&&&& theRegion.span.latitudeDelta = 0.01f;&&&&&&&& //让MapView显示缩放后的地图。&&&&&&&& [myMapView setRegion:theRegion animated:YES]; &&&&&&&&& //最后让MapView整体显示, 因为截至到这里,我们已经拿到用户的经纬度,&&&&&&&& //并且已经换算出用户当前所在街道的名称。&&&&&&&& myMapView.hidden = false;&&&& }];&}&//定位失败后将进入此方法- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {&&&&&&&if ( [error code] == kCLErrorDenied )&&&&{&&&&&&&&&&&//第一次安装含有定位功能的软件时&&&&&&&&//程序将自定提示用户是否让当前App打开定位功能,&&&&&&&&//如果这里选择不打开定位功能,&&&&&&&&//再次调用定位的方法将会失败,并且进到这里。&&&&&&&&//除非用户在设置页面中重新对该软件打开定位服务,&&&&&&&&//否则程序将一直进到这里。&&&&&&&&UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"定位服务已经关闭"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&message:@"请您在设置页面中打开本软件的定位服务"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];&&&&&&&&[alert show];&&&&&&&&[alert release];&&&&&&&&[manager stopUpdatingHeading];&&&&}&&&&else if ([error code] == kCLErrorHeadingFailure)&&&&{&&&&&&&}}&&&//在这里我们设置自定义图标来 标志当前我在地图的地方- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id &MKAnnotation&)annotation;{&&&&static NSString *identifier = @"com.xys.momo";&&&&&MKAnnotationView *pin = [ mapView dequeueReusableAnnotationViewWithIdentifier:identifier ];&&&&if ( !pin )&&&&{&&&&&&&&&&&&&pin = [ [ MKAnnotationView alloc ] initWithAnnotation:annotation reuseIdentifier:identifier ];&&&&&&&&&&&&//随便加载了一张ICON&&&&&&&&&&&&//我的icon的大小是48X48 大家可根据仔细的喜好制定自己的icon&&&&&&&&&&&&pin.image = [ UIImage imageNamed:@"0.jpg" ];&&&&&&&&&&&&&//在图中我们可以看到图标的上方,有个气泡弹窗里面写着当前用户的位置所在地&&&&&&&&&&&&//原因是这里需要设置了True&&&&&&&&&&&&pin.canShowCallout=YES;&&&&&&&&&&&&//上图气泡的右侧还有一个带箭头的小按钮&&&&&&&&&&&&//这个按钮就是在这里创建的,不过MOMO目前没有写按钮的响应事件喔。&&&&&&&&&&&&//细心的朋友可以自己加上。&&&&&&&&&&&&UIButton *btn = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];&&&&&&&&&&&&pin.rightCalloutAccessoryView=btn;&&&&}&&&&&pin.annotation = annotation;&&&&&return pin;&}&- (void)viewDidUnload{&&&&[super viewDidUnload];&&&&// Release any retained subviews of the main view.}&- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{&&&&return (interfaceOrientation == UIInterfaceOrientationPortrait);}&@end
最后是本文的源码下载:
雨松MOMO祝大家学习愉快、工作愉快、生活愉快、互相学习与进步,加油~
话说北京这会应该不下雨了吧??雨停了回家睡觉。 嚯嚯!
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-华丽的分割线&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
以上方法我在IOS6中使用发现了一点小问题,IOS6使用CLLocationManager定位的时候发现有时候定位到的经纬度是0.0000 所以地图界面中就是一个白屏。那么我将解决的办法贴出来。
//定位成功后将进入此方法- (void)locationManager:(CLLocationManager *)manager&&&&didUpdateToLocation:(CLLocation *)newLocation&&&&&&&&&& fromLocation:(CLLocation *)oldLocation{&&&&&&&&&myMapView.showsUserLocation =YES;&}
用这个方法来接受当前地图经纬度信息
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation{&&&&&//更新地址,&&&&[_locManager stopUpdatingLocation];&&&&&//设置定位后的自定义图标。&&&&MKCircle* circle = [MKCircle circleWithCenterCoordinate:CLLocationCoordinate2DMake(myMapView.userLocation.location.coordinate.latitude, myMapView.userLocation.location.coordinate.longitude) radius:5000];&&&&&[myMapView addAnnotation:circle];&&&&&NSLog(@"%f",myMapView.userLocation.location.coordinate.latitude);&&&&&//我们需要通过当前用户的经纬度换成出它现在在地图中的地名&&&&CLGeocoder *geocoder = [[[CLGeocoder alloc] init] autorelease];&&&&[geocoder reverseGeocodeLocation: _locManager.location completionHandler:&&&& ^(NSArray *placemarks, NSError *error) {&&&&&&&&& //得到自己当前最近的地名&&&&&&&& CLPlacemark *placemark = [placemarks objectAtIndex:0];&&&&&&&&& NSString *locatedAt = [[placemark.addressDictionary valueForKey:@"FormattedAddressLines"] componentsJoinedByString:@", "];&&&&&&&&& //locatedAt就是当前我所在的街道名称&&&&&&&& //上图中的中国北京市朝阳区慧中北路&&&&&&&& [myMapView.userLocation setTitle:locatedAt];&&&&&&&& [myMapView.userLocation setSubtitle:@"你在这里噢"];&&&&&&&&& nowLatitude = myMapView.userLocation.location.coordinate.latitude;&&&&&&&& nowLongitude = myMapView.userLocation.location.coordinate.longitude;&&&&&&&&& //这里是设置地图的缩放,如果不设置缩放地图就非常的尴尬,&&&&&&&& //只能光秃秃的显示中国的大地图,但是我们需要更加精确到当前所在的街道,&&&&&&&& //那么就需要设置地图的缩放。&&&&&&&& MKCoordinateRegion theRegion = { {0.0, 0.0 }, { 0.0, 0.0 } };&&&&&&&& theRegion.center= myMapView.userLocation.location.coordinate;&&&&&&&&& //theRegion.center.latitude = targetL&&&&&&&& //theRegion.center.longitude = argetL&&&&&&&&& //缩放的精度。数值越小约精准&&&&&&&& theRegion.span.longitudeDelta = 0.01f;&&&&&&&& theRegion.span.latitudeDelta = 0.01f;&&&&&&&& //让MapView显示缩放后的地图。&&&&&&&& [myMapView setRegion:theRegion animated:YES];&&&&&&&&& //最后让MapView整体显示, 因为截至到这里,我们已经拿到用户的经纬度,&&&&&&&& //并且已经换算出用户当前所在街道的名称。&&&&&&&& //myMapView.hidden =&&&& }];&}
本文固定链接:
转载请注明:
MOMO与MO嫂提醒您:亲,如果您觉得本文不错,快快将这篇文章分享出去吧 。另外请点击网站顶部彩色广告或者捐赠支持本站发展,谢谢!
作者:雨松MOMO
专注移动互联网,Unity3D游戏开发
如果您愿意花10块钱请我喝一杯咖啡的话,请用手机扫描二维码即可通过支付宝直接向我捐款哦。
您可能还会对这些文章感兴趣!苹果将在iOS 5中整合脸部识别技术 开放API接口
  【搜狐IT消息】北京时间7月26日消息,据国外媒体报道,科技博客网站9to5mac发现,苹果将在iOS 5操作系统中整合脸部识别技术。
  苹果去年收购了瑞典一家名为Polar Rose的脸部识别软件公司。
  苹果没有明确宣布将推出一款依赖其脸部识别技术的iOS 5应用,但计划以更重要的方式利用脸部识别技术:发布iOS 5脸部识别API(应用编程接口)。这将为开发者方便地使用脸部识别技术奠定基础。
  iOS 5的第一个脸部识别技术API名为CIFaceFeature,能通过图像判断一个人的嘴和眼的位置;第二个API名为CIDetector,负责处理图像识别工作。
  苹果发布API将使开发者能更方便地使用脸部识别技术,这可能是苹果将开发某种新型iOS应用,充分利用脸部识别技术的一个信号。苹果可能将OS X Lion Photo Booth的脸部识别技术移植到iOS上。(阳光)(责任编辑:宿艺)
网友点击排行
网友评论排行
高清影视剧
成为全球第二大互联网公司..
移动新发现
近期热点关注}

我要回帖

更多关于 ios优酷无法缓存 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信