我使用OS 10.10,Xcode 6 GM,我的项目由swift(&Objective-C)编写.
该项目可以使用Xcode 6-beta7运行.
Process: Xcode [7267]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 6.0 (6299)
Build Info: IDEFrameworks-6299000000000000~8
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [7267]
User ID: 501
Date/Time: 2014-09-10 17:25:38.697 +0800
OS Version: Mac OS X 10.10 (14A343f)
Report Version: 11
Anonymous UUID: 587D71D4-C53F-50BF-625D-CF092416EEDC
Time Awake Since Boot: 12000 seconds
Crashed Thread: 14 Dispatch queue: shared-compile-command-queue :: NSOperation 0x7f887f8aa900 (QOS: UTILITY)
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
ProductBuildVersion: 6A313 …Run Code Online (Sandbox Code Playgroud) 从命令行运行UIAutomation测试似乎经常在新的Xcode版本中破坏(根据过去的帖子判断).从未使用过命令行脚本,我从2012年发现了这篇文章:来自命令行的自动化仪器.
问题:我的命令返回没有错误,没有输出结果,没有任何记录到系统控制台.模拟器甚至没有启动!
检查一些更新路径(特别是自动跟踪仪器路径),我想出了这个命令.注意第一个参数中的路径(它与过去的Xcode版本不同):
instruments -t "/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate"
"/Users/sohail/Library/Developer/CoreSimulator/Devices/7232A640-A9D2-4626-A2AD-37AFFF706718/data/Containers/Bundle/Application/D07FEC4B-76AD-4844-8362-08E771B81053/MyAppName.app"
-e UIASCRIPT "/Users/sohail/source/MyAppName/MyAppNameAutomationTests/TestRunner.js"
-e UIARESULTSPATH "Users/sohail/source/MyAppName/MyAppNameAutomationTests/TestResults"
Run Code Online (Sandbox Code Playgroud)
通过从这个要点中选择"原始",这可能更容易阅读.
当然:
TestRunner.js我指定的上述文件可以在指定的路径中找到,并且可以使用Instruments应用程序以交互方式在Automation Instrument中成功运行.想什么?
我在使用swift显示UIPopover时遇到了一些麻烦.注释掉的代码在Objective-C中工作正常,但使用Swift不起作用.当我点击我的视图控制器中的+时,我在调试器中得到了"click",但是没有弹出窗口.
class PlayerInformationTableViewController: UITableViewController, NSFetchedResultsControllerDelegate, UIPopoverControllerDelegate {
@IBOutlet weak var addBarButtonItem: UIBarButtonItem!
var playerInformationViewController = PlayerInformationViewController()
var popover:UIPopoverController? = nil
override func viewDidLoad() {
super.viewDidLoad()
/*
//setup the popover
_cuesPopoverViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"CuesPopoverViewController"];
self.cuesPopover = [[UIPopoverController alloc] initWithContentViewController:_cuesPopoverViewController];
self.cuesPopover.popoverContentSize = CGSizeMake(540, 300);
self.cuesPopover.delegate = self;
*/
playerInformationViewController.storyboard?.instantiateViewControllerWithIdentifier("PlayerInformationViewController")
popover?.contentViewController = playerInformationViewController
popover?.popoverContentSize = CGSizeMake(300, 300)
popover?.delegate = self
// Uncomment the following line to preserve selection between presentations
// self.clearsSelectionOnViewWillAppear = false
// Uncomment the following line to display an Edit …Run Code Online (Sandbox Code Playgroud) 今天我更新到新发布的xCode 6 GM.当我尝试构建我的应用程序时,我得到一个编译器错误,说我的一个View控制器处理表"不符合协议UITableViewDataSource".之前一切正常(使用xCode 6 Beta 5)
根据文档,协议需要2种方法:
- tableView:cellForRowAtIndexPath:必需的方法
- tableView:numberOfRowsInSection:必需的方法
它们都实现了:
func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int {
return feed!.count
}
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
println("HashtagDetailViewController: tableView - cellForRowAtIndexPath called")
let cell = tableView.dequeueReusableCellWithIdentifier("postCell", forIndexPath: indexPath) as PostTableCell
cell.loadItem(feed!.toArray()[indexPath.row])
return cell
}
Run Code Online (Sandbox Code Playgroud)
我错过了什么?是否有一个新的必需方法不在文档中?谢谢你的帮助