iosobjective-cstringnsmutabledata

Convert string to mutable data - objective c


How to convert a string into mutable data in objective c


Solution

  • You can do something like,

    NSString *str = @"any string";
    
    NSData *data = [str dataUsingEncoding:NSUTF8StringEncoding];
    
    NSMutableData *mutableData = [data mutableCopy];;
    

    Hope this will help :)