Re: Number of layout managers for NSTextStorage increases

2010-09-13 Thread Jens Bauer
Hi Ross, Thank you for your reply and pointers. (Sorry it took so long; I didn't see your reply until today). >On Sep 7, 2010, at 12:22 PM, Jens Bauer wrote: > >> ...Does anyone have an idea about why the number of layout managers >> increase ? > >I don't know t

Number of layout managers for NSTextStorage increases

2010-09-07 Thread Jens Bauer
Hi all, I have an editor with a list of files, where I switch the contents of a NSTextView in and out when selecting a new file. For the switching I use the following lines: NSLog(@"[1] %s, layoutManager count: %d", __PRETTY_FUNCTION__, [[[textView textStorage] layoutManagers] count]); [layoutMa

Re: ObjC in time-critical parts of the code

2009-01-16 Thread Jens Bauer
Hi Shawn, Thankyou for the detailed explanation. I've probably been too quick to jump to the conclusion, and even though it works better (I've still seen no chops), I agree that something else most likely have an impact on my application. On Jan 16, 2009, at 18:26, Shawn Erickson wrote: O

Re: ObjC in time-critical parts of the code

2009-01-16 Thread Jens Bauer
Hi Jean-Daniel, On Jan 16, 2009, at 09:32, Jean-Daniel Dupas wrote: You don't want to understand. I'm sorry, if it appears to be like I do not want to understand. I've been working all night on this, and I'm quite sleepy right now. My results after changing to plain C are much better. My co

Re: ObjC in time-critical parts of the code

2009-01-16 Thread Jens Bauer
Hi Greg, On Jan 16, 2009, at 08:39, Greg Titus wrote: The point of what people are trying to tell you is that the result you are getting (3ms per empty Objective-C call) is approximately 500,000 times longer than the time you ought to be getting (5-6ns). If an Objective-C message send took

Re: ObjC in time-critical parts of the code

2009-01-16 Thread Jens Bauer
Hi Jeremy, On Jan 16, 2009, at 04:52, Jeremy Pereira wrote: On 15 Jan 2009, at 22:16, Jens Bauer wrote: ..often used around 3ms for the empty method "-renderObject". It gave me the terrible result of up to 21ms spent in the empty method! -So I'd like to let you know that

Re: ObjC in time-critical parts of the code

2009-01-15 Thread Jens Bauer
is tools like Shark and Instruments. Performance measurement may seem simple at first glance but it can be very subtly hard to get right. That's why tools for it are supplied with Xcode, and why they need explicit support from the operating system. -- Chris On Jan 15, 2009, at 2:1

ObjC in time-critical parts of the code

2009-01-15 Thread Jens Bauer
Hi all, I just want to let you know that I discovered I did a terrible mistake today. In other words: you don't have to learn from your own mistakes, if you can learn from mine. =) I investigated this, because my rendering was choppy. The code... - (void)renderObject { } - (void)renderAl

Re: A Data Object in Cocoa

2009-01-09 Thread Jens Bauer
You're right, it's not needed, and furthermore, I just checked, the warnings won't disappear. Everyone, disregard what I wrote about self-> I believe that prefixing the parameters is most likely the best way (and as a good example for us, the guys at Apple does it as well). Love, Jens On

Re: A Data Object in Cocoa

2009-01-09 Thread Jens Bauer
Hi Nik, self is a pointer, so you might want to change "self." into "self->" I usually prefix arguments with an 'a' (a for Argument): - (id)initWithLabel:(NSString *)aLabel pin:(NSString *)aPin seed: (NSString *)aSeed { self = [super init]; if(self) { l

Re: PDF Problem

2009-01-09 Thread Jens Bauer
Hi Devon, Perhaps you're looking in the wrong direction. Try checking if the image type on Leopard is the same as the image type on Tiger. If the image type on Tiger is 8 bit (or monochrome), and the image type on Leopard is 24-bit color, it might be the image itself, which forces your out

Re: Help

2009-01-09 Thread Jens Bauer
First, you should install XCode (either from your System Installation DVD or by downloading it from connect.apple.com - you'd need to register as a developer then). When installed, you should get familiar with XCode, copy one of the example-projects to your desktop from /Developer/Examples

Re: Programmatically locking user screen

2009-01-07 Thread Jens Bauer
7, 2009, at 16:02, Jean-Daniel Dupas wrote: Le 7 janv. 09 à 14:46, Jens Bauer a écrit : Hi Ashish, To save you from going down a path you may have to return from: I've used CoreGraphics fullscreen mode, however that's probably not a good approach for you, because if the user is

Re: Programmatically locking user screen

2009-01-07 Thread Jens Bauer
Hi Ashish, To save you from going down a path you may have to return from: I've used CoreGraphics fullscreen mode, however that's probably not a good approach for you, because if the user is pressing cmd+opt+escape, then the application just quits. -So try avoiding that one. =) Try Jim's so

Re: Visualization strategy/choosing a framework

2009-01-05 Thread Jens Bauer
Hi Adam, Happy New Year to you too! Go for OpenGL. If you choose something else, you might run into problems along the road. I know OpenGL can handle both 2D and 3D, and you get a fairly good support from samples on the Web. -Take a look at the CocoaGLView at http://developer.apple.com/ s

Re: Which language to get started with cocoa development?

2009-01-05 Thread Jens Bauer
Hi Achim, I'll only answer one of your questions, as I don't know much about all the scripting languages and possibilities for those. On Dec 31, 2008, at 09:22, Achim Domma wrote: I develop software for a living and want to get started with cocoa development just for fun. I'm good at pytho

Re: Basic: How to go about implementing such a view?

2009-01-05 Thread Jens Bauer
Hi Matt, Here's my opinion... :) On Dec 31, 2008, at 05:35, Matt Rajca wrote: I am trying to figure out how to implement a 'Piano Roll' view in Cocoa. Attached is a screenshot of what I'm trying to accomplish. Disregard the keyboard on the left of the window and let's just focus on the ar

Re: NSTimer EXC_BAD_ACCESS

2008-12-14 Thread Jens Bauer
That's an easy one. -Easy for me, because I had much trouble with it earlier. =) Remember to retain your timer: - (void)timerStop { if(timer) { [timer invalidate]; [timer release]; timer = NULL; } } - (void)timerStart:(do

Re: Cleanup inside a failed init method

2008-12-07 Thread Jens Bauer
Hi Chuck, On Dec 7, 2008, at 03:00, Charles Steinman wrote: I'm sorry, I think I misunderstood the following line (due to the way we say things in Danish): Happily, the object should be released anyway if you plan to return nil since otherwise you'll leak a half-initialized object every ti

Re: Cleanup inside a failed init method

2008-12-06 Thread Jens Bauer
Hi Chuck, On Dec 6, 2008, at 22:36, Charles Steinman wrote: The system will only call dealloc if the object is released. Happily, the object should be released anyway if you plan to return nil since otherwise you'll leak a half-initialized object every time the method fails. So you should

Re: How to extract individual icons from icns file?

2008-12-04 Thread Jens Bauer
Good old Iconographer (Carbon). Wonderful little app, it's now free. http://www.mscape.com/ Love, Jens On Dec 4, 2008, at 20:16, David wrote: Is there a tool available to extract individual icons from an icns file? In particular the smaller ones. I've tried several tools but none of them wor