¡@

Home 

2014/10/15 ¤U¤È 10:10:46

iphone Programming Glossary: kr

Getting iPhone's battery level

http://stackoverflow.com/questions/3276975/getting-iphones-battery-level

nport kCFRunLoopDefaultMode CFMutableDictionaryRef matching IOServiceMatching IOPMPowerSource kern_return_t kr IOServiceAddMatchingNotification nport kIOFirstMatchNotification matching IOServiceMatchingCallback power self powerIterator.. nport kIOFirstMatchNotification matching IOServiceMatchingCallback power self powerIterator NSLog @ Kernel said d kr power void nport powerIterator I'm still pretty sure you have to rely on IOKit in order to retrieve battery level. My application..

iOS - Get CPU usage from application

http://stackoverflow.com/questions/8223348/ios-get-cpu-usage-from-application

for me Update 2 . The thread_list was leaking so added vm_deallocate #import mach mach.h float cpu_usage kern_return_t kr task_info_data_t tinfo mach_msg_type_number_t task_info_count task_info_count TASK_INFO_MAX kr task_info mach_task_self.. cpu_usage kern_return_t kr task_info_data_t tinfo mach_msg_type_number_t task_info_count task_info_count TASK_INFO_MAX kr task_info mach_task_self TASK_BASIC_INFO task_info_t tinfo task_info_count if kr KERN_SUCCESS return 1 task_basic_info_t.. task_info_count TASK_INFO_MAX kr task_info mach_task_self TASK_BASIC_INFO task_info_t tinfo task_info_count if kr KERN_SUCCESS return 1 task_basic_info_t basic_info thread_array_t thread_list mach_msg_type_number_t thread_count thread_info_data_t..