Users Pricing

forum

home / developersection / forums / how to convert nsdata length into mb in ios?

How to Convert NSData length into MB in iOS?

Anonymous User 7339 12 Jan 2016

Can anyone tell me how can I convert NSData length which is in bytes into  megabytes.
I want to print that value in NSLog() like this:

NSLog(@"Data length: %u MB", imageData.length);

above code will print bytes but I want to print length in MB.
for example: Data length: 8 MB

Please help me.


I am a content writter !


1 Answers

Tarun Kumar 13 Jan 2016 Accepted Answer