Note that there are some explanatory texts on larger screens.

plurals
  1. POxCode cocoa: MBProgressHUD or ZAActivityBar in one place appear only after performing function, but should during
    primarykey
    data
    text
    <p>I try to use <strong>MBProgressHUD</strong> or <strong>ZAActivityBar</strong> as <strong>progress bar</strong> in my cocoa project. All fine, but in one place this <strong>progress bar view</strong> appear only after performing function from singleton class, but should during.</p> <pre><code>-(IBAction)importButtonClicked:(id)sender { //[ZAActivityBar showSyncWithStatus:NSLocalizedString(@"MBProgressHUDLabel", nil) forAction:@"importButtonClicked"]; [MBProgressHUD showHUDAddedTo:self.view animated:YES]; int count=0; count=[[CoreDataHelper helperCoreDataHelper] saveImportedFriends:_importedFriendsDictionary withOnlyDate:_onlyDateSwitcher withRewrite:(int)_rewriteSwitcher]; //[ZAActivityBar dismissSyncForAction:@"importButtonClicked"]; [MBProgressHUD hideHUDForView:self.view animated:YES]; } </code></pre> <p>CoreDataHelper.m</p> <pre><code>-(int)saveImportedFriends:(NSMutableSet*)set withOnlyDate:(int)withDate withRewrite:(int)rewrite { int count=0; for(FriendsForImport* friendsForImport in set) { if((withDate==1 &amp;&amp; friendsForImport.birthday.length&gt;0) || withDate==0) { Friends *friendsExist=[self checkFriendAlreadyExist:friendsForImport]; if((friendsExist.lastName.length&gt;0 || friendsExist.firstName.length&gt;0) &amp;&amp; rewrite==0) continue; else if((friendsExist.lastName.length&gt;0 || friendsExist.firstName.length&gt;0) &amp;&amp; rewrite==1) [self deleteFriendAlreadyExist:friendsExist]; UIImage *image; if([friendsForImport.importFrom intValue]==1) { image = [[UIImageHelper helper] getUIImageFromAddressBookContactId:[friendsForImport.uid integerValue]]; } else image = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:friendsForImport.photoPath]]]; NSString *imageName=@""; if(image.size.height&gt;0) imageName=[[UIImageHelper helper] saveImage:[[UIImageHelper helper] resizedImage:image withRect:CGRectMake(0, 0, kAvatarSize, kAvatarSize)]]; Friends *friends= (Friends *)[NSEntityDescription insertNewObjectForEntityForName:@"Friends" inManagedObjectContext:_managedObjectContext]; friends.lastName=friendsForImport.lastName; friends.firstName=friendsForImport.firstName; friends.uid=[NSString stringWithFormat:@"%@",friendsForImport.uid]; friends.birthday=[[CoreDataHelper helperCoreDataHelper] properDateString:friendsForImport.birthday]; friends.alarm=[NSNumber numberWithInt:1]; friends.important=NO; friends.photoPath=imageName; friends.importFrom=friendsForImport.importFrom; friends.importDate=[NSDate date]; //NSLog(@"friends %@",friends); NSError *error = nil; if (![_managedObjectContext save:&amp;error]) { NSLog(@"Error in adding a new bank %@, %@", error, [error userInfo]); abort(); } count++; } } return count; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload