ios - MBProgressHUD crash in [MBProgressHUD done] -


i using mbprogresshud in app. receive crash logs crash reporter system,

cloudoc-patient -[mbprogresshud done] (mbprogresshud.m:376) 1devices app version: - thread 0 crashed: 0 libobjc.a.dylib 0x197350000 + 113616 1 cloudoc-patient -[mbprogresshud done] (mbprogresshud.m:376) 2 uikit 0x18a0f0000 + 295108 3 uikit 0x18a0f0000 + 294860 4 quartzcore 0x189a2c000 + 87596 5 libdispatch.dylib 0x1979d4000 + 6484 6 libdispatch.dylib 0x1979d4000 + 25100 7 corefoundation 0x18555c000 + 914756 8 corefoundation 0x18555c000 + 906732 9 corefoundation 0x18555c000 + 36724 10 graphicsservices 0x18efb4000 + 46844 11 uikit 0x18a0f0000 + 486804 12 cloudoc-patient main (main.m:23) 13 libdyld.dylib 0x197a00000 + 10760 

in xcode-->organizer-->crashes, after locating code, thatcrash code use in uiviewcontroller category

- (void)showloadinghud { if(!self.view) {     return; } mbprogresshud *hud = [mbprogresshud showhudaddedto:self.view animated:yes]; hud.removefromsuperviewonhide = yes; hud.mode = mbprogresshudmodeindeterminate; } - (void)hidehud { if(!self.view) {     return; } [mbprogresshud hideallhudsforview:self.view animated:no]; } 

can me?

my way use:

@property (strong, nonatomic) mbprogresshud *hud; 

and then

#pragma mark - datamanager - - (void)getdata {  if (![self.hud ishidden]) {     [self.hud hideanimated:yes]; } self.hud = [mbprogresshud showhudaddedto:self.view animated:yes];  [xxxdatamanager xxxwithrequestmodel:self.xxxrequestmodel completion:^(bool success, id  _nullable result, nserror * _nullable error) {      [self.hud hideanimated:yes];      if (success) {         ...     }     else {         ...     } }];} 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -