WWDC22 SALE: Save 50% on all my Swift books and bundles! >>

SOLVED: iExpense freezes after adding item

Forums > 100 Days of SwiftUI

Completed the iExpense project and it works (almost) fine. After I add an item and click 'Save', the item is added to the list, but then the + and 'Edit' buttons don't work (nothing happens when I click them). If I exit the simulator and restart it, it works fine, for one more item.

Wondering if anyone else has had this experience.

1      

Might be able to help if you post the associated chunk of code or link to your project; also you might want to check if it is an unresolved Xcode bug or alike

1      

Sorry, I'm new to this. I have files with the code on my iCloud drive. How do I insert it into my reply so it looks like code (formatted, with the black background)? I tried pasting it, but it just went in as text.

1      

hi Pete,

it was routinely the case in most versions of XCode 11 that simulator + navigationbaritem with navigation links = not good. tapping on the nav bar button would work, then it wouldn't a second time. that may simply be what you are observing (you did not mention a version of XCode).

i went back to my completed iExpense project (XCode 11.6/iOS 13.6) and, indeed, tapping on the "plus" to add a second item is still unresponsive. however, if i swipe to delete (and it's not necessary that you actually delete) or do a "pull down to refresh" action, then tapping on the "plus" works again.

two things:

  • (i think) this behaviour was not ever present on a physical device -- it is unique to the simulator

  • the problem does not seem to be present in the simulator with XCode 12 beta 6/iOS 14

hope that helps,

DMG

1      

Thanks, DMG. I tried swiping left after adding and, sure enough, I could add another item. I suspected the problem was with the simulator.

I'm using Xcode 11.6.

Pete

1      

Save 50% in my Black Friday sale.

SAVE 50% To celebrate WWDC22, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.