I am using NSURLconnection to connect to a webservice and receive data. Since I connect to different webservices, I set the connection accessibilityLabel to a string describing the webservice.
In the delegate method
-(void) connectionDidFinishLoading:(NSURLConnection *) connection;
I check connection.accessibilityLabel
and run the appropriate code.
This works perfectly in the simulator.
However, on the iPhone itself, connection.accessibilityLabel
is always null.
Does anyone know why?
(the connection still works properly and I get my data on the iPhone, I just dont know what to do with it since the accessibility label seems not to get set properly or is erased or something.)
Thanks in advance.
EDIT: here is the code I use to make the connection and assign the label
// create the connection with the request
// and start loading the data
ConnectionDelegate *connDel = [[ConnectionDelegate alloc] init];
connDel.delegate = self;
conn = [[NSURLConnection alloc] initWithRequest:theRequest delegate:connDel];
conn.accessibilityLabel = label;
if (conn) {
// Create the NSMutableData to hold the received data.
// receivedData is an instance variable declared elsewhere
connDel.webData = [[NSMutableData data] retain];
} else {
// Inform the user that the connection failed.
NSLog(@"Connection Failed");
}