Post

Replies

Boosts

Views

Activity

Decoding Downloaded Data
I know that using using JSONDecoder we can convert the downloaded JSON data into class/struct object. Is there a way to do the same for raw data(NSData)/octect. Since downloaded is not a json, I am getting error. I have class like this public struct FileData: Codable{ public var data: Data? public init (data: Data? = nil){ self.data = data } } Is there a way to assign the downloaded data to FileData().data via decoding
7
0
624
Jun ’21
How to wait until an object is removed from Array
I have declared an NSMutableArray and the count should not exceed 100. If some one calls addObject method to add an item to that array when the count is 100 then that method call should not be executed until someone removes an item so that count will go down below 100. Can we use semaphore or group dispatch for signaling or mutex/NSLock is recommended.
8
0
1.4k
Sep ’21