我有一个从桌面连接的segue,
pushVIEwController:animated:在现有转换或演示文稿发生时调用;导航堆栈将不会被更新.
class PlayListsVIEwController: UIVIEwController,UItableVIEwDelegate,UItableVIEwDataSource,UIGestureRecognizerDelegate {let ItemRecordname = "PlayLists"var playLists = NSMutableArray()@IBOutlet var tableVIEw: UItableVIEw?var cloudm = CloudManager()var container: CKContainer?var publicdatabase: CKDatabase?var edgePan = UIScreenEdgePanGestureRecognizer()overrIDe func vIEwDIDLoad() { super.vIEwDIDLoad() self.setUpMenu() container = CKContainer.defaultContainer() publicdatabase = container?.privateCloudDatabase self.tableVIEw!.contentInset = UIEdgeInsetsMake(64,0)}func setUpMenu() { self.slIDingVIEwController().topVIEwAnchoredGesture = EcslIDingVIEwControllerAnchoredGesture.Panning | EcslIDingVIEwControllerAnchoredGesture.TapPing //self.navigationController.vIEw.addGestureRecognizer(self.slIDingVIEwController().panGesture) edgePan = UIScreenEdgePanGestureRecognizer(target: self,action: "menubuttonTapped") edgePan.edges = UIRectEdge.left edgePan.delegate = self self.navigationController.vIEw.addGestureRecognizer(edgePan) self.navigationController.navigationbar.translucent = true let icon = FAKIonIcons.naviconIconWithSize(40) icon.addAttribute(NSForegroundcolorAttributename,value: UIcolor.whitecolor()) let iconImage = icon.imageWithSize(CGSizeMake(40,40)) let plusicon = FAKIonIcons.ios7PlusEmptyIconWithSize(30) plusicon.addAttribute(NSForegroundcolorAttributename,value: UIcolor.whitecolor()) let plusiconImage = plusicon.imageWithSize(CGSizeMake(30,30)) let barbutton = UIbarbuttonItem(image: iconImage,style: UIbarbuttonItemStyle.Plain,target: self,action: "menubuttonTapped") let barbutton2 = UIbarbuttonItem(image: plusiconImage,action: "opennameForPlayList") barbutton2.tag = 1 let negativeSpacer = UIbarbuttonItem(barbuttonSystemItem: UIbarbuttonSystemItem.Fixedspace,target: nil,action: nil) let negativeSpacer2 = UIbarbuttonItem(barbuttonSystemItem: UIbarbuttonSystemItem.Fixedspace,action: nil) negativeSpacer.wIDth = -10 negativeSpacer2.wIDth = 0.0 self.navigationItem.leftbarbuttonItems = NSArray(objects: negativeSpacer,barbutton) self.navigationItem.rightbarbuttonItems = NSArray(objects: negativeSpacer2,barbutton2)}overrIDe func vIEwDIDAppear(animated: Bool) { self.getPlayLists()}func menubuttonTapped () { self.slIDingVIEwController().anchortopVIEwToRightAnimated(true)}func getPlayLists() { cloudm.fetchPlayListnames("PlayLists",completionHandler: {(records: NSMutableArray) -> VoID in if records.count > 0 { println("got PlayLists") self.playLists = records self.tableVIEw?.reloadData() //self.noFoodLabelAlpa(0,withDuration: 0,withDelay: 0) } else { println("dont got PlayLists") //self.noFoodLabelAlpa(1,withDuration: 1,withDelay: 1.8) } })}overrIDe func dIDReceiveMemoryWarning() { super.dIDReceiveMemoryWarning() // dispose of any resources that can be recreated.}func opennameForPlayList() { var alert = UIAlertVIEw(Title: "PlayList name",message: "Please choose a name for your PlayList",delegate: self,cancelbuttonTitle: "Done") alert.alertVIEwStyle = UIAlertVIEwStyle.PlainTextinput alert.show()}func alertVIEw(alertVIEw:UIAlertVIEw,clickedbuttonAtIndex buttonIndex: NSInteger){println(alertVIEw.textFIEldAtIndex(0).text) addplayList(alertVIEw.textFIEldAtIndex(0).text)}func addplayList(name: String) { if playLists.count == 10 { var alert = UIAlertVIEw(Title: "PlayList is full",message: "You've reached the maximum number of songs in your playList,to add more please remove some",cancelbuttonTitle: "ok") alert.show() } else { println("playList count = \(self.playLists.count)") var newRecord: CKRecord = CKRecord(recordtype: ItemRecordname) //var playListname = "PlayList \(self.playLists.count + 1)" newRecord.setobject(name,forKey: "playListname") self.cloudm.saveRecord(newRecord) self.playLists.insertObject(newRecord,atIndex: 0) //self.playLists.addobject(newRecord) self.playLists.sortUsingDescriptors([NSSortDescriptor(key: "playListname",ascending: true)]) var indexPath = NSIndexPath(forRow: 0,inSection: 0) self.tableVIEw?.insertRowsAtIndexPaths([indexPath],withRowAnimation: UItableVIEwRowAnimation.automatic) }}func numberOfSectionsIntableVIEw(tableVIEw: UItableVIEw!) -> Int { return 1;}func tableVIEw(tableVIEw: UItableVIEw!,heightForheaderInSection section: Int) -> Int { return 1}func tableVIEw(tableVIEw: UItableVIEw!,vIEwForFooterInSection section: Int) -> UIVIEw { var vIEw = UIVIEw(frame: CGRect.zeroRect) return vIEw}func tableVIEw(tableVIEw: UItableVIEw!,heightForFootInSection section: Int) -> Int { return 1}func tableVIEw(tableVIEw: UItableVIEw!,numberOfRowsInSection section: Int) -> Int { return playLists.count}func tableVIEw(tableVIEw: UItableVIEw!,cellForRowAtIndexPath indexPath: NSIndexPath!) -> UItableVIEwCell! { let CellindentifIEr: Nsstring = "playListCell" var cell : UItableVIEwCell = tableVIEw.dequeueReusableCellWithIDentifIEr(CellindentifIEr) as UItableVIEwCell var selectedVIEw = UIVIEw(frame: CGRectMake(0,cell.contentVIEw.frame.size.wIDth,cell.contentVIEw.frame.size.height)) cell.selectedBackgroundVIEw = selectedVIEw cell.backgroundcolor = UIcolor.clearcolor() var records: CKRecord = self.playLists[indexPath.row] as CKRecord var playList:String = records.objectForKey("playListname") as String println("PlayLists are \(playList)") cell.textLabel.text = playList return cell}func tableVIEw(tableVIEw: UItableVIEw?,canEditRowAtIndexPath indexPath: NSIndexPath?) -> Bool { // Return NO if you do not want the specifIEd item to be editable. return true}func tableVIEw(tableVIEw: UItableVIEw!,commitEditingStyle editingStyle: UItableVIEwCellEditingStyle,forRowAtIndexPath indexPath: NSIndexPath!) { if editingStyle == .Delete { // Delete the row from the data source self.cloudm.deleteRecord(self.playLists[indexPath.row] as CKRecord) self.playLists.removeObjectAtIndex(indexPath.row) tableVIEw.deleteRowsAtIndexPaths([indexPath],withRowAnimation: .Fade) }}func tableVIEw(tableVIEw: UItableVIEw!,dIDEndEditingRowAtIndexPath indexPath: NSIndexPath!) { if playLists.count > 0 { //self.noFoodLabelAlpa(0,withDelay: 0) } else { //self.noFoodLabelAlpa(1,withDelay: 0) }}overrIDe func prepareForSegue(segue: UIStoryboardSegue!,sender: AnyObject!) { var indexPath = self.tableVIEw!.indexPathForSelectedRow() var record: CKRecord = self.playLists[indexPath.row] as CKRecord let playListOpen: PlayListsOpenVIEwController = segue.destinationVIEwController as PlayListsOpenVIEwController playListOpen.parentRecordID = record.recordID.recordname playListOpen.cloudm = self.cloudm}
}
更新:
好的,所以我已经安装了xcode beta 5,现在模拟器和我的手机都收到这个错误,这在这个版本之前不存在任何想法?
我决定把所有的EcslIDing都抛出窗外,重新开始使用SWRevealViewController.这个开关令人惊讶的是没有痛苦,把大约一个小时的工作花了一个约20K LOC的应用程序.这是我建议任何人遇到这个问题.
现在有一个修复合并到主分支.我会在这里发布,以供参考,它由SpruceGoose429提供,并附加于fcy Github上:
In
EcslIDingVIEwController.m
replace the following code:
- (ID<UIVIEwControllerTransitionCoordinator>)TransitionCoordinator { return self;}
With this block:
- (ID<UIVIEwControllerTransitionCoordinator>)TransitionCoordinator{ // Return self if a Transition is in progress (we're the Transition coordinator). // Otherwise,defer to super. return ((_TransitionInProgress)? self: [super TransitionCoordinator]);}
正如我所提到的那样,修复程序是EcslIDingVIEwController的2.0.3版本.
总结以上是内存溢出为你收集整理的ios – 推视图:当现有的转换或演示正在发生时;导航堆栈将不会被更新全部内容,希望文章能够帮你解决ios – 推视图:当现有的转换或演示正在发生时;导航堆栈将不会被更新所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)