Re: Thread-safe singleton with lazy initialisation

2015-08-18 Thread Simone Tellini
ecause there > is nothing to lock on: if you used GCD, it would be simpler: + (instancetype)sharedInstance { static dispatch_once_t once; static id ret; dispatch_once( &once, ^{ ret = [[self alloc] init]; } ); return ret; }

Re: Looking at self = [super init].

2015-05-29 Thread Simone Tellini
an self, yet not nil? In that case, your code wouldn’t be correct, as a general rule... -- Simone Tellini http://tellini.info ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the l

Re: How test whether Mac app is running in Xcode?

2013-10-15 Thread Simone Tellini
is: https://developer.apple.com/library/mac/qa/qa1361/_index.html -- Simone Tellini http://tellini.info ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Conta

Re: Analyser reports memory leak… where?

2013-09-12 Thread Simone Tellini
s might be the "potential" problem it complains about: -eventTypes can create a new object which never goes away (since its name doesn't imply a +1 return, the caller is not supposed to release it). -- Simone Tellini http://tellini.info/ __

Re: Analyser reports memory leak… where?

2013-09-12 Thread Simone Tellini
___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.co

Re: How to detect a Retina Mac

2013-08-19 Thread Simone Tellini
e new context, you just need to start drawing -- Simone Tellini http://tellini.info ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins

Re: How to detect a Retina Mac

2013-08-18 Thread Simone Tellini
yBy: -1]; [transform set]; ...do some drawing... [NSGraphicsContext restoreGraphicsState]; data = [bitmapRep representationUsingType: NSPNGFileType properties: nil]; [bitmapRep release]; -- Simone

Re: Major Xcode irritation

2013-08-12 Thread Simone Tellini
ted the file content, can't you simply reset the modification date to solve your problem? It appears you know which one to set, so you can simply use touch in Terminal -- Simone Tellini http://www.tellini.org ___ Cocoa-dev mailing list (Cocoa-dev

Re: Where are temporary documents stored until saved?

2012-12-30 Thread Simone Tellini
o why don't you just disable auto-saving, maybe with an option so you can switch it off only on your development machine? Check the "Autosaving" methods in NSDocument: https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/nsdocument_Class/R

Re: Sandbox, security bookmarks and trash

2012-10-29 Thread Simone Tellini
ser set those paths in the document, he expected to find exported data at those locations until he changed them (other applications might consume those files and they might not even run on a Mac). -- Simone Tellini http://tellini.info ___ Cocoa-

Sandbox, security bookmarks and trash

2012-10-27 Thread Simone Tellini
point to the deleted file (ie. something like ".../.Trash/..."). I'd rather like the application to keep on re-creating the file at the path the user has chosen in the first place (ie. "~/Documents/exporteddata.xml"). Is it possible? Or how do you handle this sce

Re: Embedding resources in Static Cocoa Library

2012-10-08 Thread Simone Tellini
Il giorno 09/ott/2012, alle ore 03:15, Alexander Bokovikov ha scritto: > > On Oct 9, 2012, at 1:00 AM, Simone Tellini wrote: > >> >> this is way overkill. You can simply write a simple utility to dump the >> content of your resource in a C file: >> >&

Re: Embedding resources in Static Cocoa Library

2012-10-07 Thread Simone Tellini
le: static char foo[] = { 0x01, 0x02, 0x03, ... }; You don't need to use assembly nor to create bogus functions to get the address of foo. -- Simone Tellini http://tellini.info ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: Avoid drawing in half pixel

2010-05-05 Thread Simone Tellini
ng, because Im > drawing some strings also in the view, so having no AA will affect them > isn't it? you can turn it on/off according to your needs: ie. turn it off, draw vertical/horizontal lines that you don't want to become blurry, turn it on and draw the rest. -- Simone

Re: Avoid drawing in half pixel

2010-05-05 Thread Simone Tellini
On Wed, 05 May 2010 17:40:24 +0200, Simone Tellini wrote: > ___ > ok, this weird. If I reply with Thunderbird, the body of the message gets eaten by the mailing list server. I was saying: > I was reading the apple docs about this topic, an

Re: Avoid drawing in half pixel

2010-05-05 Thread Simone Tellini
___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com

Re: Avoid drawing in half pixel

2010-05-05 Thread Simone Tellini
___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com

Re: Slow performance of adding MIDI Events to MusicTrack?

2009-12-08 Thread Simone Tellini
? yes, I've noticed the same thing. Luckily, I've never had to add that many events/notes, so I could bear to wait for some seconds. -- Simone Tellini http://www.tellini.org ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please d

[ANN] FeedbackReporter to Mantis integration

2009-05-04 Thread Simone Tellini
Hi, I've just written a small php script to integrate the FeedbackReporter framework by Torsten Curdt with a Mantis bugtracking system. For links, comments and suggestions: http://tellini.info/blog/archives/81-FeedbackReporter-and-Mantis-integration.html -- Simone Tellini

Re: How to get the "white shadow" effect when drawing NSStrings?

2009-02-21 Thread Simone Tellini
is Leopard-only. or he could simply draw the same string twice: first using the white color, then in black, shifting the y coord by 1 pixel. It should achieve the same effect and it'll work on previous OS X versions too. -- Simone Tellini http://

Re: apple remote

2008-10-05 Thread Simone Tellini
Apple asking for an official Apple Remote API though. Let's hope they get enough requests to actually provide one. -- Simone Tellini http://tellini.info ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: warning: initialization makes integer from pointer without a cast

2008-08-21 Thread Simone Tellini
everything right. Any ideas? const char *cUserName = [username UTF8String]; UTF8String returns a pointer to a string (char *), not a single byte (char) -- Simone Tellini http://tellini.info ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com

Re: CSV parsing (large files)

2008-07-29 Thread Simone Tellini
ine. Don't load the whole file in memory: it's just a waste of memory and time to allocate it. Instead parse a line at a time. Also, you might want to issue "PRAGMA synchronous = NORMAL" or "PRAGMA synchronous = OFF" before everything else (look at its me

Re: NSTimer and NSLock

2008-07-13 Thread Simone Tellini
the method at the end of UpdateWindow? -- Simone Tellini http://tellini.info ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at