(programming in iPhone objective-C)
I have a class level NSString* that I create, add property(nonatomic,retain) and synthesize code for and I can modify the string endlessly with stringByAppendingString functions and display the string using NSLog just fine. All of this is done in a subclass, overridden viewDidLoad function. When I try to access the same variable from the cellForRowAtIndexPath fuction when determining what to display in the cell of a tableView, the program crashes. Anyone have any clues?
Related Code:
@interface InfoViewController : UITableViewController {
NSString *shipAddr;
}
@property (nonatomic,retain) NSString *shipAddr;
@synthesize shipAddr;
VIEWDIDLOAD:
shipAddr = [[[NSString alloc] initWithString:@""] retain];
**CRASHES HERE:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(shipAddr);
**