Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

Hiron
November 16, 2018

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

Hiron

November 16, 2018
Tweet

More Decks by Hiron

Other Decks in Programming

Transcript

  1. ҙࢥදࣔͷྫ 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"]) { ... } ɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹʜͷͰ ΧοίΛ͚ͭͯͦ͏͡Όͳ͍ͱҙࢥදࣔ
  2. *NQMJDJUSFUBJOPGTFMGXJUIJOCMPDLT @interface ViewController : UIViewController { WaitView *_waitView; } ...

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


    self͕ڧࢀর͞ΕΔ [AsyncUtils performActionOnMainThread:^{ self->_waitView.hidden = NO; }]; self->Λิ͑͹ɺҙࢥ දࣔʹΑΓܯࠂΛফͤΔ