For good practice, yes. In this isolated example, I don't believe so (because I'm pretty sure NSConstantString overrides -retainCount so that it can't ever be released).

You may also want to consider simplifying your code to:
        ...
NSString * miles[8] = {@"200", @"500", @"1000", @"1500", @"2000", @"2500", @"5000", @"10000"};
        [appDelegate setCurrentMiles:miles[indexPath.row]];
        ...

HTH,

Dave

On Mar 2, 2009, at 1:58 PM, James Cicenia wrote:

hello

Here is my code:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath: (NSIndexPath *)indexPath { WhatsFreshAppDelegate *appDelegate = (WhatsFreshAppDelegate *) [[UIApplication sharedApplication] delegate];

        if(indexPath.row == 0){
                [appDelegate setCurrentMiles:@"200"];
        }else if(indexPath.row==1){
                [appDelegate setCurrentMiles:@"500"];
        }else if(indexPath.row==2){
                [appDelegate setCurrentMiles:@"1000"];
        }else if(indexPath.row==3){
                [appDelegate setCurrentMiles:@"1500"];
        }else if(indexPath.row==4){
                [appDelegate setCurrentMiles:@"2000"];
        }else if(indexPath.row==5){
                [appDelegate setCurrentMiles:@"2500"];
        }else if(indexPath.row==6){
                [appDelegate setCurrentMiles:@"5000"];
        }else if(indexPath.row==7){
                [appDelegate setCurrentMiles:@"10000"];
        }
[appDelegate setupStateDisplay:[appDelegate currentLatitude] longString:[appDelegate currentLongitude] milesString:[appDelegate currentMiles]];
        [appDelegate refreshLocation:TRUE];
        [(MyLocationViewController *)myParentController resetMiles];    

}


DO I HAVE TO WORRY ABOUT RELEASING currentMiles somewhere?
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to