标签: xcode8

无法在Keychain Xcode 8 GM(Swift 3)中存储数据

在我的项目中,我需要在Keychain中保存一些数据,因此我使用的是一些开源,但数据并没有存储在钥匙串中.我尝试了很多开源,在每个开源中,在keychain中存储数据的尝试都失败了.

二手Keychain开源:

KeyClip - https://github.com/s-aska/KeyClip

钥匙串 - https://github.com/marketplacer/keychain-swift

钥匙串访问 - https://github.com/kishikawakatsumi/KeychainAccess

keychain ios swift3 xcode8

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

GMSServicesException',原因:'Google Maps SDK for iOS必须通过初始化

由于未捕获的异常"GMSServicesException"而终止应用程序,原因是:'Google Maps SDK for iOS必须在使用之前通过[GMSServices provideAPIKey:...]进行初始化

swift3 xcode8

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

如何使用呼叫目录扩展来识别我的应用程序中的来电?

我正在研究callKit框架,我发现通过使用调用目录扩展,我们可以识别传入的电话号码.我的问题是如何在iOS应用程序中实现调用目录扩展来识别传入的调用详细信息.我在Objective C工作.

使用此方法将数字"+ 919876xxxxx"添加到呼叫目录扩展中:

- (BOOL)addIdentificationPhoneNumbersToContext:(CXCallDirectoryExtensionContext *)context {
    // Numbers must be provided in numerically ascending order.
    CXCallDirectoryPhoneNumber phoneNumbers[] = {+919876xxxxx};

    NSArray<NSString *> *labels = @[ @"Telemarketer"];
    NSUInteger count = (sizeof(phoneNumbers) / sizeof(CXCallDirectoryPhoneNumber));

    for (NSUInteger i = 0; i < count; i += 1) {
        CXCallDirectoryPhoneNumber phoneNumber = phoneNumbers[i];
        NSString *label = labels[i];
        [context addIdentificationEntryWithNextSequentialPhoneNumber:phoneNumber label:label];
    }
    return YES;
}
Run Code Online (Sandbox Code Playgroud)

而我在电话设置中的通话阻止和识别功能.当我从这个号码打电话时,它会显示[应用程序名称]来电显示:电话推销员.

我的问题是如何在我的应用程序中知道这个数字,以便在表格中显示这个数字.

提前致谢.

objective-c ios ios10 xcode8 callkit

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

使用注释引脚创建长按手势识别器

到目前为止我所做的是创建一张地图.然后显示用户位置并居中,以便地图在旅行时居中(汽车等)

但是现在我想添加一个长按手势,这样如果用户输入一个引脚就会被丢弃.我一直在努力学习教程和模拟器崩溃.

我如何添加,longPressGesturerecognizer以便它在我的上面放一个别针mapView.

这是我的代码 -

import UIKit
import MapKit
import CoreLocation

class Page2: UIViewController, MKMapViewDelegate,  CLLocationManagerDelegate{

    @IBOutlet var mapView: MKMapView!
    let locationManager = CLLocationManager()

