Exercises

  1. Add NSHost to CFChatterClient.

  2. Add the observer callback to your CFChatterClient.

  3. If you run scf-dump on a laptop, you’ll probably see something like this:

    k​e​y​ ​i​s​ ​S​t​a​t​e​:​/​I​O​K​i​t​/​P​o​w​e​r​S​o​u​r​c​e​s​/​I​n​t​e​r​n​a​l​B​a​t​t​e​r​y​-​0​
     ​ ​ ​ ​M​a​x​ ​C​a​p​a​c​i​t​y​ ​:​ ​9​6​2​
     ​ ​ ​ ​C​u​r​r​e​n​t​ ​C​a​p​a​c​i​t​y​ ​:​ ​9​6​2​
     ​ ​ ​ ​N​a​m​e​ ​:​ ​I​n​t​e​r​n​a​l​B​a​t​t​e​r​y​-​0​
     ​ ​ ​ ​I​s​ ​P​r​e​s​e​n​t​ ​:​ ​1​
     ​ ​ ​ ​I​s​ ​C​h​a​r​g​i​n​g​ ​:​ ​0​
     ​ ​ ​ ​T​i​m​e​ ​t​o​ ​F​u​l​l​ ​C​h​a​r​g​e​ ​:​ ​0​
     ​ ​ ​ ​T​r​a​n​s​p​o​r​t​ ​T​y​p​e​ ​:​ ​I​n​t​e​r​n​a​l​
     ​ ​ ​ ​T​i​m​e​ ​t​o​ ​E​m​p​t​y​ ​:​ ​0​
     ​ ​ ​ ​P​o​w​e​r​ ​S​o​u​r​c​e​ ​S​t​a​t​e​ ​:​ ​A​C​ ​P​o​w​e​r​
    

    Extend the SCFMonitor application to ...

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.