Results 1 to 3 of 3
  1. #1

    doubt to change LSSubscribedTableKey to LSSubscription

    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?

    Sorry my English is not very good

  2. #2
    Hello

    I managed to solve using this article:
    https://lightstreamer.com/api/ls-ios-client/latest/


    find me for opening two Thread I don't know how it happened

  3. #3
    Administrator
    Join Date
    Feb 2012
    Location
    Bologna, Italy
    Posts
    100
    Hello,

    sorry for my late answer. From your code I'm not sure what you were attempting to achieve, but I'm happy to know you have found the solution.

    The LSItemUpdate and LSUpdateInfo are indeed somewhat different, but they implement the same functionality. You typically map accessor methods by field position from currentValueOfFieldPosition to valueWithFieldPos, and similarly for accessors by field name.

    If you have any other question please ask.

 

 

Similar Threads

  1. Will session id change when connection mode change?
    By LS_Developer in forum Client SDKs
    Replies: 3
    Last Post: March 6th, 2012, 09:58 AM
  2. Replies: 8
    Last Post: March 25th, 2010, 10:02 AM
  3. Replies: 1
    Last Post: November 2nd, 2009, 05:55 PM
  4. status change when the content length is reached
    By riwang in forum Client SDKs
    Replies: 3
    Last Post: May 21st, 2009, 10:37 AM
  5. Replies: 4
    Last Post: March 19th, 2008, 11:10 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 02:09 AM.