I tried some different tutorials online and changed my code on the ibaction to this:
Code:
-(IBAction)showDetailView:(UIView*)sender {
NSInteger selectedIndex = sender.tag;
DetailView *nextController = [[DetailView alloc] initWithNibName:@"DetailView" bundle:nil];
[self presentModalViewController:nextController animated:YES];
[nextController changeProductText:[self.annotations objectAtIndex:selectedIndex]];
}
In the DetailView I added the IBAction
Code:
- (IBAction) changeProductText:(NSString *)str
and in the implementation added
Code:
- (IBAction) changeProductText:(NSString *)str{
NSLog(@"%@", str);
}
The log returns the str as
Code:
<DisplayMap: 0x877d170>
I thought that maybe I could just create a few If statements comparing str to what the NSLog had returned for each annotation. However,
Code:
<DisplayMap: 0x877d170>
is a different value each time I run the application. Thoughts?