    override func viewDidLoad() {
        super.viewDidLoad()
        self.locationManager.delegate = self
        self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
        self.locationManager.requestWhenInUseAuthorization()
        self.locationManager.startUpdatingLocation()
        //blue dot on the map
        self.mapView.showsUserLocation = true
        //tracking mode on
        self.mapView.userTrackingMode = .follow
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    // location Manager Delegate center user on map
    private …
Run Code Online (Sandbox Code Playgroud)

mkmapview swift uilongpressgesturerecogni swift3 xcode8

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

MKAnnotation通过XCTest UI测试

如何通过XCTest的UI测试访问MKMapView上的引脚?

我想计算数字,验证具体的数字(基于可访问性ID或标题)等.

MKAnnotation似乎没有XCUIElementType.

我很难找到关于MKMapView + XCTest的任何文档.

mkannotation xctest xcode-ui-testing swift3 xcode8

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

XCode 8:缺少“自动管理签名”选项

使用XCode 8构建iOS项目时,出现以下错误:

Code signing is required for product type 'Application' in SDK 'iOS 10.0'
Run Code Online (Sandbox Code Playgroud)

我发现了很多答案,其中大多数都说检查Automatically manage signing项目设置页面中的选项可以解决问题。

但是,Automatically manage signing缺少该选项。如何使其显示?

xcode ios xcode8

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

Json使用Alamofire在快速3中解析

我在swift 3工作.我是ios的新手.我试图像解析json数据一样

My jsonVlaue is : {
    data =     (
                {
            Password = "@1234";
            UserName = "<null>";
            "___class" = OrderTable;
            "__meta" = "{\"relationRemovalIds\":{},\"selectedProperties\":[\"UserName\",\"created\",\"name\",\"___class\",\"ownerId\",\"updated\",\"objectId\",\"Password\"],\"relatedObjects\":{}}";
            created = 1483525854000;
            name = TestMan;
            objectId = "4316DEBA-78C1-C7BD-FFBC-3CB77D747F00";
            ownerId = "<null>";
            updated = "<null>";
        },
                {
            Password = 123;
            UserName = "<null>";
            "___class" = OrderTable;
            "__meta" = "{\"relationRemovalIds\":{},\"selectedProperties\":[\"UserName\",\"created\",\"name\",\"___class\",\"ownerId\",\"updated\",\"objectId\",\"Password\"],\"relatedObjects\":{}}";
            created = 1483516868000;
            name = tommy;
            objectId = "29155114-C00B-5E1C-FF6F-7C828C635200";
            ownerId = "<null>";
            updated = "<null>";
        }.......
Run Code Online (Sandbox Code Playgroud)

我只想要keyvalue:"name"和我要在Array中添加的值.

我尝试这样做,但我的应用程序正在崩溃.我的代码我喜欢如下

 func getLoginDetails()
    {
       //https://api.backendless.com/<version>/data/<table-name>/properties

        Alamofire.request( HeadersClass.api.domainName + "OrderTable", method: .get, …
Run Code Online (Sandbox Code Playgroud)

json alamofire swift3 xcode8

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

UINavigationController不是全屏(swift)

我创建了一个空项目(在swift中,xcode 8.3)并且不使用storyboard和一个导航控制器进入窗口.我不知道为什么导航控制器不是全屏

在AppDelegate中,didFinishLaunchingWithOptions方法:


self.window = UIWindow(frame: UIScreen.main.bounds)

let nav = UINavigationController()
nav.view.frame = UIScreen.main.bounds
nav.view.backgroundColor = UIColor.red
self.window?.rootViewController = nav
self.window?.makeKeyAndVisible()

结果是:

在此输入图像描述

ios swift3 xcode8

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

如何使用终端创建IPA

我正在使用XCode 8.3.如果我在终端中触发此命令以进行存档,如下所示.它显示了这种错误.你能帮我找出解决方案吗?

xcodebuild -configuration Release -exportArchive -exportFormat ipa -archivePath "/Users/Desktop/Demo.xcarchive" -exportPath "/Users/Desktop/Demo.ipa" -exportProvisioningProfile "Demo Development"

xcodebuild: error: invalid option '-exportFormat'

Usage: xcodebuild [-project <projectname>] [[-target <targetname>]...|-alltargets] [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
  xcodebuild [-project <projectname>] -scheme <schemeName> [-destination <destinationspecifier>]... [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
  xcodebuild -workspace <workspacename> -scheme <schemeName> [-destination <destinationspecifier>]... [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
  xcodebuild -version [-sdk [<sdkfullpath>|<sdkname>] [<infoitem>] ]
  xcodebuild -list [[-project <projectname>]|[-workspace <workspacename>]] [-json]
  xcodebuild …
Run Code Online (Sandbox Code Playgroud)

xcodebuild swift3 xcode8

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

Swift 3 - 将数据从一个视图传递到另一个视图

我将在这个问题上加上一个事实,即我严格地说是一个涉及xcode的设计师.我正在尝试构建一个'哑'原型.

我正在尝试设置2个VC.第一个VC有一个文本字段,允许用户键入搜索参数,一旦点击"返回",它应该将该参数传递给下一个VC.同样在这个特定的VC上,我在导航栏中设置了"后退"按钮.

我遇到的问题是我无法获得第一个VC后退按钮的代码来处理传递变量的代码.当我点击第一个视图控制器上的后退按钮时,它会导致应用程序崩溃.Xcode注意到问题出在传递变量的代码中.这是两个VC的代码.

import UIKit

class SearchViewController: UIViewController, UITextFieldDelegate {

@IBOutlet weak var searchText: UITextField!

override func viewDidLoad() {
    super.viewDidLoad()
    self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
    self.navigationController?.navigationBar.shadowImage = UIImage()
    self.navigationController?.navigationBar.isTranslucent = true
    searchText.delegate = self
    searchText.becomeFirstResponder()
    // Do any additional setup after loading the view.
}

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    var destinationController = segue.destination as! ResultsViewController
    destinationController.searchItem = searchText.text!
}

func textFieldShouldReturn(_ textField: UITextField) -> Bool {
    if searchText.text != "" {
        performSegue(withIdentifier: "resultsSegue", sender: self)
        textField.resignFirstResponder()
        return false …
Run Code Online (Sandbox Code Playgroud)

ios swift3 xcode8

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