草庐IT

remove_reference

全部标签

ios - swift 数组 : how to append element references in order to update element later on from a synch request?

[更新]我添加了实际的代码片段以使我的问题更清楚。假设我们想将uiimages存储到一个数组中,这些数组是从互联网上获取的。我有这段代码://Somewhereinaloop{varstory=Story()story.imgUrl="http:\(imgUrl)"///Donwloadimage,andreplaceinthetopifletimgUrl=story.imgUrl{ifleturl=NSURL(string:imgUrl){letrequest=NSURLRequest(URL:url)NSURLConnection.sendAsynchronousRequest(r

ios - 在处理关系 Segue 时,iOS 8 的 "Storyboard Reference"的替代方案?

我的应用程序有一个包含4个选项卡的TabBarViewController。其中一个选项卡是“设置”,我想将其移至单独的Storyboard。如果我只考虑iOS9及更高版本作为我的部署目标,那么我可以使用StoryboardReference重构SettingsTab。但是我也想针对iOS8。由于StoryboardReference不支持RelationshipSegue,因此在这种情况下我不能依赖它。所以在包含TabBarViewController的主Storyboard中,我保留了一个虚拟的SettingsTabViewController作为空占位符。在其类文件中的函数"vi

class - swift 类 : reference cycle

当我运行下面的程序时,它会产生段错误。你能帮我弄清楚为什么吗?谢谢classAnimal:NSObject{varname:String!varage:UInt!weakvarspouse:Animal?init(name:String,age:UInt){self.name=nameself.age=age}funcdescription()->String{//tobecomeprintablereturn"name=\(name)andage=\(age)spouse=\(spouse)"}}letdog=Animal(name:"Lucky",age:3)letcat=Anim

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

ios - "Ambiguous reference to member map"来自具体类型

这是我的代码。它使用来自CoreBluetooth的CBUUID。让我们假设v的转换是有效的。importUIKitimportCoreBluetoothfuncconvert(v:AnyObject)->[String:String]{return(vas![CBUUID:NSData]).map{(uuid,data)in(uuid.UUIDString,NSString(data:data,encoding:NSUTF8StringEncoding)??"")}}想法是通过为CBUUID调用CBUUID.UUIDString并通过调用适当的NSString构造函数来获取字典的字符

ios - Swift + Storyboard : How to keep strong reference to show segue controller?

我有两个Controller:HistoryViewController,它有一个“浏览”按钮。这嵌入在NavigationController中WebBrowserViewController,将通过HistoryViewController中的浏览按钮访问浏览按钮连接正常。当我点击它时,它会将我带到网络浏览器ViewStoryboard。但是,当我按下返回键并再次点击“浏览”按钮时,它总是会生成一个新的Web浏览器View。因此,如果我在Web浏览器View中的某个页面上返回历史View,然后再次点击“浏览”,我总是会返回主页并丢失当前页面。有没有一种方法可以保持对WebBrows

xcode - iOS8.0 的 CompileSwift 状态为 "the current deployment target does not support automated __weak references"

我正努力在Swift应用程序中使用静态库(从ObjectiveC编译)。我有一个包含相关header的ObjectiveC桥接header。构建应用程序时出现此错误../someDirectory/Xcode/FirstSteps/headers/Acme.h:89:thecurrentdeploymenttargetdoesnotsupportautomated__weakreferencesAcme类确实使用弱引用,但部署目标是iOS8.0,它应该支持它们。我是不是找错树了?Acme.h的第89行显示:-(void)addTopicListener:(__weakNSObject*

ios - 段错误 : 11 - Cross-reference to module

我正在尝试通过对模块的交叉引用来解决段错误。不知道如何使这项工作。部分错误如下:1.Whilereadingfrom/Users/damiandudycz/Library/Developer/Xcode/DerivedData/Hypno-azmcjycezcoqnfauqcbgimvipjyj/Build/Intermediates/Hypno.build/Debug-iphonesimulator/Hypno.build/Objects-normal/x86_64/WorldObjectBasedAugmentedRealityObject~partial.swiftmodule2

ios - 核心数据 : error: Mutating a managed object after it has been removed from its context

我构建了一个简单的应用程序来检索一些JSON并将数据存储在核心数据中。在模拟器或设备上初始安装时,所有CoreData操作都很好,但在重新运行时,我收到以下错误消息:2016-07-0213:23:53.925EnYakın[84775:5379467]CoreData:error:Mutatingamanagedobject0x79736290(0x79736250)afterithasbeenremovedfromitscontext.目测没有问题。所有数据均按预期显示,应用程序正常运行。我调试了这个问题。如果我注释掉JSON检索函数并让应用程序在初始运行后使用核心数据中的内容,则

swift : Regex for remove all inline HTML attributes

我想清除HTML字符串文本中的所有属性。我找到了很多答案,但问题是如果我们没有正确的CSS样式,正则表达式的语法将无法工作。我的处境很困难,因为从API获取的HTML文本与其样式不符。可能是这样的:AngkorWatisatemplecomplexinCambodiaandthelargestreligiousmonumentintheworld,onasitemeasuring162.6hectares(1,626,000m2;402acres).ItwasoriginallyconstructedasaHindutemplededicatedtothegodVishnuforthe