OSSystem

Superclass:
NSObject
Declared In:

Introduction

System related functions: device info, system configuration, etc

Namespace
OSLibrary
Updated:
sábado, julio 30, 2011


Methods

+batteryLevel

Retrive battery level

+createObjectInConfiguration

Create and stores an object in configuration

+createObjectInConfiguration:forKey:

Create and stores an object in configuration

+disableIdleTimer

Disable the idle timer of the app

+existObjectInConfiguration:

Check if an object is created in NSUserDefaults

+getDateFormatForCurrentLocale:

This method return the current locale format for the components specified.

+getPreferredLanguage

Return the user selected preferred language identificator.

+invokeMethod:forObject:

Invoke a mothod of an object

+loadArrayFromResource:

Load an array structure stored in a plist file inside the main bundle.

+loadDictionaryFromResource:

Load a dictionary structure stored in a plist file inside the main bundle.

+radians:

Transforms degrees to radians

+redrawView:

Redraw a view

+registerUserDefaults

Register the default values in Settings.bundle

+screenBright

Screen brightness

+setScreenBright:

Sets a new screen bright


batteryLevel


Retrive battery level

+(float)batteryLevel; 
Return Value

A value form 0.0 to 1.0


createObjectInConfiguration


Create and stores an object in configuration

+(void)createObjectInConfiguration:(id)object forKey:(NSString*)objectName; 
Parameters
object

Object to store.

objectName

Name for the key assigned to this new entry

See Also


createObjectInConfiguration:forKey:


Create and stores an object in configuration

+(void)createObjectInConfiguration:(id)object forKey:(NSString*)objectName; 
Parameters
object

Object to store.

objectName

Name for the key assigned to this new entry

See Also


disableIdleTimer


Disable the idle timer of the app

+(void)disableIdleTimer; 
Discussion

This method is used to avoid the screen to autolock when the application is been idle for a time. Use this only for debugging.


existObjectInConfiguration:


Check if an object is created in NSUserDefaults

+(BOOL)existObjectInConfiguration:(NSString*)objectName; 
Return Value

YES if exists


getDateFormatForCurrentLocale:


This method return the current locale format for the components specified.

+(NSString*)getDateFormatForCurrentLocale:(NSString*)dateComponents; 
Parameters
dateComponents

A string containing date format patterns (such as “MM” or “h”). For full details, see http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns

Return Value

NSString*


getPreferredLanguage


Return the user selected preferred language identificator.

+(NSString*)getPreferredLanguage; 
Return Value

An string with the language id, like canonicalized IETF BCP 47 language identifier such as “en” or “fr”


invokeMethod:forObject:


Invoke a mothod of an object

+(void)invokeMethod:(id)methodName forObject:(id)object; 
Parameters
methodName

Name of the mehtod

object

Object to be invoked

Discussion

This method is used to invoke a selector of an object.


loadArrayFromResource:


Load an array structure stored in a plist file inside the main bundle.

+(NSMutableArray*)loadArrayFromResource:(NSString*)fileName; 
Parameters
fileName

The path to the file without the .plist extension

Return Value

a mutable array object.

Discussion

If the file doesn't exists, this method return nil.


loadDictionaryFromResource:


Load a dictionary structure stored in a plist file inside the main bundle.

+(NSMutableDictionary*)loadDictionaryFromResource:(NSString*)fileName; 
Parameters
fileName

The path to the file without the .plist extension

Return Value

a mutable dictionary object.

Discussion

If the file doesn't exists, this method return nil.


radians:


Transforms degrees to radians

+(double)radians:(double) degrees; 

redrawView:


Redraw a view

+(void)redrawView:(UIView*)view; 

registerUserDefaults


Register the default values in Settings.bundle

+(void)registerUserDefaults; 
Discussion

iOS load the Settings bundle automatically. But it doesn't register de default values. This method can do it. Call this method only once in first load, because it overwrite any previous value user entered.


screenBright


Screen brightness

+(float)screenBright; 
Return Value

A value from0.0 to 1.0


setScreenBright:


Sets a new screen bright

+(void)setScreenBright:(float)bright; 
Parameters
Value

from 0.0 to 1.0