gpt4 book ai didi

ios - 添加代码以注册用户通知设置时出现错误结果

转载 作者:行者123 更新时间:2023-11-28 05:34:19 24 4
gpt4 key购买 nike

所以我正在尝试使用 Xcode 6 beta 6 和 swift 编码为我的应用程序注册用户通知。下面是我的代码,它会导致下面的两个 apple mach-o 错误。

知道如何解决吗?我在代码中做错了什么吗?

更新:如果我只留下一种通知类型它工作正常,所以我认为问题是“|”分隔符,正确的方法是什么?我到处都是这样。

func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
// Override point for customization after application launch.

application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: UIUserNotificationType.Sound | UIUserNotificationType.Badge, categories: nil))

return true
}

错误:

    Ld /Users/christopherbonilla/Library/Developer/Xcode/DerivedData/---esgnlherkoqgtbczodawinrqohqs/Build/Products/Debug-iphoneos/--.app/-- normal armv7
cd /Users/christopherbonilla/--/--/--
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export PATH="/Applications/Xcode6-Beta6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode6-Beta6.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode6-Beta6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode6-Beta6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk -L/Users/christopherbonilla/Library/Developer/Xcode/DerivedData/---esgnlherkoqgtbczodawinrqohqs/Build/Products/Debug-iphoneos -F/Users/christopherbonilla/Library/Developer/Xcode/DerivedData/---esgnlherkoqgtbczodawinrqohqs/Build/Products/Debug-iphoneos -filelist /Users/christopherbonilla/Library/Developer/Xcode/DerivedData/---esgnlherkoqgtbczodawinrqohqs/Build/Intermediates/--.build/Debug-iphoneos/--.build/Objects-normal/armv7/--.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -ObjC -framework CoreGraphics -framework MobileCoreServices -framework Security -framework SystemConfiguration -lswiftCore -L/Applications/Xcode6-Beta6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/christopherbonilla/Library/Developer/Xcode/DerivedData/---esgnlherkoqgtbczodawinrqohqs/Build/Intermediates/--.build/Debug-iphoneos/--.build/Objects-normal/armv7/--.swiftmodule -miphoneos-version-min=8.0 -framework Foundation -framework CoreLocation -framework CoreBluetooth -lPods -Xlinker -dependency_info -Xlinker /Users/christopherbonilla/Library/Developer/Xcode/DerivedData/---esgnlherkoqgtbczodawinrqohqs/Build/Intermediates/--.build/Debug-iphoneos/--.build/Objects-normal/armv7/--_dependency_info.dat -o /Users/christopherbonilla/Library/Developer/Xcode/DerivedData/---esgnlherkoqgtbczodawinrqohqs/Build/Products/Debug-iphoneos/--.app/--

Undefined symbols for architecture armv7:
"__TFSsoi1oUSs17_RawOptionSetType_USs21BitwiseOperationsTypeSs9Equatable__FTQ_Q__Q_", referenced from:
__TFC11--11AppDelegate11applicationfS0_FTGSQCSo13UIApplication_29didFinishLaunchingWithOptionsGSQCSo12NSDictionary__Sb in AppDelegate.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

最佳答案

只需转到:~/Library/Developer/Xcode/DerivedData 并删除内容。这已经解决了我在 beta 6 中的所有 mach-o 错误。

关于ios - 添加代码以注册用户通知设置时出现错误结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25394245/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com