Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198
LibMobileGestalt.dylib: Difference between revisions - iPhone Development Wiki

LibMobileGestalt.dylib: Difference between revisions

From iPhone Development Wiki
(link a really useful relevant blog post)
Line 13: Line 13:
== MGGetBoolAnswer (iOS 7+) ==
== MGGetBoolAnswer (iOS 7+) ==
<source lang=c>
<source lang=c>
// CFBooleanRef MGGetBoolAnswer(CFStringRef string);
// Boolean MGGetBoolAnswer(CFStringRef key);
CFBooleanRef value = MGGetBoolAnswer(CFSTR("UIProceduralWallpaperCapability"));
Boolean value = MGGetBoolAnswer(CFSTR("UIProceduralWallpaperCapability"));
NSLog(@"Value: %@", (id)value);
NSLog(@"Value: %d", value);
CFRelease(value);
</source>
</source>



Revision as of 01:36, 23 February 2019


libMobileGestalt is a library that can be used to get various system values such as the UDID, disk usage, device version and much more. It is comparable to liblockdown.dylib. See also lockdownd.

MGCopyAnswer

// Common form: MGCopyAnswer(CFStringRef string);
CFStringRef value = MGCopyAnswer(kMGDeviceColor);
NSLog(@"Value: %@", value);
CFRelease(value);

MGGetBoolAnswer (iOS 7+)

// Boolean MGGetBoolAnswer(CFStringRef key);
Boolean value = MGGetBoolAnswer(CFSTR("UIProceduralWallpaperCapability"));
NSLog(@"Value: %d", value);
  • Note: You are responsible for freeing the value returned by MGCopyAnswer and MGGetBoolAnswer.

References

External links