Swift Fun Algorithms: Retain Cycle Correction!

Поділитися
Вставка
  • Опубліковано 1 січ 2025

КОМЕНТАРІ • 58

  • @CaffieneToCode
    @CaffieneToCode 7 років тому

    Hey Brian
    We all make mistakes, what matters is how we react when we know about our mistakes. Your efforts to address the mistake and even publish a video with correction is inspiring. You are an InsPiratIon!!.
    Your statement, "Programming is like a muscle, the more you train, the more stronger it gets." in your video, 'I feel like I am just copying code' is a inspiring quote for me.

  • @antonlebedev2890
    @antonlebedev2890 Рік тому

    Wow, this apartment/tenat example gives a good idea of how Floyd's cycle detection algorithm could be implemented in reality! Thanks a lot!

  • @EagleTrue
    @EagleTrue 7 років тому +7

    It's great you've made that mistake. I have a better understanding of retain cycle now.

    • @umangjeet
      @umangjeet 4 роки тому

      but the bad part is the old video is still up and comes as a top result :/

  • @anjalishah4554
    @anjalishah4554 5 років тому

    This tutorial made me clear about referencing count mechanism and retain cycle. Great....

  • @techaztech2335
    @techaztech2335 7 років тому

    I saw the two Retain Cycle videos a couple of days ago and lo and behold I am facing a retain cycle myself in a quite complicated manner in my project right now. 😥 The explanation is helpful so far and I think I am getting close.

  • @MegaGandalf99
    @MegaGandalf99 7 років тому +6

    Thank you for taking the time and correction the mistake! I really do appreciate it. Maybe you can do a video on the UIPanGestureRecognizer some time, with interactive view controllers. So that you can drag it up for example and then just let it finish its animation?
    Have a good day! :)

  • @balajigalave956
    @balajigalave956 7 років тому +1

    Thanks Brian. This one is correct as per Apple documentation. Thanks again for taking time for the same.

  • @MikeMartinezR
    @MikeMartinezR 7 років тому

    Awesome and humble at the same time. Keep up the good work!!! Ps here is an idea for a video, grab a string of numbers with the camera using visual api, passing it through a validation algorithm and capturing that string of numbers. (Posible use to capture bank account details from an invoice)

  • @afaaqahmedsaqi
    @afaaqahmedsaqi 3 роки тому

    Amazing work, because of your mistake I understand better!
    I really appreciate your effort Brian 💝

  • @sheingng1495
    @sheingng1495 7 років тому

    Now it make more sense and see how the weak variable function in the retain cycle! Thanks

    • @LetsBuildThatApp
      @LetsBuildThatApp  7 років тому

      +Stanley Ng yes much easier to understand after this correction

  • @rumitification
    @rumitification 6 років тому

    Superb Brian, loved that you came back with the correction :)

  • @amari9773
    @amari9773 7 років тому

    Mistakes happen man! Really love and support your channel. Keep it going, please! :)

  • @rogerwprice
    @rogerwprice 7 років тому +1

    Thanks for the fix. Bugs happen and this is a tricky one...indeed the two objects need to point to eachother to get the retain cycle...

    • @LetsBuildThatApp
      @LetsBuildThatApp  7 років тому +1

      Thanks, it was really bugging me over the weekend.

  • @lokeshpurohitrandom
    @lokeshpurohitrandom 5 років тому

    your mistake make me learn more onto Strong reference holding to object without Retain cycle :). But I got to know about it only when I read the comments in the wrong one and also when I read video description (probably should make a habit of reading description too from now on.). thanks again for correction video and the wrong one.

  • @abdulkadermu72
    @abdulkadermu72 7 років тому +1

    Great video!, would be great if you could talk about protocol oriented programming in Swift

  • @gpathak
    @gpathak 7 років тому

    Thanks for the correction video! Glad to see you were quick to correct a mistake. It might be valuable to demonstrate a retain cycle example with Closures

    • @LetsBuildThatApp
      @LetsBuildThatApp  7 років тому

      You're welcome. Closure cycle will be this Friday's video.

  • @christostsangaris4785
    @christostsangaris4785 6 років тому

    Episode one was a demonstration of Retail half-cycle! Episode two just completed the cycle! @brian: the only one who doesnt do mistakes is the one who does nothing.

  • @HairyPixels
    @HairyPixels 7 років тому

    Assigning objects in Swift implicitly increments their retain count. In your original example you did what is best described as not balancing retain count and thus made a memory leak scenario.

  • @miguelchavez2768
    @miguelchavez2768 7 років тому

    Thanks Brian for all the videos! You have really taught me a lot!! B4 I started watching ur videos I never thought I would make apps and now I'm on my way to making my 3rd app! THANKS!
    The only problem I've been facing is custom transition form UIviews. All the videos I find use storyboards and it's hard for me to follow. Could you make a video on how to make custom segue/transition not using the storyboard? Plz and thanks

  • @riklowe
    @riklowe 7 років тому +1

    Excellent - this is a lot clearer. Thanks

  • @HerbivoreJesus
    @HerbivoreJesus 7 років тому

    Hey Brian, how do you go about paginating when you reach the top of a collection view? I've built a chat and I thought about somehow detecting when I reach the top of the collection view and then make an API call with a limit or date to bring the previous 10 or so elements. Do you have any tutorials on this by any chance ?

  • @marcaupont9145
    @marcaupont9145 7 років тому +1

    Awesome explanation!!

  • @nameless88812
    @nameless88812 7 років тому

    How did you arrived at setting the weak reference on tenant property of Apartment instead of apartment property of class Person? What's the difference?

    • @LetsBuildThatApp
      @LetsBuildThatApp  7 років тому

      You can read the retain cycle guide at the swift/apple documentation site for more details.

  • @abhilashghogale3731
    @abhilashghogale3731 7 років тому

    Thank you so much for video.
    One question, why all var and let are not weak by default ??

    • @zb1123
      @zb1123 5 років тому

      Think it through, if you create a variable that is weak, in that instance there is only that weak reference to it, so it is immediately deallocated.

  • @YoelEphotography
    @YoelEphotography 7 років тому

    We are all human, thank you !

  • @jonahwitcig2628
    @jonahwitcig2628 7 років тому

    Do you ever have issues with Xcode autocomplete and syntax coloring? Seems like every few changes I make, the editor crashes and I'm stuck looking up method names manually.

    • @LetsBuildThatApp
      @LetsBuildThatApp  7 років тому

      +Jonah Witcig Xcode is well known for being buggy

  • @calvinchankf
    @calvinchankf 7 років тому

    Nice!!! I like this, I was asked in a google interview and it is a very common question for interviewing a software engineer in tech giant and I would like to learn more about it
    can you give us more about demo of computer science concept in swift?
    e.g.
    - swift var thread-safe or not? (why we don't need to declare attribute "nonatomic" in swift)
    - how a swift singleton dealing with concurrency?

  • @moosegoose1282
    @moosegoose1282 7 років тому

    How does this work in real programs,, I don't think we will ever be explicitly deallocating things

    • @LetsBuildThatApp
      @LetsBuildThatApp  7 років тому

      Whenever you dismiss a controller or remove objects from an array, you implicitly deallocate them.

  • @theslimspeedster
    @theslimspeedster 7 років тому

    Hey Buddy! I need some of your help! I'm wanting to go into the tech world, and go to college to get a bachelors degree, but I'm not sure which one is right for me: Computer Science or IT? My goal is to work for Apple and help with their OS. I want to learn coding languages too! Can you help me

    • @LetsBuildThatApp
      @LetsBuildThatApp  7 років тому +1

      Sure thing, I'll provide you with all the help you need? What would you like first??

    • @theslimspeedster
      @theslimspeedster 7 років тому

      I'd like do you know which college or university to go to for either getting a computer science degree or an IT degree. Like I said I really want to work for Apple, so that's my main goal. Math is kind of hard for me, but I can still do pretty good

  • @waelluay6902
    @waelluay6902 7 років тому

    Thanks for the valuable info, keep it up

  • @markw496
    @markw496 7 років тому +2

    Yeah Brian I failed my interview! Just kidding glad you explained the issue. Atleast you are helping us noobies. Hey would you also know how to do memory leak tests?

  • @sanali6432
    @sanali6432 7 років тому +1

    Sounds good that Brian also make mistakes, i thought i was the only one in this world

    • @LetsBuildThatApp
      @LetsBuildThatApp  7 років тому +2

      Thanks for the support San.

    • @david-tracy
      @david-tracy 7 років тому +2

      Yeah man. Watching the teachers make mistakes is actually incredibly helpful, honestly

  • @krutomjer
    @krutomjer 7 років тому

    Thanks Brian :)

  • @maximax2397
    @maximax2397 7 років тому

    Just a question
    How do you write code so fast... I mean it takes you only a few seconds to see the code and change it, add , solve problems, fix bugs and so no.....For example, i finished your twitter app, i understand the code, and followed the serie without a problem... But no way on earth i could be able to write so many code lines, and so easy as you do ....
    is it just experience, or is it something that a person is born with?.. Couse i see you ability to code, and i compare to me that i am noob.....and it is like 2 different planets
    :( :( ......will i ever be able to code that smoth , as much code as you do ? is it only practice?..Sometimes i doubt that is only practice, and experience.....i think that you must be born with :( :(

    • @LetsBuildThatApp
      @LetsBuildThatApp  7 років тому +4

      +Massimo Valtino I've been doing this for ten years and prepare the material before each video. It's something you get better at over time.

    • @maximax2397
      @maximax2397 7 років тому

      I really hope so :)

  • @fswirecard5595
    @fswirecard5595 7 років тому +2

    Nice Video!! I wanted to ask of you could make a Video how to use a payment service in an App that means how to set it up and how it will work with prices so the payment Will Go to one bank account ...

  • @itscooldawgdonteventrip
    @itscooldawgdonteventrip 7 років тому

    ah I was not crazy this was a mistake phew :)