小编Par*_*att的帖子

如何在iPhone中创建链接按钮?

在此输入图像描述

在上图中,像婴儿一样睡觉link button.

我不想放置一个,UITextView因为这只是打开了一个pickerView

如何link button在iPhone中创建类似的类型?

iphone cocoa-touch objective-c uibutton ios4

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

- [NSDateFormatter dateFromString:]返回nil

    NSString *lower = [NSString stringWithFormat:@"%@",[newDates objectAtIndex:0]];
    NSString *higher = [NSString stringWithFormat:@"%@",[newDates objectAtIndex:[newDates count]-1]];
    NSLog(@"%@",lower);
    NSLog(@"%@",higher);

    NSDateFormatter *df = [[NSDateFormatter alloc] init];
    [df setDateFormat:@"yyyy-MM-dd"];
    NSDate *dtLower = [df dateFromString:lower];

    NSDate *dtHigher = [df dateFromString:higher];
    [df release];
    NSDateFormatter *df1 = [[NSDateFormatter alloc] init];
    [df1 setDateFormat:@"yyyy-MM-dd"];
    NSString * lowerDate = [df1 stringFromDate:dtLower];
    NSString * higherDate = [df1 stringFromDate:dtHigher];
    UILabel *dateLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 31, self.view.frame.size.width, 30)];
    [dateLabel setTextColor:[UIColor grayColor]];
    dateLabel.text = [NSString stringWithFormat:@"%@ - %@",lowerDate,higherDate];
    [self.view addSubview:dateLabel];
Run Code Online (Sandbox Code Playgroud)

控制台的输出lower和输出higher是: …

cocoa-touch objective-c nsdateformatter ios

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

如何在appdelegate上查看横向和纵向模式?

我想在横向和纵向模式下运行应用程序,

如何在Appdelegate上查看横向和纵向模式?

我试着打电话

- (BOOL) isPad{ 
#ifdef UI_USER_INTERFACE_IDIOM
    return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
#else
    return NO;
#endif
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    if ([self isPad]) {
        NSLog(@"is pad method call");
        return YES;
    }
    else 
    {
        return UIInterfaceOrientationIsPortrait(interfaceOrientation);
    }

}



- (BOOL)isPadPortrait
{

    return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad
            && (self.interfaceOrientation == UIInterfaceOrientationPortrait
                || self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown));
}


- (BOOL)isPadLandscape
{

    return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad
            && (self.interfaceOrientation == UIInterfaceOrientationLandscapeRight
                || self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft));

}
Run Code Online (Sandbox Code Playgroud)

但是在appdelegate类型的对象上找不到错误属性界面方向.

我怎样才能做到这一点?

iphone cocoa-touch objective-c ios4

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

如何在不使用AudioQueueRef的情况下在AudioQueue中设置音量?

如何在AudioQueue中设置音量而不使用AudioQueueRef?

我在StackOverflow上对此有很多疑问,但所有这些都使用了AudioQueueRef对象.

是否可以在不使用AudioQueueRef的情况下这样做?

请建议

谢谢.

iphone objective-c audioqueue ios

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

iOS设备未在Xcode中列出

我已经完成了临时配置文件,它在管理器中正确显示.Iphone设备也被列出,它旁边是一个绿色的小圆圈.

但是,在xcode中,设备未列出且无法挑选.

可能是什么问题.

iphone xcode

2
推荐指数
2
解决办法
6027
查看次数

如何在Enter键上关闭键盘

当我按下RETURN键时,我想解雇我的键盘.

我试过把按钮放在视图的背面.

但是如何通过按RETURN键来完成此操作?

iphone keyboard enter objective-c ios

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

如何禁用iphone相机自动闪光功能?

我想禁用相机闪光灯.

我怎样才能做到这一点?

任何帮助将不胜感激

iphone camera ios

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

无法从Xcode项目中删除启动图像

我在Xcode中添加了一个启动图像到我的iPhone应用程序,但过了一会儿,我意识到它不是正确的图像,所以我删除了它,但问题是,图像仍然显示在应用程序上.

我尝试过从头开始建造和清洁,但仍然没有运气.

任何帮助,将不胜感激.

iphone xcode splash-screen ipad ios

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

在NSArray中添加字符串元素

我有一个名为arrayout的可变字符串数组.它有3个元素.现在我想添加1个String元素array.But当我尝试添加时,它取空值....不能做什么...请帮助...

我的代码是:

       NSString *ds1 = @"--";
        [arrayout arrayByAddingObject:ds1];
        NSLog(@"arrrrr '%@'",arrayout);
Run Code Online (Sandbox Code Playgroud)

arrays iphone objective-c nsstring nsarray

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

jQuery-如何在一个ajax调用中调用多个ajax调用

在我的Javascript文件中,我有多个ajax调用,我想将所有ajax调用更改为一个ajax调用.这是我的示例JS代码.

var vpnPin = $.ajax({ 
  dataType: "json",
  url: "url",
  async: true,
  success: function(result) {}                     
});  //$.ajax() ends


var vpnDataPlan = $.ajax({ 
  dataType: "json",
  url: "url",
  async: true,
  success: function(result) {}  
});  //$.ajax() ends
Run Code Online (Sandbox Code Playgroud)

我们怎样才能将多个AJAX调用调用到一个AJAX调用?

ajax jquery

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