草庐IT

values_available

全部标签

iphone - 新的 Swift 应用程序列表器错误 : "No matching provisioning profiles found", "App ID with Identifier ... is not available"

我从Apple的开发者网站下载了Lister应用程序的示例代码,并尝试为运行iOS8Beta5的iPhone5S构建Swift版本。我已将所有内容更改为com.mycompany.Lister,但是当我尝试构建它时,出现以下错误。未找到匹配的配置文件没有一个有效的配置文件允许指定的权利:com.apple.developer.ubiquity-container-identifiers。Xcode可以通过从成员(member)中心下载新的配置文件来解决此问题。所以我点击“修复问题”,它加载了几秒钟并返回给我这条消息:标识符为“com.example.apple-samplecode.L

ios - alamofire post 方法中的 response.result.value 为 nil

letparametersDictionary=["email":"name@gmail.com","password":"password"]Alamofire.request("http://nanosoftech.com/store/user_check",method:.post,parameters:(parametersDictionaryasNSDictionary)as?Parameters,encoding:JSONEncoding.default,headers:nil).responseJSON{responseinprint("response:",respon

IOS FoodTracker 教程 : Value of tuple type '()' has no member 'path'

我正在完成IOSSwift教程“FoodTracker”,但是有一个错误我可以找到解决方案,但我不明白哪里出了问题以及如何解决它:错误:Valueoftupletype'()'hasnomember'path'此错误在以下代码中针对变量“Meal.ArchiveUrl.path”显示。我的代码,在MealtableViewController(相当于IOS教程):privatefuncsaveMeals(){letisSuccessfulSave=NSKeyedArchiver.archiveRootObject(meals,toFile:Meal.ArchiveUrl.path)if

ios - Obj-C 框架返回 nil,并使我的 Swift 代码崩溃并显示 'fatal error: unexpectedly found nil while unwrapping an Optional value'

我正在使用用Obj-C编写的第三方框架,它有一个功能:-(NSError*)generateModelForm如果此方法成功,它将返回nil。如果它不返回nil,它将返回一个错误,您可以检查该错误以进行调试。现在,当我使用桥接头在我的Swift文件中调用此函数并执行所有必需的操作时,它总是在第一行崩溃并显示“fatalerror:在展开可选值时意外发现nil”我的Swift代码:ifleterror=object.generateModelForm(){println("Error:\(error)")}else{println("Successfullygeneratedmodelf

ios - 如何在 swift 中使用 Key Value Observer?

为了我的目的,我设置了AVFoundation来拍照,我想确保在保存imagedata之前完成曝光和白平衡(adjustingExposure,adjustingWhiteBalance)的调整。否则第一张照片会显得很暗。如何设置键值观察器以在值更改后运行代码?以及如何/在哪里是启动它的最佳地点? 最佳答案 在你得到图像后用didSet创建一个var并且那个var保存图像例如varimage:UIImage{//orwhattypeyourimageis,MabyNSData,butI'mnotsuredidSet{//adjust

ios - UIButton 中的 Swift 3D Touch Force Value

如何测量应用于UIButton功能的3D触摸力?我想用它来快速更改AVAudioPlayer属性的音量。 最佳答案 您可以为所有UIView类\子类使用识别3D触摸的东西自定义类classcustomButton:UIButton{overridefunctouchesMoved(touches:Set,withEventevent:UIEvent?){fortouchintouches{print("%Touchpressure:\(touch.force/touch.maximumPossibleForce)");}}overr

Vue 解决报错 You are using the runtime-only build of Vue where the template compiler is not available.

报错信息[Vuewarn]:Youareusingtheruntime-onlybuildofVuewherethetemplatecompilerisnotavailable.Eitherpre-compilethetemplatesintorenderfunctions,orusethecompiler-includedbuild.您正在使用Vue的仅运行时版本,并而模板编译器不可用。可以将模板预编译为渲染函数,也可以使用包含编译器的内部版本在主入口渲染的组件方式不一样,上面这种是采用的render函数渲染,没有进行runtime-only配置,所以报错了。解决方案在vue.config.

ios - 使用@available 有条件地创建一个类

我有一个用例,创建一个类的两个实现非常有用:一个用于iOS7及以下版本,另一个用于8+。@available似乎是我正在寻找的工具,但我不知道如何让它工作。从文档看来这应该是可能的:@available(iOS8.0,unavailable)classMyCompatabilityClass:NSObject{//iOS7implementation}@available(iOS8.0,*)classMyCompatabilityClass:ClassOnlyAvailableInIOS8{//iOS8implementation}但是我在@available(iOS8.0,unava

swift - "Cannot assign value of type ' 整数 ' to type ' 单位 ' "

letexpdate=NSUserDefaults.standardUserDefaults().objectForKey("expiration")as!NSDateletcalendar=NSCalendar.currentCalendar()letcomponents=calendar.components([.Day,.Month,.Year],fromDate:expdate)vartheyear=components.yearvarthemonth=components.monthstripCard.expMonth=themonthstripCard.expYear=th

ios - 为什么我得到 "entity X is not key value coding-compliant"?

当我运行以下代码时:letsaveAction=UIAlertAction(title:"Save",style:.default){[unownedself]actioninguardlettextField=alert.textFields?.first,letmapName=textField.textelse{return}varnewCoordinate=NSEntityDescription.insertNewObject(forEntityName:"Coordinates",into:managedObjectContext)varnewMap=NSEntityDesc