Note that there are some explanatory texts on larger screens.

plurals
  1. POIPad--how to refresh subview on ipad?
    primarykey
    data
    text
    <p>I add 4 subviews(UIScrollView,UITableView)in main view on ipad, and each view has it own data.<br> In Marco view, I try to reload data from server every 3 second to refresh my Marco View.<br> as first pic..<br> <img src="https://i.stack.imgur.com/gzdKS.png" alt="enter image description here"></p> <p>I set 3 Marco icons on ipad main view, when I delete one on popoverView.<br> Icons on popoverView really delete, but still show up 3 icons on main view.<br> as second and third pic...<br> <img src="https://i.stack.imgur.com/RYsS9.png" alt="enter image description here"></p> <p><img src="https://i.stack.imgur.com/A701B.png" alt="enter image description here"></p> <p>It must be delete from background and then open app it gonna be correct view..<br> as fourth pic..<br> Dose any one know what's problem.. I try to use <code>[marco_scrollview setNeedsDisplay]</code> .<br> but it no work..<br> Thank in advance..<br> here is my code to get Marcodata: </p> <pre><code>- (void)getTheMacroURLData{ //[self.view setNeedsDisplay]; // [marco_scrollview setNeedsDisplay]; self.macroList = nil; NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; EnvoTouchAppDelegate *appDelegate = (EnvoTouchAppDelegate *)[[UIApplication sharedApplication] delegate]; struct sockaddr_in Addr; bzero(&amp;Addr, sizeof(Addr)); Addr.sin_len = sizeof(Addr); Addr.sin_family = AF_INET; SCNetworkReachabilityRef target = SCNetworkReachabilityCreateWithAddress(NULL, (struct sockaddr *) &amp;Addr); SCNetworkReachabilityFlags flags; SCNetworkReachabilityGetFlags(target, &amp;flags); if (flags &amp; kSCNetworkReachabilityFlagsIsWWAN){ //Serial Number not save in the keychain now NSString *theNewURLString = [NSString stringWithFormat:eGetAllMacrosSettingURL3G,[userDefaults objectForKey:@"ecsn"],appDelegate.udid]; NSURL *theNewURL = [NSURL URLWithString:theNewURLString]; self.macroList = [NSMutableArray arrayWithContentsOfURL:theNewURL]; } if (flags &amp; kSCNetworkFlagsReachable){ NSString *theNewURLString = [NSString stringWithFormat:eGetAllMacrosSettingURLWiFi,appDelegate.ipString,appDelegate.udid]; NSURL *theNewURL = [NSURL URLWithString:theNewURLString]; self.macroList = [NSMutableArray arrayWithContentsOfURL:theNewURL]; } int k=0; for (int i=0; i&lt;[self.macroList count]; i++) { int j=i%9; if (j==0) { k++; } UIButton *iconButton=[UIButton buttonWithType:UIButtonTypeCustom]; NSString *picString = [[self.macroList objectAtIndex:i] valueForKey: @"pid"]; UIImage *buttonImage = [UIImage imageNamed:picString]; [iconButton setImage:buttonImage forState:UIControlStateNormal]; [iconButton setTag:i]; [iconButton addTarget:self action:@selector(exeMacro:) forControlEvents:UIControlEventTouchUpInside]; [iconButton setFrame:CGRectMake(30+(i%9*80), 17+((k-1)*70), 48, 48)]; //[self.view addSubview:iconButton]; [marco_scrollview addSubview:iconButton]; if ([self.macroList count] &gt; 18) { [marco_scrollview setContentSize:CGSizeMake(320, 525 + (([self.macroList count]/4 - 4) * 70) )]; } } [marco_view addSubview:marco_scrollview]; } </code></pre> <p>And I try to reload data every 3 second.. I dont know why it doesn't refresh Marco View.. </p> <p><img src="https://i.stack.imgur.com/lgsYu.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    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.
 

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