I have a problem with “autorelease”, look my code: Then in “autorelease” take a 2 message error:
-‘autorelease’ is unavailable: not available in automatic reference counting mode
AND:
ARC forbids explicit message send of ‘autorelease’
//code
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return 25;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:
(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell==nil){
cell=[[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] ***autorelease***];
}
// Configure the cell...
cell.textLabel.text=[NSString stringWithFormat:@"Rental Property:%d", indexPath.row];
NSLog(@"Rental Property %d", indexPath.row);
return cell; return cell;
}
Someone can help?
Thx!!
Just remove the call to
-autorelease. You don’t need it in ARC mode.