Posts

WebView and ARC

Another ARC related note in my blog and as I can see a problem that maybe a couple of other coders have faced as well. I am using a custom WindowController to handle a WebView and some javascript to interact with a web page. When closing the window, the window controller should get closed. Yet, its dealloc method doesn't get called. After some digging I found out that javascript calls via the windowScriptObject block the release of the web view and thus of the window controller. Setting the value for my scripting key to nil was one solution. Yet, as soon as I called javascript functions with parameters from my windows controller, the dealloc was blocked again. Loading an empty string in the mainFrame of the WebView as soon as the window will close solved that for me. So, ARC and WebView seem to play nicely together

ARC, NSWindowController and NSDocument

For bcAdmin 3 I decided to give ARC a try and use it. For a large project like bcAdmin 3 that was a big step, and I wasn't sure in the beginning, if it was the way to go. Now and then I stumble over problems, most/all of these I could solve so far. One current one was the creation of NSWindowControllers for displaying informations in extra windows. Before ARC I was storing these in local variables of my document and was releasing them when possible or necessary. This needed some glue code I didn't like. Then I stumbled over NSDocument's -addWindowController: - which I missed completely the years before. First try was to create a local instance of my window controller, add it via the above method and when closing the window, I expected it to dealloc. It didn't... the trick was here to declare the local variable as __autoreleasing ... and now it works as expected.

bcAnalyze 2...

Or my current odysse... it is advancing, slowly, but progress is seen. I am quite happy about my decision to code it 10.6 only, since I can now finally make full use of so many of the nice new features of OS X. Yet, since I try to get higher and higher coding standards, I am still rearranging some of the more basic classes. That takes time, and sometimes is frustrating. My hope is to have a working copy with some of the new features in 3 to 4 weeks. Let's see if I can make a reality from that hope. Ah, what will be included until then? Playing of sound... easy. Done. Real time sonogram on file loading. Going there. Sound generation and filters. Already started. Printing. Hm... what was that again? Some time to go I fear.

Und noch mal: Erlangen und MPI

Nachdem ich immer wieder gefragt werde, wieso "wir" Naturschützer das MPI des Lichts in Erlangen nicht wollen, möchte ich für etwas Erleuchtung sorgen. Denn, die Aussage, wie gerne sie auch unterstellt oder in den Mund gelegt wird, ist so falsch. Das wäre genauso, als würden "wir" Naturschützer sagen, der Balleis oder der Stadtrat wollen Natur zerstören. Beides sind haltlose Unterstellungen, die allemal von billigen Stimmungsmachern genutzt werden. Daher - gleich zu Beginn: Niemand ist gegen das MPI, nur viele sind gegen den jetzigen Bauplan. Jeder hat seine Gründe, viele dieser Gründe sind ähnlich. Daher gibt es z.B. überhaupt eine Bürgerinitiative. Jeder, der ernsthaft verstehen will, was hier los ist, kann nun gerne weiterlesen. Die Berufs-Ignoranten können jetzt einfach aufhören zu lesen und weiter versuchen durch ihre Falschaussagen zu polarisieren. Wir sind eine Demokratie, und es besteht das Recht der freien Meinungsäusserung. Es gibt nicht nur aus naturschut...

Die Stadt Erlangen, ein MPI und etwas Natur

Hier einmal ein Beitrag, der rein gar nichts mit Apple zu tun hat... sondern meine Erfahrungen und Eindrücke einer politischen Veranstaltung in Erlangen widerspiegelt. Es handelt sich dabei um meine eigene und freie Meinung. Wer die aktuelle Politik in Erlangen (eine kleine Stadt in Nordbayern, nahe Nürnberg) verfolgt, hat sicher die Diskussion um den Bau eines Max-Planck-Instituts (Physik des Lichts) und die dadurch bedingte "Zerstörung" wertvoller Flächen mitbekommen. In einer Veranstaltung am 9.2. gab die Stadt, die Universität und die MPG Bürgern die Möglichkeit sich hierzu zu äußern - ach ja, der eigentliche Auftraggeber (staatliches Bauamt) war auch da. Vorne weg wurde vom Oberbürgermeister Ba. und dann vor allem von seinem Mitarbeiter Br. dargelegt, wieso die Planung überhaupt gar nicht anders gemacht werden könne. Das widerspricht natürlich einem offenen Dialog, wie ihn die Stadt von sich aus versprochen hat. Denn liegt so ein festes Bild vor, das zu Beginn als nicht-...

De-interleaved stereo and AudioBuffers

For the version 2 of bcAnalyze I am digging much deeper into CoreAudio to be able to do some of the things I have planned. The first that bcAnalyze does when it encounters an AudioFile is reading its data into an internal SInt16 buffer. ExtAudioFileRead works well for that if the file format is wav, mp3, aiff or one of the other known formats. While version 1 of bcAnalyze asks the user which channel to read, I decided to overcome this limitation. Still, the UI should only display and work with one channel, but the user should be able to switch between left/right for display and such. Simple solution, tell ExtAudioFileRead to read the stereo data into two buffers, one for each channel. Setting the proper client format was simple. For my purpose the internal format / client formatFlag is set: clientFormat.mFormatFlags = (!kAudioFormatFlagIsBigEndian | kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked | kAudioFormatFlagIsNonInterleaved); Then, whenever I tried to read a stereo fi...

iPad blogging

This is a First Test to blog from my New iPad. While it is for most users nothing but an Advanced Gaming Device with a nice touch, I see good use for it in my daily work. Already after a couple of days I do my news reading and tweeting preferably on the iPad. RSS Feeds are synched via my GoogleReader account by Feeddler. It integrates really well all those tasks in my daily rhythm, yet, I assume it can do much more. I plan to try sketching, GTD and note taking (especially for developing ideas) to do mainly on the iPad in the Next weeks. What I already dislike a lot is how hard it is to manage the iPad App store. Finding good apps is hard and expensive. Instead of having a trial period, you'll have to pay quite some squids to test drive apps. Often to find that the app is just not what I need. this truly has to improve if the iPad should once replace netbooks or laptops. And: tipping in english while the iPad is set to german is a pain.