开发者

Scroll problem in tableview in iphone

开发者 https://www.devze.com 2023-03-14 22:45 出处:网络
I am showing some records in tableview. I am seeing vertical scroll is coming on screen but whenever I am clicking for scroll I am getting an SIGABRT error in main() function.

I am showing some records in tableview. I am seeing vertical scroll is coming on screen but whenever I am clicking for scroll I am getting an SIGABRT error in main() function.

Why this error is coming ?

Thanks

Here are the code which is adding text in table view. This is written in viewdidload() function.

-(void) viewDidload() {


    extern NSArray *wallvalue;


     tableList = [[NSMutableArray alloc] initWithCapacity:[wallvalue count]];
    for (NSDictionary *person in wallvalue) {
        NSString *personName = [person objectForKey:@"message"];

      if(![[NSNull null] isEqual:personName] && [personName length])
        {
            [tableList addObject:personName];
              NSLog(personName);
        }
    }

}

And my error is occuring in main function which is below.

int main(int argc, char *argv[])

{

    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

    int retV开发者_JAVA技巧al = UIApplicationMain(argc, argv, nil, nil);

    [pool release];

    return retVal;

}

Error is : Thread EXC_BAD_ACCESS in line (int retval= UIApplicationMain(argc, argv, nil, nil);


My guess is your numberOfRowsinsection is more than what your having modal(data).while your trying to scroll the last objects will load in the cells through

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath method. so once check your data while loading the cells once again.while your scrolling below method will always call

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath  
0

精彩评论

暂无评论...
验证码 换一张
取 消