Circular Views


You can do the same sort of thing with NSView instances:
    NSWindow *win = [self window];
    NSView *a = [[NSView alloc] initWithFrame: NSMakeRect(0, 0, 1, 1)];
    [a addSubview: a];
    [[win contentView] addSubview: a];
To make this break, all you have to do is attempt to show the window. You don't even have to try to print a description or compare it for equality like that. When trying to show the window, the app will just crash trying to chase down to the bottom of the view hierarchy:
    (lldb) bt
    * thread #1: tid = 0x458bf, 0x00007fff8c972528 AppKit`NSViewGetVisibleRect + 130, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=2, address=0x7fff5f3ffff8)
                    frame #0: 0x00007fff8c972528 AppKit`NSViewGetVisibleRect + 130
                    frame #1: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #2: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #3: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #4: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #5: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #6: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #7: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #8: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #9: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #10: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #11: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #12: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #13: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #14: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #15: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #16: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #17: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #18: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #19: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288
                    frame #20: 0x00007fff8c9725c6 AppKit`NSViewGetVisibleRect + 288


источник