- 浏览: 46769 次
- 性别:
- 来自: 石家庄
-
最新评论
文章列表
hello World
- 博客分类:
- ios使用百度地图
1、前期工作
注册百度开发者帐号
生成密钥
下载百度地图api
在xcode进行配置
2、让百度地图跑起
在程序的AppDelegate代码如下:
manger = [[BMKMapManageralloc]init
];
self.controller = [[ViewController alloc]init];
self.window = [[UIWindow alloc]initWithFrame:[[UIScreen main ...
UnderSource.m的用法
- 博客分类:
- ios开源库用法
可以使用CocoaPods在github上下载源码,这个库擅长处理从Web API上请求的数据,用法如下:
NSURL *twitterSearch = [NSURLURLWithString:@"http://api.douban.com/v2/book/search?tag=computer"];
NSData *data = [NSData dataWithContentsOfURL:twitterSearch];
NSDictionary *json = [NSJSONSerializationJSONObjectWithDa ...
在plist文件中 将Supported interface orientations这个条目的所有子项设置为Portrait (bottom home button)
JPush实现APNS推送
- 博客分类:
- APNS推送
前期工作:
1、一部苹果设备,iphone或者itouch
2、苹果开发者
3、在https://www.jpush.cn/注册jpush
证书
1、在开发者中心申请AppID,下载生成的证书,双击安装后,在到钥匙串导出。
2、在设备上安装provisioning prodfile,选择刚才生成的AppID,选择设备后下载双击安装到手机,这样我们就能获取设备的devoiceToken了。
3、下载jpush的SDK并导入到工程。
4、创建PushConfig.plist文件,里面有三个key-value如下
ios程序调用googlemap
- 博客分类:
- 苹果地图
代码
- (void)callGoogleMap :(NSString*)place
{
CLGeocoder *gencoder = [[CLGeocoder alloc]init];
[gencoder geocodeAddressString:place completionHandler:^(NSArray *placemarks,NSError *error){
//编码结束后返回的是CLPlacemark实例的集合
CLPlacemark *placemark = placemarks[0 ...
在ios程序中调用苹果地图
- 博客分类:
- 苹果地图
上代码
- (void)callAppleMap :(NSString*)place
{
CLGeocoder *gencoder = [[CLGeocoder alloc]init];
[gencoder geocodeAddressString:place completionHandler:^(NSArray *placemarks,NSError *error){
//编码结束后返回的是CLPlacemark实例的集合
CLPlacemark *placemark = placemarks[0];
...
苹果地图跟踪用户位置变化
- 博客分类:
- 苹果地图
用到的类 MKMapView
设置MKMapView实例的一些属性,并且指定的伪托就可以进行用户的位置跟踪
这些属性是
_mapView.showsUserLocation = YES; //是否允许进行位置跟踪
[_mapViewsetUserTrackingMode:MKUserTrackingModeFollowWithHeadinganimated:YES];//位置跟踪模式
需要实现的委托是
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUs ...
用到的类 CLGeocoder,用到的函数geocodeAddressString
上代码
- (void)encodeAddressToCoordinate :(NSString*)address
{
CLGeocoder *encoder = [[CLGeocoder alloc]init];
[encoder geocodeAddressString:address completionHandler:^(NSArray *placemarks,NSError *error){
CLPlacemark *placema ...
直接上代码
头文件
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#import <AddressBook/AddressBook.h>
@interface ViewController : UIViewController<CLLocationManagerDelegate>
{
CLLocationManager *locationManger;
}
@end
.m文件
//
// ViewC ...