Hello
I'm trying to update my app to version 2.1, and I'm having trouble understanding part of the tablekey.
I had this method:
Code:
- (void) table:(LSSubscribedTableKey *)tableKey itemPosition:(int)itemPosition itemName:(NSString *)itemName didUpdateWithInfo:(LSUpdateInfo *)updateInfo {
@synchronized (dicionarioDeConexoes) {
NSNumber *idConexao = [dicionarioDeTableKeys objectForKey:tableKey];
if (idConexao) {
DadosDasConexoes *dados = [dicionarioDeConexoes objectForKey:idConexao];
if (dados && dados.receptor && [dados.receptor conformsToProtocol:@protocol(ProtocoloDeDadosDoServidor)]) {
[dados.receptor conexao:dados.idConexao posicao:itemPosition item:itemName updateInfo:updateInfo];
}
}
}
}
I tried to do this:
Code:
- (void) subscription:(nonnull LSSubscription *)subscription didUpdateItem:(nonnull LSItemUpdate *)itemUpdate {
@synchronized (dicionarioDeConexoes) {
NSNumber *idConexao = [dicionarioDeTableKeys objectForKey:itemUpdate.itemPos];
if (idConexao) {
DadosDasConexoes *dados = [dicionarioDeConexoes objectForKey:idConexao];
if (dados && dados.receptor && [dados.receptor conformsToProtocol:@protocol(ProtocoloDeDadosDoServidor)]) {
[dados.receptor conexao:dados.idConexao posicao:(int)itemUpdate.itemPos item:itemUpdate.itemName updateInfo:itemUpdate.observationInfo];
}
}
}
}
But don't work, I had bad access.
I'm tried get the table key using:
Code:
LSSubscription *tableKey;
And this:
Code:
[self.dicionarioDeTableKeys setObject:window forKey:dados.tableKey];
Where am I going wrong?
Bookmarks