小编Cha*_*har的帖子

当你点击它与iphone电话簿一样时如何拨号?

我想在点击该号码(UIButton)时拨打一个号码,就像在iPhone电话簿中一样?

iphone

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

在iOS中应用程序处于后台时如何调用Method?

我有一个类名,因为myClassCalculate具有以下方法

- (void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {

NSLog(@"Accelerometer is called");

}
Run Code Online (Sandbox Code Playgroud)

我正在制作对象

    - (void)applicationDidFinishLaunching:(UIApplication *)application {    


    // Override point for customization after app launch
       myObject = [[myClassCalculate alloc] init];
Run Code Online (Sandbox Code Playgroud)

现在当应用程序进入后台时,我想要这个

    - (void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
Run Code Online (Sandbox Code Playgroud)

我该怎么做,以便在app后台调用此方法

谢谢

iphone accelerometer runloop

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

下载Git Clone时出错?

我正在打开终端,按如下方式编写命令

 git clone url
Run Code Online (Sandbox Code Playgroud)

它说是

Cloning into code.xyz.com...
Run Code Online (Sandbox Code Playgroud)

我收到了错误

    error: SSL certificate problem, verify that the CA cert is OK. Details:
    error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://code.xyz.com/info/refs

    fatal: HTTP request failed
Run Code Online (Sandbox Code Playgroud)

我使用的是Mac OS X 10.7,任何人都可以指导我应该怎么做,我有正确的用户名和密码,并且正确的网址?

git macos clone

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

UILabel如何看起来像UITableViewStyleGrouped?

我的UILabel怎么能像TableView的UITableViewStyleGrouped一样?

iphone uilabel

0
推荐指数
1
解决办法
159
查看次数

JSON 无效?

任何人都可以使这个 json 正确,我正在JSON 在线验证器中插入 json

收到 json 无效的错误,这个 json 中有什么错误,我怎样才能使它正确,请不要提供其他教程的链接,谢谢

{
    mothmap: {
        value: [{
            longitude: -0.13025200000004133,
            latitude: 51.4596619
        }, {
            longitude: -2.707384100000013,
            latitude: 53.7613383
        }]
    }
 }
Run Code Online (Sandbox Code Playgroud)

json

0
推荐指数
1
解决办法
3万
查看次数

如何从superView中删除View?

我做了一个xib并通过以下代码在视图中显示它.

    NSArray *xibContents = 
        [[NSBundle mainBundle] loadNibNamed:@"PickupAddressView"
            owner:self 
            options:nil];

    UIView *view = [xibContents objectAtIndex:0]; // Safer than objectAtIndex:0
    //UIView *subView=[view.subviews objectAtIndex:0];

    [view setFrame:CGRectMake(0.0f, 0.0f, 0.0f, 0.0f)];
    CGRect tempFrame=view.frame;
    tempFrame.size.width=300;//change acco. how much you want to expand
    tempFrame.size.height=350;
    [UIView beginAnimations:@"" context:nil];
    [UIView setAnimationDuration:0.2];
    view.frame=tempFrame;
    //[UIView commitAnimations];
    [view setFrame:CGRectMake(10.0f, 90.0f, 300.0f, 350.0f)];
    [view setBackgroundColor:
      [UIColor colorWithPatternImage:
        [UIImage imageNamed:@"Register_bg"]]];
    [UIView commitAnimations];

    [view removeFromSuperview];
    [self.view addSubview:view];
Run Code Online (Sandbox Code Playgroud)

我正在使用UIStoryboard,并xib通过以下代码制作并显示.

如何删除此视图.我有一个UIButton,IBAction被称为.

谢谢

objective-c storyboard xib superview ios

0
推荐指数
1
解决办法
6147
查看次数

如何在 Objective C 中使用 for 循环对 NSNumber 的可变数组进行排序?

我试过这个,但我没有成功。任何人都可以解决这个问题吗?

 NSNumber *num1= [NSNumber numberWithInt:5];
    NSNumber *num2= [NSNumber numberWithInt:3];
    NSNumber *num3= [NSNumber numberWithInt:7];
    NSNumber *num4= [NSNumber numberWithInt:9];
    NSNumber *num5= [NSNumber numberWithInt:2];



    NSMutableArray *array =[NSMutableArray arrayWithObjects:num1,num2,num3,num4,num5, nil];

    int numLength = [array count];

    int tempValue;

    for (int i = 0; i < numLength; i++)
    {
        for(int j = 0; j < numLength; j++)
        {
            NSNumber *temp=[array objectAtIndex:i];
            int first =[temp integerValue];

            NSNumber *temp1=[array objectAtIndex:j+1];
            int second =[temp1 integerValue];

            if(first > second)

            {
                tempValue = second;

                [array replaceObjectAtIndex:j+1 withObject:temp];
                [array replaceObjectAtIndex:i withObject:temp1];

            } …
Run Code Online (Sandbox Code Playgroud)

sorting loops objective-c ios

-1
推荐指数
1
解决办法
885
查看次数