标签: xcode10

Xcode 10不编译依赖项

简短摘要:
如果未在编译前清除项目,则我的应用程序无法在Xcode10中正确编译,但在Xcode9中可以正常工作。

详细说明:
我有一个链接到我的iOS应用程序的静态框架。这两个项目都在同一工作区中打开,并且该框架已在项目设置中添加到应用程序的“嵌入式二进制文件”中。但是,在Xcode10中更改框架中的代码不会触发编译(即使使用CMD + B也不会),因此在运行应用程序时不会出现更改。这不是Xcode9的问题。到目前为止,我发现的唯一解决方法是每次在编译之前都要清理项目,这会导致异常的编译时间和很多挫败感。

有没有人看过这个问题,并提出了解决建议?

xcode xcode9 ios12 xcode10

5
推荐指数
0
解决办法
573
查看次数

运行单元测试时,每隔两次Xcode 10“无法安装此应用程序”

自从更新到Xcode 10之后,我必须运行两次单元测试才能使其真正运行。

我第一次收到“目前无法安装此应用程序:无法从束路径....加载Info.plist”。

我第二次运行它执行得很好。

看起来好像是第一次运行它只是试图从模拟器中清理或重新安装该应用程序-大约有一半的时间,当我在警报中将“应用程序从模拟器中删除”时,单击“确定”。

每次在模拟器中运行实际的应用程序都可以正常工作。

有没有其他人看到过此内容?我是否错过了一些新的单元测试配置?

unit-testing ios xcode10

5
推荐指数
0
解决办法
324
查看次数

迅速4.2枚举大小写''找不到类型'?' switch语句中的要求以冗余方式解开隐式解开的可选

我有以下枚举:

enum ExampleEnum {
    case one
    case two
    case three
    case four  
}
Run Code Online (Sandbox Code Playgroud)

以及以下属性定义:

var exampleProperty: ExampleEnum!
Run Code Online (Sandbox Code Playgroud)

在Swift 4.2之前,我使用以下switch语句:

switch self.exampleProperty {
    case .one:
        print("case one")
    case .two:
        print("case two")
    case .three:
        print("case three")
    case .four:
        print("case four")
    default:
        break
}
Run Code Online (Sandbox Code Playgroud)

自从切换到Swift 4.2之后,这个switch语句给了我错误:

Enum case 'one' not found in type 'ExampleEnum?'
Run Code Online (Sandbox Code Playgroud)

我觉得这很奇怪,因为我已经用感叹号清楚地定义了类型,以隐式解开可选内容。但是,似乎没有这样做。为了使错误消失,我需要执行以下切换:

switch self.exampleProperty! {
    case .one:
        print("case one")
    case .two:
        print("case two")
    case .three:
        print("case three")
    case .four:
        print("case four")
}
Run Code Online (Sandbox Code Playgroud)

我在上面所做的是再次解包了exampleProperty变量,即使定义是隐式解包的,也从开关中删除了默认值。

只是想知道为什么在4.2快速更改?是switch语句中的更改,还是为什么再次需要这种解包。看来多余吗?

switch-statement ios swift xcode10 swift4.2

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

iOS 12 Xcode 10应用程序:openURL:选项:崩溃

我最近注意到我的应用程序出现一些问题,导致在上传到Appstore时出现警告:

无效的文档配置 -基于文档的应用程序应支持文档浏览器(UISupportsDocumentBrowser = YES)或实现就地打开(LSSupportsOpeningDocumentsInPlace = YES / NO)。访问https://developer.apple.com/document-based-apps/了解更多信息。

我的应用程序响应其plist'Document Types'中的自定义扩展名集,并在iOS 12 / Xcode 10之前正常工作。

当在.plist中的“是”中添加“在现场支持打开文档”并且在“否”中将“支持文档浏览器”添加为否时,此消息崩溃:

“应用程序具有LSSupportsOpeningDocumentsInPlace键,但未在委托上实现application:openURL:options:”

我的应用程序支持iOS 8或更高版本,并且可以很好地响应:

(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
Run Code Online (Sandbox Code Playgroud)

在我的AppDelegate中。

当我添加新的

- (void)openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenExternalURLOptionsKey, id> *)options completionHandler:(void (^)(BOOL success))completion 
Run Code Online (Sandbox Code Playgroud)

它仍然崩溃与上面的错误。

crash objective-c openurl ios12 xcode10

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

ld:找不到架构x86_64 xcode 10的符号

我刚刚将我的Xcode更新到版本10.当我运行我的项目然后它向我显示以下错误:

Undefined symbols for architecture x86_64:
"std::_List_node_base::unhook()", referenced from:
  std::list<Linphone::Conference::Participant, 
