小编Sag*_*gar的帖子

从浏览器打开iOS应用程序

我想做的是,我们在网站上有一个产品信息.该产品在商店有售.我们在网站上的内容是,产品信息和该产品的一个按钮.

我想对该按钮采取两个动作.当用户在Safari(浏览器)上打开iPad或iPhone上的网站并单击GetProduct按钮时,必须执行以下两个操作.1.如果用户已在设备上安装了产品,则直接在设备中打开应用程序.2.如果用户没有设备上的应用程序,则将用户链接到商店上的应用程序,以便他可以从那里下载.

我已经处理了第二个条件,但是如何处理第一个条件.如果我已经拥有应用程序,那么如何在浏览器中点击按钮的操作打开它.

iphone safari xcode ios

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

表达式产生错误:执行被中断,原因:跳过.该过程已返回到表达式评估之前的状态

我刚刚开始新的,

点击iPad的前置摄像头,点击用户照片,点击"使用照片",

func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject])
Run Code Online (Sandbox Code Playgroud)

正在被召唤 imagePickerController

这是代码行..

func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject])

    {
        picker .dismissViewControllerAnimated(true, completion: nil)
        photoImgView.image=info[UIImagePickerControllerOriginalImage] as? UIImage
        if imageData == nil {
            imageData = UIImageJPEGRepresentation((info[UIImagePickerControllerOriginalImage] as? UIImage)!, 1)
        }
    }
Run Code Online (Sandbox Code Playgroud)

但是当我提交它时显示发现nil value,经过调试得到了这一点,func didFinishPickingMediaWithInfo 其中说,

(lldb) po imageData
expression produced error: Execution was interrupted, reason: step over.
The process has been returned to the state before expression evaluation.
Run Code Online (Sandbox Code Playgroud)

我没有得到我做错的事.因为我不是很好,所以任何人都可以指导我.我被困在这一点上.

提前致谢.

xcode swift

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

在iOS中设备语言为阿拉伯语时显示英文键盘并输入

我正在做一个具有两种语言的应用程序,我正在做的是,在第一页上,我有几个字段将接受用户的输入。其中包含一个作为用户的电子邮件ID归档的文件。

当我将设备语言更改为阿拉伯语时,我键入的所有文本字段的值(例如名字和姓氏等)都是阿拉伯语,但是对于电子邮件ID,我需要键盘并以英语键入。

我做了很多相同的尝试来更改此特定字段的键盘类型,但是失败了。

欢迎任何意见和指导。提前致谢。

keyboard xcode ios

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

在iOS中检索SMS文本

我有一个应用程序将使用通过短信发送的OTP(一次性密码)值

我想用这个短信文本.

感谢您注册,您的验证码为'####'.请不要回复此邮件

我想在我的UIView上显示这个MSG,它将有OK Button.并点击OK按钮我必须将OTP'####'复制到我的UITextField.

所以我的问题是,是否可以将SMS文本放入iOS中的应用程序中.我搜索的链接显示,它只能与JailBreak一起使用.

但我需要一些正确的答案,以便如果有可能那么我怎么能实现它.如果不可能,那么链接将以书面形式显示我可以向我的经理显示并做出相应的决定.

sms objective-c ios

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

条形图的多种颜色 Swift 一种高于另一种

我正在快速使用 CHARTS 库。 https://github.com/danielgindi/Charts

我成功创建了饼图和条形图。现在我想创建包含 1 个“x”值和 2 个“y”值的条形图。

我创建了具有两个不同值的条形图。但我无法为它们设置颜色,我将颜色数组传递给委托方法setColors,但它从数组中获取最后一个颜色。

任何人都可以指导我在条形图上使用不同的颜色吗?

这是我调用 BarChart 库的代码

months = ["HR","Operations","iOS","Android","PHP","Support","Testing","Designer"]
        let unitsSold = [10.0,20.0,30.0,20.0,20.0,10.0,15.0,20.0]
        let unitsSold1 = [20.0,30.0,50.0,40.0,30.0,20.0,45.0,50.0]

        let barChartClass = self.storyboard!.instantiateViewControllerWithIdentifier("BarChartViewControllerID") as! BarChartViewController
        self.addChildViewController(barChartClass)
        barChartClass.view.frame = CGRectMake(20, 20, 740, 900)
        barChartClass.barChartView.doubleTapToZoomEnabled = false
        barChartClass.barChartView.setScaleEnabled(false)
        self.view.addSubview(barChartClass.view)
        barChartClass.barChartView.legend.enabled = false

        barChartClass.setChartBarGroupDataSet(months, values: unitsSold, values2: unitsSold1, sortIndex: 0)
Run Code Online (Sandbox Code Playgroud)

这是方法调用setChartBarGroupDataSet

func setChartBarGroupDataSet(dataPoints: [String], values: [Double], values2: [Double],sortIndex:Int)
    {

        var dataEntries: [BarChartDataEntry] = []

        for i in 0..<dataPoints.count
        {
            let dataEntry = BarChartDataEntry(value: values[i], …
Run Code Online (Sandbox Code Playgroud)

arrays charts xcode ios swift

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

减少导航栏左右栏按钮项的左右空间

我在导航栏上添加了两个自定义按钮。一个在左边,另一个在右边。我已经成功完成了

但是我未能减小按钮的起点和框架之间的距离。

我做了很多尝试,还给了x的负值,但还是没有帮助。这是按钮的代码

-(void)addLeftButton
{
    UIButton *aButton = [UIButton buttonWithType:UIButtonTypeCustom];
    aButton.backgroundColor = [UIColor redColor];
    [aButton setTitle:@"H" forState:UIControlStateNormal];
    aButton.frame = CGRectMake(0.0, 0.0, 40, 40);
    [aButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    UIBarButtonItem *aBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:aButton];
    [aButton addTarget:self action:@selector(backBtnClicked:) forControlEvents:UIControlEventTouchUpInside];
    [self.navigationItem setLeftBarButtonItem:aBarButtonItem];
}

-(void)addRightButton
{
    UIButton *aButton = [UIButton buttonWithType:UIButtonTypeCustom];
    aButton.backgroundColor = [UIColor greenColor];
    [aButton setTitle:@"B" forState:UIControlStateNormal];
    aButton.frame = CGRectMake(0.0, 0.0, 40, 40);
    [aButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    UIBarButtonItem *aBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:aButton];
    [aButton addTarget:self action:@selector(backBtnClicked:) forControlEvents:UIControlEventTouchUpInside];
    [self.navigationItem setRightBarButtonItem:aBarButtonItem];
}
Run Code Online (Sandbox Code Playgroud)

也尝试使用

aBarButtonItem.width = …
Run Code Online (Sandbox Code Playgroud)

xcode navigationbar ios

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

标签 统计

ios ×5

xcode ×5

swift ×2

arrays ×1

charts ×1

iphone ×1

keyboard ×1

navigationbar ×1

objective-c ×1

safari ×1

sms ×1