草庐IT

without_splash_screen

全部标签

swift - "Type of expression is ambiguous without more context"尝试创建新变量以附加数组时

我是编码和Swift的新手,现在正在尝试创建一个小型应用程序。我创建了这部分代码:overridefunctableView(tableView:UITableView,didSelectRowAtIndexPathindexPath:NSIndexPath){tableView.deselectRowAtIndexPath(indexPath,animated:true)letcell=tableView.cellForRowAtIndexPath(indexPath)varselectedSubject=toBeAddedSubjects[indexPath.row]asSubje

swift - 苹果操作系统 : is there any way to sniff system open call without kernel

我必须从MacOS中的任何位置打开一个文件,并且我想在它在任何相关应用程序中打开之前执行一些操作。有什么办法可以嗅探系统opencall并保持一段时间,然后进行一些操作。例如,我正在打开test.doc文件,它将在msword应用程序中打开,或者可以通过右键单击并选择任何其他应用程序打开。在我的text.doc文件上启动此msword应用程序或任何相关应用程序(系统打开调用)之前,我想等待并执行一些操作。MacOS(C/C++/ObjectiveC/Swift)的编程语言有没有办法不用进入内核?任何帮助将不胜感激。 最佳答案 据我所

swift - Codable - arrayPropety [AnyObject] : Reference to member 'data' cannot be resolved without a contextual type

设置Codable类。AnyObjects数组产生编译错误:Referencetomember'data'cannotberesolvedwithoutacontextualtypeclassClassA:NSObject,Codable{//MARK:-Propertieslettitle:Stringletdata:[T]//dataisanarrayofeitherCodableobjectsofClassBorClassC.//MARK:-KeyesprivateenumCodingKeys:String,CodingKey{casetitlecasedata}required

swift - 撤消麻烦 : Initialise `NSPersistentDocument` programmatically without "edited" flag in title bar

我有一个使用核心数据和NSPersistentDocument的小应用程序。对于新文档,我使用单个Settings元素初始化文档。我已经可以抑制初始化生成的撤消条目,但是...奇怪的行为是这样的:文档开始时窗口标题中没有“已编辑”标志。我一点击“编辑”菜单,“已编辑”标志就会出现,并且突然可以进行撤消操作。这是我的init()代码:classDocument:NSPersistentDocument{varsettings:Settings!=niloverrideinit(){super.init()do{letfetchSettings=NSFetchRequest(entityN

ios - Alamofire 4.0.0 : [String:String] is not convertible to [String : Any] & Request is ambiguous without more context

我正在将Alamofire更新到4.0.0Beta1并将XCode8更新到Beta6。首先,我得到了[String:String]isnotconvertibleto[String:Any]错误代码letparameter=["scope":"\(scope)","client":"\(clientId)"]Alamofire.request(link,withMethod:.POST,parameters:parameter,encoding:.json).responseJSON在我更改后将[String:Any]添加到参数中,错误消失但产生了新错误:Expressiontype'

ios - LGSideMenuController : Registration of several local push notifications leads to delay in screen handling

当我注册了几个本地推送通知时,我注意到一个奇怪的问题:formodelinmyModelArray{letcalendar=Calendar.currentletscheduleDate=calendar.date(byAdding:.second,value:i*5,to:Date())!letnotification=UILocalNotification()notification.fireDate=scheduleDatenotification.alertBody="Mypushnotificationtitle"UIApplication.shared.scheduleLo

Swift for 循环 "Expression type ' [[String : String]]' is ambiguous without more context

我正在尝试从字典数组中访问以下项目,但我遇到了两个问题(都是不同的方法)。字典数组初始化如下:vartestingArray=[[String:String]()]testingArray.append(["name":"Ethiopia","url":"localhost:8088"])testingArray.append(["name":"Bugatti","url":"localhost:8088"])testingArray.append(["name":"Brazil","url":"localhost:8088"])testingArray.append(["name":

ios - 如何在 Swift 中从 "without navigation bar view controller"转到 "with navigation bar view controller"

我有一个项目,它有很多viewcontrollers,例如StartViewController(有导航栏)。此外processViewController和processViewController有很多views而processViewController没有导航栏.processViewController有关闭按钮和操作;@IBActionfuncgoStart(sender:UIButton){letsecondViewController=self.storyboard?.instantiateViewControllerWithIdentifier("StartViewC

iOS 8 : Autorotation is not working without storyboard

所以我试图开始一个没有Storyboard的项目,但我似乎无法弄清楚为什么UIWindow没有将自动旋转命令传递给RootViewController。使用Storyboard,自转有效。如果我以编程方式创建窗口,则自动旋转不起作用。这就是我在AppDelegate中实例化窗口的方式:window=UIWindow(frame:UIScreen.mainScreen().bounds)ifletwindow=window{window.backgroundColor=UIColor.whiteColor()window.makeKeyAndVisible()letnc:SignInVi

ios - Firebase 屏幕跟踪两次调用 "screen_view"事件

我尝试使用FirebaseAnalytics的屏幕跟踪功能。这是我的应用程序中屏幕的代码。我想跟踪到此屏幕的转换,并在viewDidAppear中设置原始屏幕名称。importUIKitimportFirebaseclassSection1412:UIViewController{overridefuncviewDidAppear(_animated:Bool){super.viewDidAppear(true)Analytics.setScreenName("Sceeen1.4.1.2",screenClass:"Section1412")}overridefuncdidReceiv