-2

I have issue for fetching CUP_Frequency in iphone, ipad devices and simulator.

size_t length;
     int mib[6];
        int result;


    mib[0] = CTL_HW;
    mib[1] = HW_CPU_FREQ;
    length = sizeof(result);
    if (sysctl(mib, 2, &result, &length, NULL, 0) < 0)
    {
        perror("getting cpu frequency");
    }
    cpuFre=[NSString stringWithFormat:@"%.2f Mhz",(float)result];

I am using this code for fetching CPU frequency but answer is strange in each device like. In simulator it gives -(minus)value and in ipad it gives 0 and iphone it gives fix 600 MHz value.

What is value of ipad and i know that CPU Frequency of simulator is 2400 MHz but it gives minus value.

What to do???

Leena
  • 111
  • 1
  • 10
  • I am only trying to fetch data of RAM and also find mac address of any device but don't know how to find above stuff define in question. – Leena Nov 09 '12 at 10:42
  • Try google than. You can not ask straight away please give me teh codez. – Janak Nirmal Nov 09 '12 at 10:43
  • I am already searching on google but can not find perfact method or demo for it. – Leena Nov 09 '12 at 10:45
  • You can go for individual terms rather than searching all. [Free disk capacity](http://stackoverflow.com/questions/5712527/ios-how-to-detect-total-available-free-disk-space-on-the-iphone-ipad-device) got this link first on [google](https://www.google.co.in/#hl=en&sclient=psy-ab&q=get+free+disk+size+iphone+programatically&oq=get+free+disk+size+iphone+programatically&gs_l=hp.3...29043.36542.1.36736.41.36.0.5.5.0.350.6564.0j30j4j2.36.0.les%3B..0.0...1c.1.NjZ3MHGrN-M&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=d6356ef93ffa2dca&bpcl=38093640&biw=1600&bih=706) – Janak Nirmal Nov 09 '12 at 10:48
  • 1
    You're asking 10 different questions here. All of them have been answered here in one form or another (see [How to get battery status?](http://stackoverflow.com/questions/330461/how-to-get-battery-status) and [Find iPhone Model information](http://stackoverflow.com/questions/3991604/find-iphone-model-information), for example), so I'd search around here first. – Brad Larson Nov 09 '12 at 21:50

1 Answers1

3

Have a look at the UIDevice class

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIDevice_Class/Reference/UIDevice.html

You'll be able to get most of the information you're looking for by doing something like

[UIDevice currentDevice].model

or

[UIDevice currentDevice].systemVersion

and so on..

NikosM
  • 1,111
  • 7
  • 9
  • But this gives device information that i have already done but don't know following stuff that i define on my question. – Leena Nov 09 '12 at 10:46
  • Yes you can't get all the information using the UIDevice class. You have to look for other solutions as well. For example, check out this answer on finding out free and used disk space. – NikosM Nov 09 '12 at 10:51
  • Please read my editable question. I have query and i can not put any question because stackoverflow block my questions. – Leena Nov 20 '12 at 11:18