小编Sid*_*th 的帖子

解雇数字垫

在我的应用程序中,我有一个文本字段,从用户输入一些数字,所以我将键盘类型设置为"数字键盘"但现在我被困在如何用户完成输入时我应该解雇它.我知道我必须使用委托方法"textfieldShouldReturn",但问题是数字键盘没有返回键.所以是否有必要在键盘上添加自定义完成键或还有其他方法?

iphone objective-c interface-builder uitextfield

9
推荐指数
2
解决办法
1万
查看次数

以数字形式在UILabel上显示文本?

我们如何在UILabel上以数字格式显示文本(七段显示),类似于数字时钟中显示文本的方式.

iphone user-interface cocoa-touch objective-c

5
推荐指数
1
解决办法
6517
查看次数

Corelocation错误的距离

我正在开发一个计算用户行进距离的应用程序.我正在使用CLLocationManager类来执行此操作,但我最初获取缓存数据,并且距离变量也以突然的速率增加.请帮帮我...我用过以下代码....

注意:距离是静态变量.这里

  - (void)viewDidLoad {
    [super viewDidLoad];
//bestEffortAtLocation = nil;
oldLocat = [[CLLocation alloc]init];
newLocat = [[CLLocation alloc]init];
locationManager =[[CLLocationManager alloc]init];
locationManager.delegate = self;
locationManager.distanceFilter =  kCLDistanceFilterNone;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[locationManager startUpdatingLocation];

  }

- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
       fromLocation:(CLLocation *)oldLocation{




// test that the horizontal accuracy does not indicate an invalid measurement
if (newLocation.horizontalAccuracy < 0) return;


NSLog(@"accuracy %d",newLocation.horizontalAccuracy);

// test the age of the location measurement to determine if the measurement is cached
// in most cases you will …
Run Code Online (Sandbox Code Playgroud)

iphone xcode objective-c core-location cllocationmanager

4
推荐指数
1
解决办法
3229
查看次数