小编And*_*iis的帖子

Xcode 8.2,Swift编译器错误:错误:意外的输入文件

从Xcode 8.1更新到8.2后,我在项目中面临Swift编译器错误.我使用最新的Swift版本和Carthage进行依赖管理.它与Xcode 8.1完美搭配,现在我已经尝试了几个小时来修复它,通过清理DerivedData和模拟器数据,清理Xcode并删除Build文件夹,但似乎没有任何帮助.我只安装了一个Xcode版本.

我得到以下编译错误:

CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
cd <ProjectSource>
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk
export TOOLCHAINS=com.apple.dt.toolchain.XcodeDefault

-- all files to compile --

unknown>:0: error: unexpected input file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 
Run Code Online (Sandbox Code Playgroud)

它所指的文件夹如下所示:

无法找到的文件夹

它实际上在那里,所以我不知道发生了什么......非常感谢帮助!:)

xcode xcodebuild swift

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

CLLocationManager不会向didUpdateLocations方法发送位置

我正在iOS 6.1 iPhone app使用ARC启用它将使用a CLLocationManager来跟踪设备位置.

UPDATE

我有一个DestinationViewController实现了CLLocationManagerDelegate.它创建CLLocationManager并进行设置.我已经导入了CoreLocation framework我的项目.

我试图调试很多,可以看到它CLLocationManager已创建,并且没有错误.但问题是,[CLLocationManager authorizationStatus]kCLAuthorizationStatusNotDetermined 双方之前[self.locationManager startUpdatingLocation];经过.因此,没有提示要求为此应用程序使用位置服务的权限.因此,这种方法永远不会被解雇.

- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:  
(NSArray *)locations
Run Code Online (Sandbox Code Playgroud)

我也尝试在网上搜索几个小时来寻找类似的例子,但没有运气.DestinationViewController中的代码发布在下面.

接口

#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>

@interface DestinationViewController : UIViewController <CLLocationManagerDelegate>
Run Code Online (Sandbox Code Playgroud)

履行

#import "DestinationViewController.h"

@interface DestinationViewController ()
@property (strong, nonatomic) CLLocationManager *locationManager;
@end


@implementation DestinationViewController

// Initializer
- (CLLocationManager *)locationManager
{
    if (!_locationManager) {
        _locationManager = [[CLLocationManager alloc] init];
    } …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c core-location cllocationmanager ios

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