4000のワーニングと戦え!これは警告だ! / 4000 Warnings

473b12ebcfb79adfaef97796e94fc25c?s=47 Hiron
November 16, 2018

4000のワーニングと戦え!これは警告だ! / 4000 Warnings

473b12ebcfb79adfaef97796e94fc25c?s=128

Hiron

November 16, 2018
Tweet

Transcript

  1. ͷϫʔχϯάͱઓ͑ ʂ 
 ͜Ε͸ܯࠂͩ ʂ  .PCJMF"DU04","

  2. ࣗݾ঺հ w ͻΖΜʢҰٶߒڭʣ w 5XJUUFS (JU)VC 2JJUB 
 4MJEF4IBSF 4QFBLFS%FDL


    ˠIJSPOZUJD w גࣜձࣾ.FUB.P+Jʢಙౡۈ຿ʣ
  3. ࠓ೥ͷग़དྷࣄ IUUQTNPOFZGPSXBSEDPNFOHJOFFST@CMPHPQUJPOBM

  4. ࠓ೥ͷग़དྷࣄ ඇৗʹେ͖ͳαΠζͷ13Ͱ͋ͬͨ͜ͱ΍ɺഁյతมߋ͕ߦΘΕͨ4XJGU΁ͷରԠͩͬͨ͜ͱɺͦ΋ ͦ΋ݹ͔͘Βӡ༻͞Ε͍ͯΔϓϩμΫτͰ͋Δ͕Ώ͑ͷେྔͷܯࠂΛશͯ௵͖͠Ε͓ͯΒͣɺͦͷ·· ຒ΋Εͯ͠·ͬͨͱ͔͠ݴ͍Α͏͕ͳ͘ɺͱͯ΋ஏ͔͍ͣ͠ݶΓͰ͢ɻ IUUQTNPOFZGPSXBSEDPNFOHJOFFST@CMPHPQUJPOBM

  5. ࠓ೥ͷग़དྷࣄ ඇৗʹେ͖ͳαΠζͷ13Ͱ͋ͬͨ͜ͱ΍ɺഁյతมߋ͕ߦΘΕͨ4XJGU΁ͷରԠͩͬͨ͜ͱɺͦ΋ ͦ΋ݹ͔͘Βӡ༻͞Ε͍ͯΔϓϩμΫτͰ͋Δ͕Ώ͑ͷେྔͷܯࠂΛશͯ௵͖͠Ε͓ͯΒͣɺͦͷ·· ຒ΋Εͯ͠·ͬͨͱ͔͠ݴ͍Α͏͕ͳ͘ɺͱͯ΋ஏ͔͍ͣ͠ݶΓͰ͢ɻ IUUQTNPOFZGPSXBSEDPNFOHJOFFST@CMPHPQUJPOBM

  6. Θ͔Δʙ

  7. w ࣮͸͜ͷ͜ΖɺฐࣾͷϓϩμΫτ΋
 ܯࠂ͕࢒ͬͨ··ʹͳ͍ͬͯͨ
 ʢͨͩ͠ɺ0CKFDUJWF$ʣ w Ұ౓͸ܯࠂΛ΄΅θϩʹ͍ͯͨ͠ͷ͕ͩɺ
 9DPEFͷόʔδϣϯΞοϓΛڥʹɺ
 ͍ͭͷؒʹ΍Β૿͍͑ͯͨʢݸʣ

  8. IUUQTUXJUUFSDPN@NPOPTUBUVT

  9. ͦͷ௨Γͩʜʂ

  10. ͬͦ͘͞ܯࠂআڈʹͱΓ͔͔Δ ͱ͸͍͑ w ܯࠂআڈ͚ͩߦ͏·ͱ·ͬͨ࡞ۀظؒ͸֬อͰ͖ ͦ͏ʹͳ͍ͷͰɺ߹ؒͰͪΐͪ͜ΐ͜࡞ۀ w νʔϜϝϯόʔؒͷԹ౓ࠩ ܯࠂআڈΛ੝Γ্͛Δඞཁ͋Γʂ

  11. 4MBDLʹνϟϯωϧΛ࡞ͬͨ

  12. ܯࠂ਺ͷભҠΛՄࢹԽ

  13. ܯࠂΛফͬͯ͢Ͳ͏͍͏͜ͱʁ w ܯࠂˠจ๏తʹ͸ؒҧ͍ͬͯͳ͍͕ɺϓϩάϥ ϜϛεͷՄೳੑ͕͋Δ෦෼ͷࢦఠ w ܯࠂΛফ͢ˠ໰୊͕͋Ε͹मਖ਼͢Δɻ
 ͳ͚Ε͹ͦ͜ʹ໰୊͕ͳ͍͜ͱΛҙࢥදࣔ͢Δɻ

  14. ҙࢥදࣔͷྫ UISwitch *hideSw = ... if (!hideSw.on != [defaults boolForKey:@"visible"])

    { ... } if (!(hideSw.on != [defaults boolForKey:@"visible"])) ͷؒҧ͍͡Όͳ͍ͷʁͬͯ৺഑͞Ε͍ͯΔ Logical not is only applied to the left hand side of this comparison ˞9DPEFͰ͸͜ͷྫͰ͸ܯࠂ͕ग़·ͤΜͰͨ͠ UISwitch *hideSw = ... if ((!hideSw.on) != [defaults boolForKey:@"visible"]) { ... } ɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹʜͷͰ ΧοίΛ͚ͭͯͦ͏͡Όͳ͍ͱҙࢥදࣔ
  15. ॱௐʹܯࠂ਺ΛݮΒ͍ͯͨ͠ͷ͕ͩʜ

  16. 9DPEF΁Ξοϓσʔτ

  17. 9DPEF΁Ξοϓσʔτ ܯࠂ਺͕Λ௒͑ͨʂ Χϯετ

  18. *NQMJDJUSFUBJOPGTFMGXJUIJOCMPDLT w self͕҉໧తʹڧࢀর͞ΕΔΑɺͱ͍͏ܯࠂ w ΫϥεͷΠϯελϯεม਺ΛϒϩοΫͷதͰࢀর ͍ͯ͠Δͱ͜ΖͰग़Δ w ॥؀ࢀরͷૣظݕग़ʹ໾ཱͭ

  19. *NQMJDJUSFUBJOPGTFMGXJUIJOCMPDLT @interface ViewController : UIViewController { WaitView *_waitView; } ...

    @end ΫϥεͷΠϯελϯεม਺ ˞ݱࡏ͸ɺΠϯελϯεม਺͸࢖Θͣʹɺ
 ϓϩύςΟΛ࢖͏͜ͱ͕ਪ঑͞Ε͍ͯ·͢ɻ
  20. *NQMJDJUSFUBJOPGTFMGXJUIJOCMPDLT [AsyncUtils performActionOnMainThread:^{ _waitView.hidden = NO; }]; ϒϩοΫͷதͰ
 Πϯελϯεม਺Λࢀর _waitView͕ڧࢀর͞ΕΔͷͰ͸ͳͯ͘ɺ


    self͕ڧࢀর͞ΕΔ [AsyncUtils performActionOnMainThread:^{ self->_waitView.hidden = NO; }]; self->Λิ͑͹ɺҙࢥ දࣔʹΑΓܯࠂΛফͤΔ
  21. ͳͥ݅΋ w 6*εϨουͰಉظతʹ࣮ߦ͢ΔϢʔςΟϦςΟϝ ιουΛ࡞͍ͬͯͨʢ4XJGUͳΒ@noescapeʣ w ίϯύΠϥ͕ಉظత͔Ͳ͏͔Θ͔Βͳ͍ͷͰɺ͢ ΂ͯܯࠂ͕ग़Δ w ͬ͟ͱݟͯɺͱ͘ʹ໰୊ͳ͍Օॴ͕ଟ͍

  22. ͜ͷܯࠂɺͲ͏ղܾ͢Δ͔ʁ "Ҋ໛ൣతͳղܾࡦʢ݅΋ͳ͚Ε͹ʣ w ܯࠂ͕ग़͍ͯΔՕॴΛਓ͕ؒݟͯ
 ໰୊͕ͳ͚Ε͹self->Λิ͏ w ղܾʹ͕͔͔࣌ؒΓ͗ͯ͢ɺ
 େྔͷܯࠂঢ়ଶ͕͋ͨΓ·͑ʹͳͬͯ͠·͏৺഑

  23. ͜ͷܯࠂɺͲ͏ղܾ͢Δ͔ʁ #Ҋ͜ͷܯࠂ͸ࣺͯΔ w ϓϩδΣΫτઃఆͰ*NQMJDJUSFUBJOPGTFMG XJUIJOCMPDLTͷܯࠂΛ/Pʹ͢Δ w ࠓޙ࣮૷͢Δ෦෼Ͱ΋ܯࠂ͕ग़ͳ͍

  24. ͜ͷܯࠂɺͲ͏ղܾ͢Δ͔ʁ $Ҋैདྷͷίʔυʹ͸໨ΛᛉΔ w ద౰ͳεΫϦϓτΛॻ͍ͯɺ
 ܯࠂ͕ग़͍ͯΔͱ͜ΖʹػցతʹTFMGΛิ͏ w ҙࢥදࣔͨ͜͠ͱʹͳΓɺ͜Ε͸ਖ਼͍͠ͱ͍͏
 ʮ͓๽෇͖ʯΛ༩͑ͯ͠·͏͜ͱʹͳΔ w ࠓޙͷ࣮૷Ͱ͸ܯࠂ͕ػೳ͢Δ

  25. ͜ͷܯࠂɺͲ͏ղܾ͔ͨ͠ʁ w "Ҋͱ$Ҋͷ྆ํΛ෦෼࠾༻ͨ͠ɻ w ֬ೝ͢Δҙࢥͷ͋Δ୲౰ऀʹ͸֬ೝͯ͠΋Βͬͯ खಈͰself->Λิͬͯ΋Β͏ɻ w ͦΕҎ֎ͷ෦෼͸ɺػցతʹself->Λิ͏ɻ ʢΑ͘ͳ͍͜ͱͱೝ্ࣝͨ͠Ͱ૬ஊͷ݁Ռʣ

  26. ͦΜͳ͜Μͳ
 ͋ͬͯ

  27. ܯࠂ਺ʹ౸ୡ

  28. ͦͷޙͷܯࠂΛ૿΍͞ͳ͍ͨΊʹ w ܯࠂΛΤϥʔѻ͍ʹ͢Δʁ
 ʢ5SFBU8BSOJOHTBT&SSPSTΛ:FTʹʣ ‎σόοά࣌ʹ൥Θ͍͠ͷͰ͸ʁ w $*ͰͷϏϧυ࣌ʹݶΓɺܯࠂΛΤϥʔѻ͍ʹ w ܯࠂΛग़ͨ͠··ʹ͢Δͱ$*ʹౖΒΕΔ

  29. ·ͱΊ w ܯࠂআڈͷϞνϕʔγϣϯΞοϓઓུ w ܯࠂΛফ͢ͱ͸ʁˠίʔυʹର͢Δҙࢥදࣔ w 9DPEFͷόʔδϣϯΞοϓʹ൐͏݅ͷܯࠂ
 ϝϦοτɾσϝϦοτΛݕ౼ͯ͠ରॲ w ܯࠂΛ૿΍͞ͳ͍ͨΊͷ޻෉

  30. IUUQTUPLVTIJNBBQQDPOOQBTTDPNFWFOU ݄೔ʹ͸ୈճΛ༧ఆʂ