Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8023587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:36:08+00:00 2026-06-04T22:36:08+00:00

I have a problem regarding UIActivity Indicator , I m implementing Activity indicator on

  • 0

I have a problem regarding UIActivity Indicator , I m implementing Activity indicator on UITableView Cell but it is not working. My code is as follows, if can solve it please tell me the mistake I m doing in it.

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

 UIActivityIndicatorView *indicator=[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];


    if (segmentControl.selectedSegmentIndex==0) 
    {
       if ([indexPath row]==[FriendSuggestion count]) 
       {
        int cursor=[Constants getCursorForKey:@"friendList_cursor"];

        if (cursor!=0) 
        {
         [[tableView cellForRowAtIndexPath:indexPath] addSubview:indicator];
         [indicator setFrame:CGRectMake(40, 25, 37, 37)];
         [NSThread detachNewThreadSelector:@selector(startAnimating) toTarget:indicator withObject:nil];


         dispatch_async(dispatch_get_main_queue(), ^{
          [self loadingMore:indexPath :indicator :cursor];
         });


        }else
         isNoMoreData=YES;

        [tableView reloadData];
       }
    }
    else
    {
       if ([indexPath row]==[popularSuggestion count]) 
       {
        int cursor=[Constants getCursorForKey:@"popularList_cursor"];  

          if (cursor!=0) 
          {
           [[tableView cellForRowAtIndexPath:indexPath] addSubview:indicator];
           [indicator setFrame:CGRectMake(40, 25, 37, 37)];
           [NSThread detachNewThreadSelector:@selector(startAnimating) toTarget:indicator withObject:nil];


           dispatch_async(dispatch_get_main_queue(), ^{
            [self loadingMore:indexPath :indicator :cursor];
           });


          }else
           isNoMoreData=YES;

        [tableView reloadData];
       }
    }
}


-(void)loadingMore:(NSIndexPath*)indexPath:(UIActivityIndicatorView*)indicator:(int)cursor
{

 NSLog(@"loading more called ...");

 if (segmentControl.selectedSegmentIndex==0) 
 {

            isNoMoreData=NO;
            NSArray *nextArray=[[NSArray alloc] init];
            nextArray=[Constants getFriendsSuggestionsStr:cursor];

            for (NSDictionary *dic in nextArray) {
             [FriendSuggestion addObject:dic];
            }
 }else
 {     
             isNoMoreData=NO;
             NSArray *nextArray=[[NSArray alloc] init];
             nextArray=[Constants getPopularSuggestionsStr:cursor];

             for (NSDictionary *dic in nextArray) {
              [popularSuggestion addObject:dic];
             }
 }

 [table reloadData];
 [indicator stopAnimating];
}

Thanks in Advance..!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T22:36:11+00:00Added an answer on June 4, 2026 at 10:36 pm

    If u r saying that label added as subview is working on other rows on which U have applied no condition
    . Then it may be added to your cell and after reloading the table it disappears . Try your method with some changes :

        if (segmentControl.selectedSegmentIndex==0) 
    {
       if ([indexPath row]==[FriendSuggestion count]) 
       {
        int cursor=[Constants getCursorForKey:@"friendList_cursor"];
    
        if (cursor!=0) 
        {
         [[tableView cellForRowAtIndexPath:indexPath] addSubview:indicator];
         [indicator setFrame:CGRectMake(40, 25, 37, 37)];
         [NSThread detachNewThreadSelector:@selector(startAnimating) toTarget:indicator withObject:nil];
    
    
         dispatch_async(dispatch_get_main_queue(), ^{
          [self loadingMore:indexPath :indicator :cursor];
         });
    
    
        }else
        {
         [tableView reloadData];
         isNoMoreData=YES;
       }
       }
    }
    

    reload table in else block…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just solved another problem regarding the same piece of code but I
I have a problem regarding the datediff MYSQL function, I can use it and
I am working on UISplitview base project.I have one problem regarding UISplitview.I want to
I have the following code, and i have a problem regarding changing the ringtone
I have a problem regarding multiple inclusion of header file in C++ code. Say
I have a problem regarding display PHP code (stored in a database) on a
i have a problem regarding the responseXML of ajax.. I have this code from
I have a strange problem regarding null pointer exception. I'm posting the problematic code
I have a problem regarding Alarm manager in Android. I have the following code
I have a little problem regarding arranging of code, which depends on each other

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.