3

So ive been building an app that uses homeKit and it was working awesome and then all of a sudden when opening it up to work on it yesterday i get a compiler error.

I have no idea what it means. I did report this to Apple just wanted to know if anyone is experiencing this and has a solution.

Error.

CompileSwift normal i386 com.apple.xcode.tools.swift.compiler cd /Users/newsclip/Dropbox/HomeKit export PATH="/Applications/Xcode6-Beta3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode6-Beta3.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -target i386-apple-ios8.0 -module-name HomeKit -O0 -sdk /Applications/Xcode6-Beta3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk -g -module-cache-path /Users/newsclip/Library/Developer/Xcode/DerivedData/ModuleCache -I /Users/newsclip/Library/Developer/Xcode/DerivedData/HomeKit-eciduqavoiltvregqvqtboqgaibf/Build/Products/Debug-iphonesimulator -F /Users/newsclip/Library/Developer/Xcode/DerivedData/HomeKit-eciduqavoiltvregqvqtboqgaibf/Build/Products/Debug-iphonesimulator -c -j4 /Users/newsclip/Dropbox/HomeKit/HomeKit/AccessoryDiscover.swift /Users/newsclip/Dropbox/HomeKit/AccessoryTableViewController.swift /Users/newsclip/Dropbox/HomeKit/HomeKit/CharacristicsViewController.swift /Users/newsclip/Dropbox/HomeKit/HomeKit/AppDelegate.swift /Users/newsclip/Dropbox/HomeKit/HomeKit/ServicesTableViewController.swift -output-file-map /Users/newsclip/Library/Developer/Xcode/DerivedData/HomeKit-eciduqavoiltvregqvqtboqgaibf/Build/Intermediates/HomeKit.build/Debug-iphonesimulator/HomeKit.build/Objects-normal/i386/HomeKit-OutputFileMap.json -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/newsclip/Library/Developer/Xcode/DerivedData/HomeKit-eciduqavoiltvregqvqtboqgaibf/Build/Intermediates/HomeKit.build/Debug-iphonesimulator/HomeKit.build/Objects-normal/i386/HomeKit.swiftmodule -Xcc -I/Users/newsclip/Library/Developer/Xcode/DerivedData/HomeKit-eciduqavoiltvregqvqtboqgaibf/Build/Intermediates/HomeKit.build/Debug-iphonesimulator/HomeKit.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/newsclip/Library/Developer/Xcode/DerivedData/HomeKit-eciduqavoiltvregqvqtboqgaibf/Build/Intermediates/HomeKit.build/Debug-iphonesimulator/HomeKit.build/HomeKit-generated-files.hmap -Xcc -I/Users/newsclip/Library/Developer/Xcode/DerivedData/HomeKit-eciduqavoiltvregqvqtboqgaibf/Build/Intermediates/HomeKit.build/Debug-iphonesimulator/HomeKit.build/HomeKit-own-target-headers.hmap -Xcc -I/Users/newsclip/Library/Developer/Xcode/DerivedData/HomeKit-eciduqavoiltvregqvqtboqgaibf/Build/Intermediates/HomeKit.build/Debug-iphonesimulator/HomeKit.build/HomeKit-all-target-headers.hmap -Xcc -iquote -Xcc /Users/newsclip/Library/Developer/Xcode/DerivedData/HomeKit-eciduqavoiltvregqvqtboqgaibf/Build/Intermediates/HomeKit.build/Debug-iphonesimulator/HomeKit.build/HomeKit-project-headers.hmap -Xcc -I/Users/newsclip/Library/Developer/Xcode/DerivedData/HomeKit-eciduqavoiltvregqvqtboqgaibf/Build/Products/Debug-iphonesimulator/include -Xcc -I/Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -I/Users/newsclip/Library/Developer/Xcode/DerivedData/HomeKit-eciduqavoiltvregqvqtboqgaibf/Build/Intermediates/HomeKit.build/Debug-iphonesimulator/HomeKit.build/DerivedSources/i386 -Xcc -I/Users/newsclip/Library/Developer/Xcode/DerivedData/HomeKit-eciduqavoiltvregqvqtboqgaibf/Build/Intermediates/HomeKit.build/Debug-iphonesimulator/HomeKit.build/DerivedSources -Xcc -DDEBUG=1 -emit-objc-header -emit-objc-header-path /Users/newsclip/Library/Developer/Xcode/DerivedData/HomeKit-eciduqavoiltvregqvqtboqgaibf/Build/Intermediates/HomeKit.build/Debug-iphonesimulator/HomeKit.build/Objects-normal/i386/HomeKit-Swift.h

IntToPtr source must be an integral %173 = inttoptr %objc_object* %146 to %CSo9HMService*, !dbg !341 LLVM ERROR: Broken function found, compilation aborted! Command /Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 1

4

2 回答 2

1
for service: HMService in detailItem!.services
    {
        if !services.containsObject(service)
        {
            println(service)
            services.addObject(service)
            tableView!.insertRowsAtIndexPaths([NSIndexPath(forRow: 0, inSection: 0)], withRowAnimation: UITableViewRowAnimation.Fade)
        }
    }

这是对我来说崩溃的代码,我所做的就是删除 HMService,然后它就可以工作了。我不想使用 HMservice 的属性,但我可以没有它。

所以我只是做了这样的事情。

for service in detailItem!.services
    {
        if !services.containsObject(service)
        {
            println(service)
            services.addObject(service)
            tableView!.insertRowsAtIndexPaths([NSIndexPath(forRow: 0, inSection: 0)], withRowAnimation: UITableViewRowAnimation.Fade)
        }
    }

希望这可以帮助人们

于 2014-07-19T20:54:36.010 回答
0

发现损坏的函数,编译中止 IntToPtr 源必须是整数 %173 = inttoptr %objc_object* %146 to %CSo9HMService*

你有没有设置oc头文件?向我们展示源代码将有所帮助。

于 2014-07-08T12:32:10.647 回答