como converter matriz de bytes em imagem no ios

hoje minha tarefa é converter matriz de bytes em imagem

Primeiro eu tento converter imagem em matriz de bytes: -

Para converter a imagem em matriz de bytes, primeiro precisamos fazer a conversão dessa imagem específica [UIImage] paraNSData. Então converteremos issoNSData para matriz de bytes. Aqui vou dar o código de exemplo, basta passar por ...

//Converting UIImage to NSData
    UIImage *image = [UIImage imageNamed: @"photo-04.jpg"];

    NSData *imageData = UIImagePNGRepresentation(image);

    //Converting NSData to Byte array
    NSUInteger len = [imageData length];
    NSLog(@"Byte Lendata1  %lu",(unsigned long)len);

    Byte *byteData = (Byte*)malloc(len);
    memcpy(byteData, [imageData bytes], len);

Eu sou tentar assim Converter byte para imageView

 const unsigned char *bytes = [imageData bytes];

    NSUInteger length = [imageData length];

    NSMutableArray *byteArray = [NSMutableArray array];

    for (NSUInteger i = 0; i < length; i++) {
        [byteArray addObject:[NSNumber numberWithUnsignedChar:bytes[i]]];
    }
    NSDictionary *dictJson = [NSDictionary dictionaryWithObjectsAndKeys:
                              byteArray, @"photo",
                              nil];
    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dictJson options:0 error:NULL];
    NSLog(@"");
    UIImage *image1 = [UIImage imageWithData:jsonData];

    UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 100, 50)];


    imgView.image=image1;

Eu tenho saída converter imagem em matriz de bytes, mas eu quero converter matriz de bytes em imagem, então por favor me ajude obrigado em avançado.

questionAnswers(2)

yourAnswerToTheQuestion