Saturday, June 13, 2026
HomeiOS Developmentios - How one can correctly save a number of TKBERTLVRecords collectively

ios – How one can correctly save a number of TKBERTLVRecords collectively

[ad_1]

At the moment I’m can use class func sequenceOfRecords(from knowledge: Knowledge) -> [TKTLVRecord]? with one TKBERTLVRecords or if they’re embedded. Right here is an instance of what I can get up to now:

    var dataCB: NSData? = NSData()
    let tag1: TKTLVTag = 0x0101
    let value1: UInt8 = 0x01
    
    let tlv1 = TKBERTLVRecord.init(tag: tag1, worth: value1.knowledge)
    let combined1 = TKBERTLVRecord.init(tag: tag1, data: [tlv1])//ONE RECORD
    let consequence = TKBERTLVRecord.sequenceOfRecords(from: combined1.knowledge)

However how do I embbed a number of data? How can I do one thing like this:

    var dataCB: NSData? = NSData()
    let tag1: TKTLVTag = 0x0101
    let value1: UInt8 = 0x01
    let tag2: TKTLVTag = 0x0101
    let value2: UInt8 = 0x01
    
    let tlv1 = TKBERTLVRecord.init(tag: tag1, worth: value1.knowledge)
    let tlv2 = TKBERTLVRecord.init(tag: tag2, worth: value2.knowledge)
    let combined1 = TKBERTLVRecord.init(tag: tag1, data: [tlv1, tlv2])// MULTIPLE RECORDS
    let consequence = TKBERTLVRecord.sequenceOfRecords(from: combined1.knowledge)

I maintain getting nil when attempting to do a number of data.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments