NSMutableArray not showing in UITableView - objective-c

In my header file:
#interface HTMLClassesViewController : UITableViewController <UITableViewDataSource, UITableViewDelegate>
So I did declare the dataSource and delegate.
In my implementation file:
- (void)viewDidLoad {
[super viewDidLoad];
if (self.arrayOfClasses == nil) {
self.arrayOfClasses = [[NSMutableArray alloc] init];
}
NSMutableArray *array = [[NSMutableArray alloc] init];
... // Gather data from HTML source and parse it into "array"
self.arrayOfClasses = array; //arrayOfClasses here is non-nil (with correct objects)
NSLog(#"%# test1", [self.arrayOfClasses objectAtIndex:0]);
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
NSLog(#"%# test1.5", [self.arrayOfClasses objectAtIndex:0]);
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
NSLog(#"%# test2", [self.arrayOfClasses objectAtIndex:0]);
return [self.arrayOfClasses count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(#"%# test3", [self.arrayOfClasses objectAtIndex:0]);
static NSString *CellIdentifier = #"WebCollegeCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = [self.arrayOfClasses objectAtIndex:indexPath.row];
return cell;
}
And this is the output from NSLog:
2012-11-24 22:52:19.125 ArizonaCollegeSearch[72404:c07] CSE 240 test1
2012-11-24 22:52:19.126 ArizonaCollegeSearch[72404:c07] CSE 240 test1.5
2012-11-24 22:52:19.127 ArizonaCollegeSearch[72404:c07] (null) test1.5
2012-11-24 22:52:19.127 ArizonaCollegeSearch[72404:c07] (null) test2
As you can see, numberOfSectionsInTableView is being called with an non-null object, and then with a null object, and numberOfRowsInSection is being called with a null object, and cellForRowAtIndexPath is not being called at all. I don't even have a [self.tableView reloadData] anywhere.
Any suggestions?

So the property holding your array needs to be declared strong, else it will get deallocated when the variable it has been assigned to is deallocated. And in the case of a local variable (your NSMutableArray *array), that's the end of its scope, e.g. when the function viewDidLoad returns.

Related

Convert NSString to NSMutableArray to added in tableview

Hi I wanted convert NSString into NSMutable array and in the final added into Tableview my String is this
result=Vlad,Mama,Papa,Son
I wanted to do something this
Anarray=(Vlad,Mama,Papa,Son)
And added to Tableview. Can anathing help me.What I do
NSArray *arr = [result componentsSeparatedByString:#","];
dataArray=[[NSArray alloc]initWithObjects:arr ,nil];
And try to added into
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return [dataArray count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString*cellid=#"Cell";
UITableViewCell*cell=[tableView dequeueReusableCellWithIdentifier:cellid];
if(cell==Nil){
cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellid];
}
cell.textLabel.text=[dataArray objectAtIndex:indexPath.row];
return cell;
}
But I have mistake
enter image description here
componentsSeparatedByString returns you the array, if you want a mutable array you can use the following code.
NSArray *arrComponents = [str componentsSeparatedByString:#","];
NSMutableArray *arrmFilter = [[NSMutableArray alloc] init];
for(int i = 0; i < [arrComponents count] ;i++)
{
NSString *str = [arrComponents objectAtIndex:i];
[arrmFilter addObject:str];
}
you've added your "arr" as element inside your "dataArray".
in case dataArray is NSMutableArray :
dataArray = [NSMutableArray arrayWithArray:arr];
in case dataArray is NSArray :
datatArray = [NSArray arrayWithArray:arr];
May be you didn't alloc and init dataArray.
You can try below code.
#import "ViewController.h"
#import "MyTableViewCell.h"
#interface ViewController ()
#end
#implementation ViewController
{
NSMutableArray *arrData;
}
- (void)viewDidLoad {
[super viewDidLoad];
NSString *str = #"objective c,swift,java";
arrData = [[NSMutableArray alloc]initWithArray:[str componentsSeparatedByString:#","]];
NSLog(#"%#",arrData);
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return arrData.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
MyTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:#"cell" forIndexPath:indexPath];
cell.lblData.text = [arrData objectAtIndex:indexPath.row];
return cell;
}
componentsSeparatedByString gives you an array. Which is what you want.
[[NSArray alloc]initWithObjects:arr ,nil] gives you an array containing just one element, an array containing your strings. Which is totally wrong. An array containing four strings is absolutely not the same as an array containing an array containing four strings.
dataArray.count will be 1 - because there is one element which is itself an array. And dataArray [0] will be that array, not a string.

Displaying data retrieved from Parse in UITableView

After all progress i made with your answers, my issue changed. So i am changing my question with clearer way. I have an UITableView which is showing my retrieved data from Parse.com. So i made a NSMutableArray for adding objects to that array when they are retrieved. But my problem is even i add objects to NSMutableArray, my table does not show anything but default screen of UITableView. I thing the issue is UITableView is formed before my NSMutableArray got its objects. Here is my code:
Note: The PropertyClass is the class which has the properties of my objects.
At MyTableViewController.h
#interface MyTableViewController : UITableViewController <CLLocationManagerDelegate> {
PFObject *object;
}
#property (strong, nonatomic) IBOutlet UITableView *MyTableView;
#end
At UITableViewController.m
#interface MyTableViewController ()
#property(strong)NSMutableArray *myNSMutableArray;
#end
#implementation MyTableViewController
#synthesize myNSMutableArray,MyTableView;
-(void) retrievingDataFromParse{
PFQuery *query = [PFQuery queryWithClassName:#"MyObjectsClass"];
[query whereKey:#"ObjectsNumber" lessThanOrEqualTo:10];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
// The find succeeded.
NSLog(#"Successfully retrieved %d scores.", objects.count);
if (objects.count==0) {
NSString *objectError = #"There no object retrieved from Parse";
PropertiesClass *PC = [[PropertiesClass alloc]initWithPropert1:objectError Propert2:nil Propert3:nil Propert4:nil];
[myNSMutableArray addObject:PC];
}
for (int i = 0; i < objects.count; i++) {
object = [objects objectAtIndex:i];
NSString *Propert1 = [object objectForKey:#"Propert1"];
NSNumber *Propert2 = [object objectForKey:#"Propert2"];
NSNumber *Propert3 = [object objectForKey:#"Propert3"];
NSString *Propert4 = [object objectForKey:#"Propert4"];
PropertiesClass *PC = [[PropertiesClass alloc]initWithPropert1:Propert1 Propert2:Propert2 Propert3:Propert3 Propert4:Propert4];
[myNSMutableArray addObject:PC];
};
} else {
// Log details of the failure
NSLog(#"Error: %# %#", error, [error userInfo]);
}
}];
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.myNSMutableArray = [NSMutableArray array];
[self retrievingDataFromParse];
[MyTableView reloadData];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return [myNSMutableArray count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
PropertiesClass *PC= [myNSMutableArray objectAtIndex:indexPath.row];
cell.textLabel.text=PC.Propert1;
return cell;
}
Looking at your code i see that you never create a UITableViewCell, you should change this:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
PropertyClass *PC = [myMutableArray objectAtIndex:indexPath.row];
cell.textLabel.text = PC.x;
return cell;
}
with this:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if (nil == cell){
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
PropertyClass *PC = [myMutableArray objectAtIndex:indexPath.row];
cell.textLabel.text = PC.x;
return cell;
}
the method dequeueReusableCellWithIdentifier:forIndexPath: return a UITableViewCell only if there are unused, but already allocated, cells in your table view. otherwise it returns nil.
Also when you update the mutable array containing all your data you should call [yourTableView reloadData] to force the table view to reload its content.
Your code is quite cryptic. Few suggestions here.
First, rename variables and methods with camelCaseNotation (camel case notation). For example, MyMutableArray should be myMutableArray. RetrievingDataFromParse should be retrievingDataFromParse (and so on). Start upper case letter are for classes.
Second, what does this code mean (I put comment on your code)?
for (int i = 0; i < objects.count; i++) {
// where do you have defined object?
object = [objects objectAtIndex:i];
NSString *x = [object objectForKey:#"x"];
NSNumber *y = [object objectForKey:#"y"];
NSNumber *z = [object objectForKey:#"z"];
NSString *t = [object objectForKey:#"t"];
// is Mekan a subclass of PropertiyClass or what else?
PropertiyClass *Properties = [[Mekan alloc]initWithx:x y:y z:z t:t]
// what's MekanKalibi? Maybe you need to add Properties
[MyMutableArray addObject:MekanKalibi];
}
Edit
If you don't use iOS6 - (void)registerClass:(Class)cellClass forCellReuseIdentifier:(NSString *)identifier you should alloc-init cells.
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if(!cell) {
// alloc-init a new cell here...
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
// or if you don't use ARC
// cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
PropertyClass *PC = [myMutableArray objectAtIndex:indexPath.row];
cell.textLabel.text = PC.x;
return cell;
Edit 2
I don't know how parse works but I suppose it manages async requests. So, at the end of your for loop, just call reload data in the table.
Parse states:
The InBackground methods are asynchronous, so any code after this will run immediately. Any code that depends on the query result should be moved inside the completion block above.
I had the same problem. When you reload the table, you need to move it so it is inside the block. Worked for me.
I'm not 100% sure how the asynchronous parts affect it so. I know that the start of my viewDidload and the end occured then this block, hence the problem.
People should probably up this as this solves the issue.
Cheers.
All you have to do is reload tableView in the block... this will show data.
for (int i = 0; i < objects.count; i++) {
object = [objects objectAtIndex:i];
NSString *Propert1 = [object objectForKey:#"Propert1"];
NSNumber *Propert2 = [object objectForKey:#"Propert2"];
NSNumber *Propert3 = [object objectForKey:#"Propert3"];
NSString *Propert4 = [object objectForKey:#"Propert4"];
PropertiesClass *PC = [[PropertiesClass alloc]initWithPropert1:Propert1 Propert2:Propert2 Propert3:Propert3 Propert4:Propert4];
[myNSMutableArray addObject:PC];
};
} else {
// Log details of the failure
NSLog(#"Error: %# %#", error, [error userInfo]);
}
**[MyTableView reloadData];**
}];

populate uitableview as subview of uicollectionview

I have a problem in populating a uitableview created programmatically as a subview of uicollectionview.
here's my code:
.h file
#import <UIKit/UIKit.h>
#interface TheViewController : UICollectionViewController<UITableViewDataSource>
#property (atomic,strong) IBOutlet UIBarButtonItem *plus;
-(IBAction) addTeamPressed:(id)sender;
#end
.m file
- (void)viewDidLoad
{
[super viewDidLoad];
NSError *jsonParsingError = nil;
teamsView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.window.bounds.size.width, self.view.window.bounds.size.height)];
NSData *t = [NSData dataWithContentsOfURL:[NSURL URLWithString:#"http://..."] options:NSDataReadingMappedIfSafe error:&jsonParsingError];
NSArray *tmp = [NSJSONSerialization JSONObjectWithData:t options:0 error:&jsonParsingError];
UITableViewCell * teamCell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:#"Cell"];
teams = [[NSMutableArray alloc]init];
[teamsView addSubview:teamCell];
teamsView.delegate = self;
teamsView.dataSource = self;
for(int i =0;i<tmp.count;i++){
[teams addObject:[tmp objectAtIndex:i]];
}
plus.title = #"Done";
[self.view addSubview:teamsView];
}
#pragma mark - UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
// If You have only one(1) section, return 1, otherwise you must handle sections
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return [teams count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
TeamsNameCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell = [[SquadreNameCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.name.text = [NSString stringWithFormat:#"%#",[[teams objectAtIndex:indexPath.row] objectForKey:#"name"]];
NSLog(#"%d teams",[teams count]);
return cell;
}
my tableview is displaying correctly, of course thanks to other functions not mentioned here, but no rows in the subview.
the compiler prints out the number of teams, so it calls the delegate methods, but it doesn't populate the subview...
what 's wrong with this?
thanks in advance
Dario
First you should remove this from your viewDidLoad:
UITableViewCell * teamCell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:#"Cell"];
[teamsView addSubview:teamCell];
Then make sure that your teams array is retained, just put this line to the header file:
#property (nonatomic, strong) NSMutableArray* teams;
And then use self.teams instead of just teams
At the end of viewDidLoad method you should call [teamsView reloadData];
Also it would be good to change your table data source method:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = #"Cell";
TeamsNameCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (!cell) {
// please make sure that you allocate required object here
cell = [[TeamsNameCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// please make sure that you do have `name` property in your `TeamsNameCell` class
cell.name.text = [NSString stringWithFormat:#"%#",[[teams objectAtIndex:indexPath.row] objectForKey:#"name"]];
NSLog(#"%d teams",[teams count]);
return cell;
}
Please make sure that your TeamsNameCell class has name property in the header:
#property(nonatomic, strong) UILabel* name;
And also do not forget to allocate this label in the constructor of TeamsNameCell:
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
self.name = [[UILabel alloc] initWithFrame:CGRectMake(0,0,100,50)];
[self addSubview:self.name];
}
return self;
}
Or Maybe it is better to use default cell's label:
instead of cell.name.text = #"text"; use cell.textLabel.text = #"text";
solution is,
static NSString *CellIdentifier = #"Cell";
TeamsNameCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (!cell) {
cell = [[SquadreNameCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.labelText.text = [NSString stringWithFormat:#"%#",[[teams objectAtIndex:indexPath.row] objectForKey:#"name"]];
NSLog(#"%d teams",[teams count]);
return cell;

NSArray elements which have from NSSet not displayed in TableViewCell

I have NSArray elements which is implemented from NSSet and if i tried to display the elements in Table View Cell i'm getting BAD ACCESS issue at tableView numberOfRowsInSection part.Here is my code
- (void)viewDidLoad
{
[super viewDidLoad];
jsonurl=[NSURL URLWithString:#"http://www.sample.net/products.php"];//NSURL
jsondata=[[NSString alloc]initWithContentsOfURL:jsonurl];//NSString
jsonarray=[[NSMutableArray alloc]init];//NSMutableArray
self.jsonarray=[jsondata JSONValue];
array=[jsonarray valueForKey:#"post_title"];
set = [NSSet setWithArray:array];//NSMutableSet
array=[set allObjects];//NSArray
NSLog(#"%#",array);
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return [array count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
cell.textLabel.text = [self.array objectAtIndex: [indexPath row]];
return cell;
}
Kindly help please.Thanks in advance.
In your code you are not allocating the array. You are setting an autoreleased object to that array that's why you are getting this error.
Replace array=[set allObjects]; with array=[[set allObjects] retain];
I think this is because you are setting your instance variables to autoreleased objects without retaining them.
Either make "set" and "array" retained properties and do
self.set = [NSSet setWithArray:self.array];
// This is already a bit weird... If the set is made from the array, the array will be unchanged.
self.array = [self.set allObjects];
Or just retain them:
set = [[NSSet setWithArray:array] retain];
etc.
Since setWithArray and allObjects return autoreleased objects, you are left with dangling pointers as soon as you leave the scope of viewDidLoad.

Calendars in array out of scope after filtering

I am making a little program that will put some events in a calendar on the iPhone. In the settings I will let the user select wich calendar to use. To present what calendars he can use I pull all calendars from the EKEventStore and sort out those that doesn't allow modifications. Those are subscribed from other websites.
After the filter, wich seems to be OK, the array is reduced from 5 to 3 calendars, all objects in the array are out of scope, and the list in the tableview is blank.
What am I missing?
Edit: The problem erupted when I started with the filtering, thats why I thought that was the problem, but now it seems that the objects go out of scope when the -(NSArray*)availableCalendar returns the array. Do I need to copy it or something?
Image here: http://d.pr/35HY
-(NSArray*)availableCalendars{
NSArray *calendars;
EKEventStore *eventDB = [[[EKEventStore alloc]init]autorelease];
calendars = [[[NSArray alloc]initWithArray:[eventDB calendars]]autorelease];
return calendars;
}
- (void)viewDidLoad {
[super viewDidLoad];
allcalendars = [self availableCalendars];
[allcalendars retain];
localCalendars = [[NSMutableArray alloc]initWithArray:allcalendars];
NSPredicate *predicate = [NSPredicate predicateWithFormat:#"allowsContentModifications == YES"];
[localCalendars filterUsingPredicate:predicate];
calendarCountInt = localCalendars.count; //When I break the code here, the three objects are 'Out of Scope' and the count is three
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
if (calendarCountInt > 0)
{
cell.textLabel.text = [[localCalendars objectAtIndex:indexPath.row] title] ;
}
else {
cell.textLabel.text = #"No Calendars found";
}
return cell;
}
- (void)dealloc {
[localCalendars release];
[allcalendars release];
[super dealloc];
}
Your code is ... interesting. I'm guessing that you're doing return calendarCountInt; in your tableView:numberOfRowsInSection: method. If you are, then that's going to return 0; when there are no calendars that allow modification, resulting in an empty table.
Here's how I would do it:
// this requires an #property(nonatomic, retain) NSArray *allCalendars
// with a corresponding NSArray *allCalendars ivar
// also, an #property(nonatomic, retain) NSArray *localCalendars
// with a corresponding NSArray *localCalendars ivar
// get all calendars and cache them in an ivar (if necessary)
- (NSArray *)allCalendars {
if (allCalendars == nil) {
EKEventStore *eventDB = [[[EKEventStore alloc] init] autorelease];
[self setAllCalendars:[eventDB calendars]];
}
return allCalendars;
}
// get all modifiable calendars and cache them in an ivar (if necessary)
- (NSArray *)localCalendars {
if (localCalendars == nil) {
NSPredicate *filter = [NSPredicate predicateWithFormat:#"allowsContentModifications == YES"];
[self setLocalCalendars:[[self allCalendars] filteredArrayUsingPredicate:filter]];
}
return localCalendars;
}
// there's only one section
- (NSUInteger)numberOfSectionsInTableView:(UITableView *)aTableView {
return 1;
}
// show the number of modifiable calendars, or 1 (if there are no modifiable calendars)
- (NSUInteger)tableView:(UITableView *)aTableView numberOfRowsInSection:(NSUInteger)section {
NSArray *local = [self localCalendars];
return ([local count] > 0) ? [local count] : 1;
}
// set up the cell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
if ([[self localCalendars] count] > 0) {
cell.textLabel.text = [[[self localCalendars] objectAtIndex:[indexPath row]] title];
} else {
cell.textLabel.text = #"No calendars found";
}
}
- (void)dealloc {
[localCalendars release], localCalendars = nil;
[allCalendars release], allCalendars = nil;
[super dealloc];
}