Right now I am making an app that uses a UITableView, but I have been struggling with this issue for 3 days now and I can't figure it out.
In the .h File, I subscribe to both the tableview methods. Like this:
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
#import <QuartzCore/QuartzCore.h>
#import <Twitter/Twitter.h>
#import <Accounts/Accounts.h>
@interface pagetwoViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>
{
}
@property (strong, nonatomic) IBOutlet MKMapView *mapView;
@property (strong, nonatomic) IBOutlet UIImageView *twitterFrame;
@property (strong, nonatomic) IBOutlet UITableView *twitterTableView;
@property (strong, nonatomic) NSMutableArray *timeLineData;
And my implementation can be found here:
It always crashes whenever app loads up. So I enabled NSZombies and I got the message:
[pagetwoViewController numberOfSectionsInTableView:]: message sent to deallocated instance 0x27d960
So I looked this up online, and I found that in almost all cases, this happens when the tableview gets released before numberOfSectionsInTableView
. All the websites say that I should retain the tableview, but I am using ARC and I can not do that. This crash only happens sometimes. And then When it doesn't, the moment I try touch the tableview or try to scroll it, It crashes. I've looked everywhere and I simply can't find anything on this issue, And I certainly can't figure out where the tableview is being released. Any help whatsoever will be greatly appreciated.