<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1457922330657771578</id><updated>2011-07-28T22:36:53.865-05:00</updated><title type='text'>enum { NSNotFound = 0x7fffffff };</title><subtitle type='html'>Odd notes about developing in Cocoa and Objective-C</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://nsnotfound.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://nsnotfound.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>NSNotFound</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1457922330657771578.post-3417746313462319203</id><published>2009-06-30T12:36:00.003-05:00</published><updated>2009-06-30T12:45:46.087-05:00</updated><title type='text'>Safer IFs</title><content type='html'>I keep trying to use this form:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&amp;nbsp;if (NSNotFound == index) {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;rather than the old:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&amp;nbsp;if (index == NSNotFound) {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;but I keep typing the older form. Gotta teach this old dog a new trick.&lt;br /&gt;&lt;br /&gt;P.S. The benefit is that you can't accidentally type:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&amp;nbsp;if (index = NSNotFound) {&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1457922330657771578-3417746313462319203?l=nsnotfound.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nsnotfound.blogspot.com/feeds/3417746313462319203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1457922330657771578&amp;postID=3417746313462319203' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/3417746313462319203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/3417746313462319203'/><link rel='alternate' type='text/html' href='http://nsnotfound.blogspot.com/2009/06/order-of-logical-expressions.html' title='Safer IFs'/><author><name>NSNotFound</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1457922330657771578.post-4423614140002707354</id><published>2008-05-27T14:27:00.003-05:00</published><updated>2009-06-30T12:46:17.905-05:00</updated><title type='text'>Bindings in Cocoa UIs</title><content type='html'>Using bindings to simplify Cocoa UI implementation is pretty standard stuff these days.  And binding a UI control to a preference value is pretty simple too - very common for preference panels.&lt;br /&gt;&lt;br /&gt;But occasionally I've need to have my code do something when the preference value changes and Key-Value observing seemed like the obvious way to make this work. Unfortunately I didn't know the right incantations and I'd end up needing to add an action method that was triggered when the user interacted with the control. It worked, but it seemed like I was mixing metaphors and there should be a nicer way to deal with this situation.&lt;br /&gt;&lt;br /&gt;It turns out that there &lt;b&gt;is&lt;/b&gt; a nice way to live wholly in a bindings world. NSUserDefaultsController provides -sharedUserDefaultsController which returns the right controller to add the observer to. Good so far.&lt;br /&gt;&lt;br /&gt;But there is one further little wrinkle to make this work. While you might think that the keyPath you are observing would be the usual key string used to reference the preference, but that isn't right. You need to prefix your key with "values.". &lt;br /&gt;&lt;br /&gt;Putting these two pieces of the puzzle together gives you code that looks something like the following:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// use this in your init routine&lt;br /&gt;[[NSUserDefaultsController sharedUserDefaultsController] addObserver: self&lt;br /&gt;                                                          forKeyPath: @"values.MyPreferenceKey"&lt;br /&gt;                                                             options: 0&lt;br /&gt;                                                             context: NULL];&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;along with implementing this method:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// implement this method to handle the notifications&lt;br /&gt;- (void) observeValueForKeyPath: (NSString *) keyPath&lt;br /&gt;                       ofObject: (id) object&lt;br /&gt;                         change: (NSDictionary *) change&lt;br /&gt;                        context: (void *) context&lt;br /&gt;{&lt;br /&gt;    if ([keyPath isEqualToString:@"values.MyPreferenceKey"]) {&lt;br /&gt;        // do something in response to that change&lt;br /&gt;    }&lt;br /&gt;}        &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and of course, don't forget to remove this later:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;- (void) dealloc&lt;br /&gt;{&lt;br /&gt;    [[NSUserDefaultsController sharedUserDefaultsController] removeObserver: self&lt;br /&gt;                                                                 forKeyPath: @"values.MyPreferenceKey"];&lt;br /&gt;    [super dealloc];&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1457922330657771578-4423614140002707354?l=nsnotfound.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nsnotfound.blogspot.com/feeds/4423614140002707354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1457922330657771578&amp;postID=4423614140002707354' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/4423614140002707354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/4423614140002707354'/><link rel='alternate' type='text/html' href='http://nsnotfound.blogspot.com/2008/05/using-bindings-to-simplify-cocoa-ui.html' title='Bindings in Cocoa UIs'/><author><name>NSNotFound</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1457922330657771578.post-3997746322345911293</id><published>2007-08-28T18:44:00.000-05:00</published><updated>2007-08-28T18:59:33.289-05:00</updated><title type='text'>NSImageView and image filenames</title><content type='html'>One of my pet peeves with the cocoa class NSImageView is that there is no way to directly get the path of image files you drop on this view.&lt;br /&gt;&lt;br /&gt;Below is my cure for this. It overrides two methods to do its work.&lt;br /&gt;&lt;br /&gt;First it overrides -performDragOperation to grab the filename from the draggingPasteboard, squirreling it away in an ivar for later access.&lt;br /&gt;&lt;br /&gt;This may be sufficient for many uses, especially if you can easily access the view from you code.  In my last use of this code, I was using bindings, so I wanted the filename to be available to me when -observeValueForKeyPath was called with a keyPath of "selection.image". I didn't have any reference to the NSImageView at that point, so I have the code set the image's name to be the path string. That makes it easy enough to access the image's name later when needed.&lt;br /&gt;&lt;br /&gt;Note: this code sets the image's name in the -setImage method because trying to set the name of the view's image inside -performDragOperation results in setting the name for the old image (the one being replaced), rather than the new one. &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;@interface MyImageView : NSImageView&lt;br /&gt;{&lt;br /&gt;    NSString *mImagename;&lt;br /&gt;}&lt;br /&gt;@end&lt;br /&gt;&lt;br /&gt;@implementation MyImageView&lt;br /&gt;&lt;br /&gt;- (void)setImage:(NSImage *)image&lt;br /&gt;{&lt;br /&gt;    [image setName:[[mImagename lastPathComponent] stringByDeletingPathExtension]];&lt;br /&gt;    [super setImage:image];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;- (BOOL)performDragOperation:(id &lt;NSDraggingInfo&gt;)sender&lt;br /&gt;{&lt;br /&gt;    BOOL dragSucceeded = [super performDragOperation:sender];&lt;br /&gt;    if (dragSucceeded) {&lt;br /&gt;        NSString *filenamesXML = [[sender draggingPasteboard] stringForType:NSFilenamesPboardType];&lt;br /&gt;        if (filenamesXML) {&lt;br /&gt;            NSArray *filenames = [NSPropertyListSerialization&lt;br /&gt;                        propertyListFromData:[filenamesXML dataUsingEncoding:NSUTF8StringEncoding]&lt;br /&gt;                            mutabilityOption:NSPropertyListImmutable&lt;br /&gt;                                      format:nil&lt;br /&gt;                            errorDescription:nil];&lt;br /&gt;            if ([filenames count] &gt;= 1) {&lt;br /&gt;                mImagename = [filenames objectAtIndex:0];&lt;br /&gt;            } else {&lt;br /&gt;                mImagename = nil;   &lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    return dragSucceeded;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@end&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1457922330657771578-3997746322345911293?l=nsnotfound.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nsnotfound.blogspot.com/feeds/3997746322345911293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1457922330657771578&amp;postID=3997746322345911293' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/3997746322345911293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/3997746322345911293'/><link rel='alternate' type='text/html' href='http://nsnotfound.blogspot.com/2007/08/nsimageview-and-image-filenames.html' title='NSImageView and image filenames'/><author><name>NSNotFound</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1457922330657771578.post-2817469315985250199</id><published>2007-08-21T19:22:00.000-05:00</published><updated>2007-08-21T19:37:36.161-05:00</updated><title type='text'>Picking up PageSetup Dialog Changes</title><content type='html'>The standard Page Setup dialog (OK, "sheet") can be customized by implementing -runPageLayout in your NSApplication or NSDocument subclass. It's all nicely documented in Apple's fine &lt;a href="http://developer.apple.com/documentation/Cocoa/Conceptual/Printing/index.html?http://developer.apple.com/documentation/Cocoa/Conceptual/Printing/Tasks/UsingPrintLayoutPanel.html"&gt;Developer Docs&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;But what if the standard dialog is fine for your needs but you still want to run some code when the user changes the page setup?&lt;br /&gt;&lt;br /&gt;All you need to do is implement -setPrintInfo in your NSDocument subclass. It'll get called with the new printInfo. Something like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;- (void) setPrintInfo:(NSPrintInfo*)info&lt;br /&gt;{&lt;br /&gt;    [super setPrintInfo:info];&lt;br /&gt;    [self myCodeThatDoesSomethingWithTheNewPrintInfo];&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1457922330657771578-2817469315985250199?l=nsnotfound.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nsnotfound.blogspot.com/feeds/2817469315985250199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1457922330657771578&amp;postID=2817469315985250199' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/2817469315985250199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/2817469315985250199'/><link rel='alternate' type='text/html' href='http://nsnotfound.blogspot.com/2007/08/picking-up-pagesetup-dialog-changes.html' title='Picking up PageSetup Dialog Changes'/><author><name>NSNotFound</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1457922330657771578.post-5108214397889678077</id><published>2007-04-18T19:05:00.000-05:00</published><updated>2007-04-18T19:11:54.354-05:00</updated><title type='text'>Automatically reopen a document on launch</title><content type='html'>&lt;p&gt;A handy technique during development is to have an application automatically open the last document it used each time it's launched.&lt;p&gt;&lt;br /&gt;It's just that much faster to get back running the app after making a change.&lt;p&gt;&lt;br /&gt;Add this method to the app delegate:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;- (void)applicationDidFinishLaunching:(NSNotification *)aNotification&lt;br /&gt;{&lt;br /&gt;    NSArray *urls = [[NSDocumentController sharedDocumentController] recentDocumentURLs];&lt;br /&gt;    if ([urls count] &gt; 0) {&lt;br /&gt;        [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:[urls objectAtIndex:0]&lt;br /&gt;                                                                               display:YES];&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1457922330657771578-5108214397889678077?l=nsnotfound.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nsnotfound.blogspot.com/feeds/5108214397889678077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1457922330657771578&amp;postID=5108214397889678077' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/5108214397889678077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/5108214397889678077'/><link rel='alternate' type='text/html' href='http://nsnotfound.blogspot.com/2007/04/automatically-reopen-document-on-launch.html' title='Automatically reopen a document on launch'/><author><name>NSNotFound</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1457922330657771578.post-71802251024425860</id><published>2007-03-06T09:12:00.000-05:00</published><updated>2007-03-06T10:40:17.884-05:00</updated><title type='text'>if blocks</title><content type='html'>&lt;p&gt;I've never understood why some programmers continue to write C code in the form:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;if (someCondition)&lt;br /&gt;   doSomething();&lt;br /&gt;else &lt;br /&gt;   doSomethingElse();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;as opposed to&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;if (someCondition) {&lt;br /&gt;   doSomething();&lt;br /&gt;} else {&lt;br /&gt;   doSomethingElse();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Beyond saving a couple of keystrokes, the first example has absolutely no advantage over the second. While the second is much more bullet proof.&lt;br /&gt;&lt;br /&gt;When working on code written by others that cling to the first form, I continue to run across code like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;if (someCondition)&lt;br /&gt;   doSomething();&lt;br /&gt;   doMore();&lt;br /&gt;doOtherthings();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Where the intention is that doMore() is intended to be executed only when someCondition is true.&lt;br /&gt;&lt;br /&gt;When you look at the history of the code it almost always starts out as&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;if (someCondition)&lt;br /&gt;   doSomething();&lt;br /&gt;doOtherthings();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;and then later the doMore() is added.&lt;br /&gt;&lt;br /&gt;Please, please, please take the extra split second it takes to type in the safe form of the if from day one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1457922330657771578-71802251024425860?l=nsnotfound.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nsnotfound.blogspot.com/feeds/71802251024425860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1457922330657771578&amp;postID=71802251024425860' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/71802251024425860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/71802251024425860'/><link rel='alternate' type='text/html' href='http://nsnotfound.blogspot.com/2007/03/if-blocks.html' title='if blocks'/><author><name>NSNotFound</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1457922330657771578.post-3039405590465498652</id><published>2007-02-17T15:31:00.000-05:00</published><updated>2007-02-17T15:40:00.517-05:00</updated><title type='text'>Timing operations</title><content type='html'>I'll sometimes want to measure the time a certain operation takes and compare it with another operation or to compare it with another implementation of the same operation. Here's the fragment of Cocoa code I use to do that:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  NSDate *startTime = [NSDate date];&lt;br /&gt;&lt;br /&gt;  { ... } // the operation that I'm timing&lt;br /&gt;&lt;br /&gt;  NSTimeInterval elapsedTime = -[startTime timeIntervalSinceNow];&lt;br /&gt;&lt;br /&gt;  NSLog(@"That took %f seconds", elapsedTime);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This code grabs the current time using NSDate, does something, calculates the time spent doing the operation, and then logs the result.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1457922330657771578-3039405590465498652?l=nsnotfound.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nsnotfound.blogspot.com/feeds/3039405590465498652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1457922330657771578&amp;postID=3039405590465498652' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/3039405590465498652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/3039405590465498652'/><link rel='alternate' type='text/html' href='http://nsnotfound.blogspot.com/2007/02/timing-operations.html' title='Timing operations'/><author><name>NSNotFound</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1457922330657771578.post-2364102246902110428</id><published>2007-02-14T10:33:00.000-05:00</published><updated>2007-02-14T10:50:11.295-05:00</updated><title type='text'>Optional breakpoints</title><content type='html'>I sometimes find myself wanting to break into the debugger only after a series of steps that would otherwise trigger the breakpoint. I find the following code snippet useful in some of these situations.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   BOOL optionKeyIsDown = (([[NSApp currentEvent] modifierFlags] &amp; NSAlternateKeyMask) != 0);&lt;br /&gt;   if (optionKeyIsDown) {&lt;br /&gt;      NSLog(@"voila");&lt;br /&gt;   }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You set a breakpoint on the NSLog() which it's only triggered when you have the option key down.&lt;br /&gt;&lt;br /&gt;It's easy to use another modifier key if you like by using another key mask constant instead of NSAlternateKeyMask.&lt;br /&gt;&lt;br /&gt;The downside of course is that it requires a little piece of live code that needs to be cleaned up before ship time.&lt;br /&gt;&lt;br /&gt;This same approach can useful for other things as well. For example, you could trigger a data structure verification routine. Maybe that routine is very time consuming and you don't want it interfering with normal execution, but by simply holding down the option key (or may multiple modifier keys) you can trigger some special code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1457922330657771578-2364102246902110428?l=nsnotfound.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nsnotfound.blogspot.com/feeds/2364102246902110428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1457922330657771578&amp;postID=2364102246902110428' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/2364102246902110428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/2364102246902110428'/><link rel='alternate' type='text/html' href='http://nsnotfound.blogspot.com/2007/02/optional-breakpoints.html' title='Optional breakpoints'/><author><name>NSNotFound</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1457922330657771578.post-608740862130554130</id><published>2007-02-11T12:42:00.000-05:00</published><updated>2007-02-11T19:35:19.770-05:00</updated><title type='text'>A simple ~/.gdbinit file</title><content type='html'>I have a one line &lt;strong&gt;.gdbinit&lt;/strong&gt; file containing:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt; fb -[NSException raise] &lt;/pre&gt;&lt;br /&gt;This is executed each time gdb (the Xcode debugger) is started. With this the code will break into the debugger whenever an exception is raised by a Cocoa program. &lt;br /&gt;&lt;br /&gt;fb is "forward break" which unlike plain b, or "break", will set a breakpoint on code that hasn't been loaded yet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1457922330657771578-608740862130554130?l=nsnotfound.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nsnotfound.blogspot.com/feeds/608740862130554130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1457922330657771578&amp;postID=608740862130554130' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/608740862130554130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/608740862130554130'/><link rel='alternate' type='text/html' href='http://nsnotfound.blogspot.com/2007/02/simple-gdbinit-file.html' title='A simple ~/.gdbinit file'/><author><name>NSNotFound</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1457922330657771578.post-3607737630447180737</id><published>2007-02-11T11:45:00.000-05:00</published><updated>2007-02-11T12:08:05.403-05:00</updated><title type='text'>About My Mac</title><content type='html'>&lt;img src="http://lh5.google.com/image/nsnotfound/Rc9NXtB_K-I/AAAAAAAAAAw/7KZ8o79KFgI/AboutThisMacFebruary2007.png" width="323" height="391" style="border:none;padding:0px;margin-top:16px;"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1457922330657771578-3607737630447180737?l=nsnotfound.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nsnotfound.blogspot.com/feeds/3607737630447180737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1457922330657771578&amp;postID=3607737630447180737' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/3607737630447180737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1457922330657771578/posts/default/3607737630447180737'/><link rel='alternate' type='text/html' href='http://nsnotfound.blogspot.com/2007/02/about-my-mac.html' title='About My Mac'/><author><name>NSNotFound</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