std::allocator<Linphone::Conference::Participant> 
>::remove(Linphone::Conference::Participant const&) in 
liblinphone.a(conference.cc.o)
"std::_List_node_base::hook(std::_List_node_base*)", referenced from:
  Linphone::Conference::addParticipant(_LinphoneCall*) in 
liblinphone.a(conference.cc.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

xcode ios swift xcode10

5
推荐指数
0
解决办法
697
查看次数

如何使用Swift 4 Xcode 10在Cocoa中的情节提要中以编程方式设置初始控制器?

介绍:

我想创建一个在首次启动时显示一些“用户指南”的应用程序,我已经完成了检测该应用程序是否首次启动的部分,但是当涉及到设置视图控制器部分时,我无法确定怎么做。

现在的情况:

我已经进行了很多研究,并且看到了很多有关“如何以编程方式快速设置初始视图控制器”这样的主题的Q / A文章,但是基本上所有这些文章都是以ios开发为例的,它们都没有UIWindowUINavigationController(rootViewController:)在OSX开发中匹配。然后我发现它似乎没有这样的事情didFinishLaunchingWithOptionsAppDelegate.swift的文件,相反,这里只有一个applicationDidFinishLaunching(_ aNotification: Notification)

题:

我已经取消选中Is Initial Controller两个View Controller 的选项,并且它们都具有Storyboard ID(标识符?)和它们自己的指定类。

MainPageController

UserGuidePageController

还是我也应该指定并标识我的窗口控制器?因为我不知道该如何使用窗口控制器。

为了在其中设置应用程序的初始视图控制器,我需要做什么AppDelegate

PS这是我的界面视图的图片:

故事板界面

AppDelegate.swift

import Cocoa

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {

  let storyboard = NSStoryboard(name: NSStoryboard.Name("Main"), bundle: Bundle.main)
  var window = MainWindow().window

  func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) - > Bool {
    return true
  }

  func applicationDidFinishLaunching(_ aNotification: Notification) {
    // Insert code here to initialize your application
    let …
Run Code Online (Sandbox Code Playgroud)

macos cocoa viewcontroller swift4 xcode10

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

存档时Xcode 10 Generics typealias Segmentation Fault 11

Xcode 10存档时出现分段错误

注意:

  • Xcode 10 在设备和模拟器上构建运行正常,在Xcode 9.4中,归档,构建运行也很好

我的代码:

typealias ResponseBlock<T> = (_ sender: T) -> Void
Run Code Online (Sandbox Code Playgroud)

我在整个项目中使用它,如:

var callback: ResponseBlock<AnyObject>? 
Run Code Online (Sandbox Code Playgroud)

在Xcode 10上存档时出错:

  1. 同时生成Objective-C头
  2. 打印时................
  3. 打印类型'ResponseBlock <[IndexPath]>'(声明在.....] RangeText ="typealias ResponseBlock =(_ sender:T) - > V")
  4. 打印类型'(T)' 错误:分段错误:11

用法:

var refreshCells: ResponseBlock<[IndexPath]>?
viewModel.refreshCells = {indexPathList in 
     self.collectionView.reloadItems(at:   indexPathList)
}
Run Code Online (Sandbox Code Playgroud)

generics ios type-alias swift xcode10

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

ipatool失败,并发生以下异常:#&lt;CmdSpec :: NonZeroExcitException:命令以pid 29483退出退出1:

在此处输入图片说明

ipatool失败,但出现以下异常:#

Stderr:追溯(最近一次呼叫最近):AttributeError:“ str”对象没有属性“ decode”的文件“”,第1行

Xcode10.1?Objective-C

objective-c xcode10 xcode10.1

5
推荐指数
0
解决办法
797
查看次数

can`t open storyboard on stable version Xcode

I made a mistake by opening my project in a new beta version of xcode

Now I can not open it with a stable version because

The document “Main.storyboard” requires at least Xcode 11.0.
This version does not support iOS 13.0 system colors. Open this document with at least Xcode 11.0.
Run Code Online (Sandbox Code Playgroud)

On Saturday, I planned to publish the application. and it can not be published with the beta versions.

I need to run the application on the standard version of …

storyboard xcode10 xcode11

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

Xcode 11调试器的怪异行为-有值时将值显示为nil

我刚刚注意到Xcode11的怪异行为,我正在Xcode 10和Xcode 11中执行相同的代码。

有关这两个版本,请参见下面的屏幕截图。

我正在从String创建一个url,当我放入调试器并检查myUrl的值时,它显示为nil,尽管在下一行它通过nil检查,并且控制进入not nil情况。

也请参阅控制台。

有没有人已经遇到过这类问题?或我做错了什么。

PS:已清除缓存,派生数据,清理生成,重新启动Xcode。不要与断点的位置混淆,它们都是用不同的系统捕获的。

提前致谢。

xcode ios swift xcode10 xcode11

5
推荐指数
2
解决办法
136
查看次数