简而言之,在使用Xcode 9 Beta时,我遇到了以下警告:
不推荐在Swift 4模式下使用Swift 3 @objc推理.请解决已弃用的@objc推理警告,使用"使用已弃用的Swift 3 @objc推理"日志记录测试代码,并禁用Swift 3 @objc推理.**
经过一番研究,我仍然不知道如何解决这个问题.我将非常感谢有关如何解决此问题的任何提示以及对正在发生的事情的解释.
我的目标是更好地理解我的代码发生了什么.
我运行多个模拟器,我需要关闭其中一个.我怎样才能做到这一点?因为我试图像在旧版本的Xcode中那样关闭它但无法关闭.
我下载了新的Xcode,在Interface Builder中,我遇到了很多问题,例如:
固定宽度约束可能导致剪辑
它看起来像这样:
我确实有几种语言的本地化,我理解警告,在另一种语言中标签的大小可能会改变,但我的应用程序没有这个问题.我昨天在Xcode 8中运行并测试了它,很好.我不想花费数小时的时间来添加无意义的新约束.
有建议的解决方案
任何人在UITabBar组件周围遇到iPhone X模拟器问题?
我似乎将图标和标题呈现在彼此之上,我不确定我是否遗漏了任何东西,我也在iPhone 8模拟器中运行它,以及一个看起来很好的实际设备,如图所示故事板.
iPhone X:
iPhone 8
我最近更新到XCode 9.当我构建应用程序时,它会对我的pod文件中的某些故事板说"非法配置".我试图重新创建故事板文件,但它没有帮助.
![[1]](https://i.stack.imgur.com/fHjiM.png)
使用Xcode 9时,有一些编译器警告说This function declaration is not a prototype.它建议添加void到方法体,它将解决它.我遇到的问题是,系统API也会抛出那些警告,就像UIApplication委托方法一样:
- (void)application:(UIApplication *)application
    handleActionWithIdentifier:(NSString *)identifier
         forRemoteNotification:(NSDictionary *)userInfo
              withResponseInfo:(NSDictionary *)responseInfo
             completionHandler:(void (^)())completionHandler
这可以通过以下方式解决:
- (void)application:(UIApplication *)application
    handleActionWithIdentifier:(NSString *)identifier
         forRemoteNotification:(NSDictionary *)userInfo
              withResponseInfo:(NSDictionary *)responseInfo
             completionHandler:(void (^)(void))completionHandler
现在我想知道委托方法是否仍然可以长期运行,或者Apple会void在以后的iOS 11 Beta版本中插入.我很好奇,因为如果我包含void身体,Xcode会抱怨不匹配的方法选择器(这是有道理的).到目前为止,有人遇到过同样的问题吗?
此代码在ios10中正常工作.我得到我的标签和图像按钮,这是用户照片配置文件,圆形圆形..好的.但是当运行xcode 9 ios11模拟器时,我将它拉出来.按钮框必须是32x32,当检查SIM并获取视图并告诉xcode描述视图时,我得到170x32或类似的输出.
继承我的代码.
let labelbutton = UIButton( type: .system)
    labelbutton.addTarget(self, action:#selector(self.toLogin(_:)), for: .touchUpInside)
    labelbutton.setTitleColor(UIColor.white, for: .normal)
    labelbutton.contentHorizontalAlignment = .right
    labelbutton.titleLabel?.font = UIFont.systemFont(ofSize: 18.00)
    let button = UIButton(type: .custom)
     button.addTarget(self, action:#selector(self.toLogin(_:)), for: .touchUpInside)
     button.frame = CGRect(x: 0, y: 0, width: 32, height: 32)
     button.setTitleColor(UIColor.white, for: .normal)
     button.setTitleColor(UIColor.white, for: .highlighted)
    var buttomItem : UIBarButtonItem = UIBarButtonItem()
    buttomItem.customView = button
    buttomItem.target = self
    buttomItem.action = "ToLogin"
    var labelItem : UIBarButtonItem = UIBarButtonItem()
    labelItem.customView = labelbutton
    labelItem.target = self
    labelItem.action = "ToLogin"
    if …我在Xcode 9 beta,iOS 11中使用谷歌地图.
我收到错误输出到日志如下:
主线程检查器:在后台线程上调用的UI API: - [UIApplication applicationState] PID:4442,TID:837820,线程名称:com.google.Maps.LabelingBehavior,队列名称:com.apple.root.default-qos.overcommit ,QoS:21
为什么会发生这种情况,因为我几乎可以肯定我并没有改变代码中主线程的任何接口元素.
 override func viewDidLoad() {
    let locationManager = CLLocationManager()
    locationManager.requestAlwaysAuthorization()
    locationManager.requestWhenInUseAuthorization()
        if CLLocationManager.locationServicesEnabled() {
            locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters
            locationManager.startUpdatingLocation()
        }
      viewMap.delegate = self
     let camera = GMSCameraPosition.camera(withLatitude: 53.7931183329367, longitude: -1.53649874031544, zoom: 17.0)
        viewMap.animate(to: camera)
    }
    func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
        let locValue:CLLocationCoordinate2D = manager.location!.coordinate
        print("locations = \(locValue.latitude) \(locValue.longitude)")
    }
    func mapView(_ mapView: GMSMapView, willMove gesture: Bool) {
    }
    func mapView(_ mapView: GMSMapView, idleAt position: GMSCameraPosition) {
        if(moving …更新到Xcode 9后,我尝试构建我的一个项目.
我使用FacebookLogin pod.我在FacebookLogin/LoginButton.swift中有编译器错误
@testable import FacebookCore
? Module compiled with Swift 3.1 cannot be imported in Swift 4.0
在我的目标构建设置中,Swift语言版本设置为Swift 3.2.
我想我需要等待Facebook更新他们的pod?还是其他任何建议?
谢谢 !
xcode9-beta ×10
ios ×5
ios11 ×3
swift ×3
swift4 ×3
xcode ×2
cocoapods ×1
git ×1
google-maps ×1
iphone ×1
iphone-x ×1
localization ×1
macos ×1
objective-c ×1
storyboard ×1
uitabbar ×1
xcode9 ×1