小编jay*_*dev的帖子

如何使用Swift中的归属字符串附加归因文本字符串

我想在Swift中附加一个Attributed Text和另一个Attributed Text.请提供任何示例代码,用于在Swift中附加两个属性String的操作.

nsattributedstring swift

48
推荐指数
3
解决办法
4万
查看次数

始终在iOS 7中获得唯一的设备ID

我们的iOS应用程序适用于特定用户.因此,我们使用设备唯一标识符进行用户识别.这种方法适用于iOS 6,因为我们每次都获得相同的值.

NSString *strUniqueIdentifier = [[UIDevice currentDevice] uniqueIdentifier];
Run Code Online (Sandbox Code Playgroud)

在iOS 7中,上述方法返回不同的值,我们在用户识别方面遇到问题.iOS 7提供以下备用.

NSUUID *oNSUUID = [[UIDevice currentDevice] identifierForVendor];
[strApplicationUUID setString:[oNSUUID UUIDString]];
Run Code Online (Sandbox Code Playgroud)

我们替换uniqueIdentifieridentifierForVendor,并创建了一个Ad-hoc构建.然后,我们在iOS 7和iOS 6设备上安装了构建版本.到目前为止,在iOS 7中,我们每次都获得相同的值,但iOS 6 每次删除并重新安装应用程序时都会给出不同的值.

iphone objective-c uniqueidentifier ios

31
推荐指数
3
解决办法
5万
查看次数

什么是此错误的解决方案: - 此API的请求必须通过SSL

我正在使用Google Place API获取两个城市之间的距离,但是当我通过http://maps.googleapis.com/maps/api/distancematrix/json?origins=dehli&destinations=pune&mode=bicycling&language=en-EN&sensor调用该服务时= true&key = AppKey服务提供此响应:

{

    "destination_addresses": [ ],
    "error_message": "Requests to this API must be over SSL.",
    "origin_addresses": [ ],
    "rows": [ ],
    "status": "REQUEST_DENIED"
}
Run Code Online (Sandbox Code Playgroud)

这个问题的解决方案是什么?

ssl google-places-api

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

数字键盘键盘在iPhone中不显示返回键

我是iPhone技术的新手.我在iPhone应用程序中保存了一个问题,但是当我使用textfield键盘类型数字键盘时,键盘没有显示返回/完成按钮.

在文本字段中输入数字后如何隐藏数字键盘键盘?你有什么解决方案吗?请提供帮助.

iphone ios-4.2

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

当用户收到错误或断开与XMPP的连接时,重新连接XMPP

我已经在XMPP框架的帮助下实现了一个聊天应用程序.但是我收到的错误显示如下:

xmpp did receive error:-
Printing description of error:
<stream:error xmlns:stream="http://etherx.jabber.org/streams"><conflict xmlns="urn:ietf:params:xml:ns:xmpp-streams"></conflict><text xmlns="urn:ietf:params:xml:ns:xmpp-streams" lang="">Replaced by new connection</text></stream>
Run Code Online (Sandbox Code Playgroud)

需要一些指导可能导致此错误的原因以及如何重新连接使用XMPP.

谢谢.

xmpp ios

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

在导航控制器类的类别中添加左右栏按钮项

我已经创建了一个类别的导航控制器和设置标题和左右按钮在视图中加载此导航控制器类(此类的类别).

- (void)viewDidAppear:(BOOL)animated
{

        NSArray *ver = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."];
        if ([[ver objectAtIndex:0] intValue] >= 7) {
            self.navigationBar.barTintColor = [UIColor colorWithRed:229.0f/255.0f green:114.0f/255.0f blue:89.0f/255.0f alpha:1.0f];
            self.navigationBar.translucent = NO;
        }else{
            self.navigationBar.tintColor = [UIColor colorWithRed:229.0f/255.0f green:114.0f/255.0f blue:89.0f/255.0f alpha:1.0f];
        }

        UILabel *lblTitleView=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 170, 44)];
        [lblTitleView setTextColor:[UIColor whiteColor]];
        [lblTitleView setFont:[UIFont boldSystemFontOfSize:17]];
        [lblTitleView setText:[self SetnavigationTitle:self.navigationItem.title]];
        [lblTitleView setTextAlignment:NSTextAlignmentCenter];
        [lblTitleView setBackgroundColor:[UIColor clearColor]];
        [self.navigationItem setTitleView:lblTitleView];

       // UINavigationController*navCnt = [[UINavigationController alloc] init];

      UIButton *btnLeft=[UIButton buttonWithType:UIButtonTypeCustom];
        [btnLeft setFrame:CGRectMake(0, 5, 32, 32)];
        [btnLeft setImage:[UIImage imageNamed:@"btn_back.png"] forState:UIControlStateNormal];
        [btnLeft setImage:[UIImage imageNamed:@"btn_back.png"] forState:UIControlStateHighlighted]; …
Run Code Online (Sandbox Code Playgroud)

iphone ios

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