hi I am new so I hope I am posting in the right section, I am a bit confused in what I am doing here, as I started learning about iphone sdk recently. I am working on a table view application where I want a different alert message given per item in my array. I am working base on one of the examples in
http://www.amazon.com/Beginning-iPho.../dp/1430216263
I am using an array to store information for each cell in my table view application :
NSArray *array = [[NSArray alloc] initWithObjects:@"Academic Department", @"Administration",
@"Ball Room", @"Bearcat Louge", @"Board Room", @"Book Store", @"Cafeteria", @"Carey Louge",
@"Cis Computer Lab",@"Commuter Lounge", @"Financial Aid", @"Foundation Room", nil];
and I am trying to give an different alert string for each one: here is what I have so far:
NSUInteger row = [indexPath row];
NSString *rowValue =[listData objectAtIndex:row];
NSString *message = [[NSString alloc] initWithFormat:@"You selected %@",rowValue];
UIAlertView *alert = [[UIAlertView alloc]
// if("%@" =="Commuter Lounge")
initWithTitle:message message:
alertmessage delegate:nil cancelButtonTitle:@"Go Back" otherButtonTitles:nil];
I was planning to use a string variable to store the actual message, which is the underlined part, but I am running into problems in comparing a array string to to a match, because I was planning to make a if comparison to each element in my array.
I was trying things like
if %@ == commuter lounge
then alertmessage= "commuter lounge is a place where commuters could stay for breaks"
But it isn't recognizing it. I am really not familiar with the language yet, so please feel free to suggest