Re: How to subclass UIButton?

2010-04-08 Thread Jack Nutting
On Thu, Apr 8, 2010 at 8:42 AM, WT  wrote:
>
> Is the fact that -initWithFrame: is the designated initializer documented 
> anywhere? The docs for UIButton don't mention it. If this is documented 
> and/or won't change, then it's the solution I've been looking for.
>

It is documented, but in a way that might not be terribly obvious.
The docs for UIButton don't mention a designated initializer, and the
docs for its parent UIControl don't help either, but if you go one
further, the UIView docs tell you this.  In general, if the docs for a
class don't specify a designated initializer, you can search up the
inheritance tree until you find one.

-- 
// jack
// http://nuthole.com
// http://learncocoa.org
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How does Finder determine when a file is busy being written to the disk?

2010-04-08 Thread Matt Gough
FYI, kMagicBusyCreationDate is 8:34:56am on 14th Feb 1946 (GMT).

When copying an entire folder, it only sets the top-level folder's creation 
time to this, not all the sub-items.

I suspect, but haven't tested, that anything going through FSCopyObject 
will exhibit the same behaviour.

Matt

On 8 Apr 2010, at 01:13:24, Sean McBride wrote:

> On Wed, 7 Apr 2010 19:31:19 -0400, Lee Gillen said:
> 
>> When copying large files (over a GB each) from a network drive to a
>> local drive Finder shows these files are busy by graying their
>> filename out until they are finished writing to the local system.
> 
> Not sure if it still applies these days, but look through Finder.h, and
> read about kFirstMagicBusyFiletype and kMagicBusyCreationDate.
> 
> --
> 
> Sean McBride, B. Eng s...@rogue-research.com
> Rogue Researchwww.rogue-research.com
> Mac Software Developer  Montréal, Québec, Canada
> 
> 
> ___
> 
> 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/mailman/options/cocoa-dev/mgough%40humyo.com
> 
> This email sent to mgo...@humyo.com

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


[ANN] AppKiDo-for-iPhone 0.984 fixes bug with 3.2 SDK

2010-04-08 Thread Andy Lee
Version 0.984 of AppKiDo-for-iPhone contains an important bug fix:



Many thanks to Jeff Johnson for fixing an incompatibility with the latest 3.2 
docs, such that no documentation would appear.

Regular AppKiDo (for Cocoa) is unaffected.  The only difference is that a minor 
memory leak was fixed.

--Andy

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [ANN] AppKiDo-for-iPhone 0.984 fixes bug with 3.2 SDK

2010-04-08 Thread Roland King
that link didn't work for me for some reason, this one does though. 

http://homepage.mac.com/aglee/downloads/appkido.html



On 08-Apr-2010, at 5:23 PM, Andy Lee wrote:

> Version 0.984 of AppKiDo-for-iPhone contains an important bug fix:
> 
> 
> 
> Many thanks to Jeff Johnson for fixing an incompatibility with the latest 3.2 
> docs, such that no documentation would appear.
> 
> Regular AppKiDo (for Cocoa) is unaffected.  The only difference is that a 
> minor memory leak was fixed.
> 
> --Andy
> 
> ___
> 
> 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/mailman/options/cocoa-dev/rols%40rols.org
> 
> This email sent to r...@rols.org

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


CSS style string to NSAttributedString attributes conversion

2010-04-08 Thread jonat...@mugginsoft.com
I want to convert CSS style strings to NSAttributedString attributes.

AppKit and WebKit don't seem to offer a solution.

Does anyone know of any permissive licence third part code?

Regards

Jonathan Mitchell

Developer
http://www.mugginsoft.com






___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSPrintInfo, setting filename for print to PDF?

2010-04-08 Thread Chaitanya Pandit
Hi,
You should set the name in the NSPrintOperation object, look at the 
"setJobTitle:" method of NSPrintOperation

Thanks,

Chaitanya Pandit


On Apr 8, 2010, at 2:56 AM, Brian Postow wrote:

> Ok, I'm still working on this from my other question. I can see the printinfo 
> before I run the operation, and it looks correct. NSSavePath is set to the 
> path I want, as is the jobsavingURL. When, but when I actually DO the print 
> to PDF, the filename, the filename becomes .pdf.pdf.
> 
> When I cancel out of the print, the printinfo says the value is "" If I 
> actually type something in and SAVE, then nsSavePath has the path to the save 
> file. 
> 
> I can't find any sample code that tries to do this, and when I google search, 
> I get my own questions. Obviously, I'm searching for the wrong thing (cocoa 
> "save to pdf" nsprintinfo; for example). Can someone give me a pointer of a 
> better search term, even if you don't know the answer?
> 
> thanks.
> 
> 
> Brian Postow
> Senior Software Engineer
> Acordex Imaging Systems
> 
> ___
> 
> 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/mailman/options/cocoa-dev/chaitanya%40expersis.com
> 
> This email sent to chaita...@expersis.com

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Best way to Define Project Wide Static Strings?

2010-04-08 Thread Dave

Hi All,

I have a number of Constant Strings that are project wide. I started  
off defining them at the top of a .m file but as the project has  
grown over the weeks I've pasted them into each new .m file as and  
when they are needed. I'm now tidying up my code and was wondering  
the best way in which to make them project wide and how to reference  
them.


Here is an example way I have them defined at present:

static NSString kString1 = @"some string";
static NSString kString2 = @"some other string";

What is a good way to handle this? Is there a preferred method?

Thanks a lot
All the Best
Dave



___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


The right place for an importer in the document architecture

2010-04-08 Thread Gideon King
Hi

I have an importer to convert different file types into my native file format. 
Due to the nature of the importer process, I need to run it as a separate 
converter, so the process flow is:
1. The user selects the file to open (not in my native format)
2. The program reads it and writes out a file in my native format
3. I read the document from the native format version
4. Set the URL to nil because it is effectively a new document
5. Display the document

So I need to know where in the process I need to intercept the original file 
open request and do the conversion, and forward the request to open the 
converted file.

Would it be best to subclass NSDocumentController and override 
-makeDocumentWithContentsOfURL:ofType:error: and do the conversion, and call 
super with the new URL to the converted document, get the result back and set 
the URL to nil, and return it? 

Would there be any side effects from that (because openDocument... used a 
different URL)?

...or will I need to go back to -openDocumentWithContentsOfURL:display:error: 
and work out the file type from the extension and work from there? 

I'm assuming that anything within NSDocument or NSPersistentDocument is too 
late in the piece...
 
Thanks

Gideon




___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


"Toll free" bridge from NSAttributedString * to CFAttributedStringRef

2010-04-08 Thread vincent habchi
Hi there,

I've been fiddling with NSAttributedString lately, and the way to display them 
through Core Text. In the docs, I've read that NSAttributedString and 
CFAttributedStringRef were supposed to be "toll free" bridged; I assumed that 
meant that one could be used in lieu of the other with (or maybe even without) 
a simple cast.

But I found this is not true. Specifically, I was getting strange errors like 
"CFSet[Stroke|Fill]ColorFromColor : invalid context 0x0" each time I printed my 
NSAttributedString by CTLineDraw(), although I had a perfectly valid context. 
The glyph were drawn, but always in black, while I was attempting to get 
another color via the NSForegroundColorAttributeName. At the end, I had to 
replace the pair (NSColor, NSForeground…) by a (CGColorRef, kCTForeground…), 
and now it works.

Is that supposed to be a "normal" behavior, did I misunderstand the meaning of 
"toll free", or is it a bug?

Thanks!
Vincent

PS : conversely, I found that NSFont * and CTFontRef are really 
equivalent.___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [ANN] AppKiDo-for-iPhone 0.984 fixes bug with 3.2 SDK

2010-04-08 Thread Jeff Johnson
I think Andy is a little confused here, maybe awake too late at night. :-)

I've never used AppKiDo for iPhone. AppKiDo for Mac was definitely affected by 
the docs incompatibility, and version 0.984 fixes it.

Also, as Roland King mentioned, here's the correct URL:

http://homepage.mac.com/aglee/downloads/appkido.html

-Jeff


On Apr 8, 2010, at 4:21 AM, Andy Lee wrote:

> Version 0.984 of AppKiDo-for-iPhone contains an important bug fix:
> 
> 
> 
> Many thanks to Jeff Johnson for fixing an incompatibility with the latest 3.2 
> docs, such that no documentation would appear.
> 
> Regular AppKiDo (for Cocoa) is unaffected.  The only difference is that a 
> minor memory leak was fixed.
> 
> --Andy

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: "Toll free" bridge from NSAttributedString * to CFAttributedStringRef

2010-04-08 Thread glenn andreas

On Apr 8, 2010, at 7:02 AM, vincent habchi wrote:

> Hi there,
> 
> I've been fiddling with NSAttributedString lately, and the way to display 
> them through Core Text. In the docs, I've read that NSAttributedString and 
> CFAttributedStringRef were supposed to be "toll free" bridged; I assumed that 
> meant that one could be used in lieu of the other with (or maybe even 
> without) a simple cast.
> 
> But I found this is not true. Specifically, I was getting strange errors like 
> "CFSet[Stroke|Fill]ColorFromColor : invalid context 0x0" each time I printed 
> my NSAttributedString by CTLineDraw(), although I had a perfectly valid 
> context. The glyph were drawn, but always in black, while I was attempting to 
> get another color via the NSForegroundColorAttributeName. At the end, I had 
> to replace the pair (NSColor, NSForeground…) by a (CGColorRef, 
> kCTForeground…), and now it works.
> 
> Is that supposed to be a "normal" behavior, did I misunderstand the meaning 
> of "toll free", or is it a bug?

NSAttributedString and CFAttributedStringRef "the data structure" are toll free 
bridged, but that just means that the objects themselves can be interchanged.  
The problem is that, like an NSDictionary, they can store arbitrary objects 
that may not be toll free bridged - in this case, NSColor and CGColorRef are 
not interchangeable, nor are the keys NSForegroundColor and 
kCTForegroundColorAttributeName documented as the same.

So CTLineDraw expects to have the color specified as a CGColorRef in 
kCTForegroundColorAttributeName, while drawString: expects to have the color 
specified as an NSColor in NSForegroundColor.



Glenn Andreas  gandr...@gandreas.com 
The most merciful thing in the world ... is the inability of the human mind to 
correlate all its contents - HPL

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Best way to Define Project Wide Static Strings?

2010-04-08 Thread Graham Cox

On 08/04/2010, at 9:23 PM, Dave wrote:

> I have a number of Constant Strings that are project wide

> static NSString   kString1 = @"some string";


If they are project-wide they should not be 'static', which has the scope only 
of the file that they are declared in. On the other hand if that's what you 
want, the best (and only) place for them is the file where they're used.

> What is a good way to handle this? Is there a preferred method?


Constant strings have to exist somewhere, so they may as well exist in the file 
where they are most relevant. If you need to refer to them elsewhere, in the 
header for that file you can use 'extern'. Include that header wherever you 
need the string.

e.g. 

// foo.h

extern NSString* kString1;

// foo.m

NSString* kString1 = @"bar";


Dunno if this is the preferred method but it's what I do. What I don't 
generally do is centralise all my strings in one file, on the basis that if I 
reuse a class in another project, any strings it uses go with it.

--Graham


___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: copy/paste in modal window

2010-04-08 Thread Dave McCarthy
Thanks, but surely there is _something_ I can do. Subclass NSTextField? In 
Carbon I could peek at the event queue and intercept command+C and command+V 
key down events; where might I do something similar for my modal NSWindow?

On Apr 7, 2010, at 4:11 PM, Kyle Sluder wrote:

> On Tue, Apr 6, 2010 at 2:11 PM, Dave McCarthy  wrote:
>> I tried implementing keyDown in my window controller but it is never called. 
>> I tried subclassing NSWindow and implementing keyDown there but it is never 
>> called. Maybe keyDown isn't even the right place to be looking, but my Cocoa 
>> experience is limited. What should I do to allow copy/paste for these 
>> controls?
> 
> Look up NSUserInterfaceValidation. But most likely there's nothing you
> can do but complain to the author of your host app, especially if your
> Cocoa plug-in is hosted by a Carbon app.
> 
> --Kyle Sluder
> 


___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem with vCard and AddressBook ABPerson UID, HELP!!

2010-04-08 Thread Eric Giguere
Hi guys

Thank you so much!! 

I knew I was missing an important part here. I'll pay more attention next time 
to the content of the Pasteboard types. The answers were all there. 
That also directed my to the proper way to actually handling the data content 
of the pboard, using the plist + NSPropertyListSerialization class. I was 
previously using a regex :).

All is so clean now. That even solved the problem I had with the PeoplePicker. 
This guy says it carries vcard but there is a bug with this feature in the 
control. I fails also trying to drag - drop people on the desktop, where the 
AddressBook succeeds. But using this content type: ABPeopleUIDsPboardType 
everything works like a charm!

Thank you again both.

Eric.

On 2010-04-08, at 12:35 AM, Ben Trumbull wrote:

>> 've been fighting now with the AdressBook API for a while and found a 
>> disturbing problem. Maybe someone can help.
>> 
>> I'm trying to use the AddressBook as my main person "database" in my 
>> application. I've create a small function that accepts drag - drops from the 
>> Address book to add a new person in my app. So far so good.
>> 
>> I'm trying after to show in my application details about that linked person 
>> and that's where everything falls down.
>> 
>> On drop, I read the vCard created by the AddressBook using this line:
>> 
>> ABPerson* aPerson = [[ABPerson alloc] initWithVCardRepresentation:filedata];
> 
> That always creates a brand new contact with a brand new uniqueID.  As you 
> observe.  I'm pretty sure it's not an appropriate way to pass around a 
> *reference* to an existing contact.  That's what -[ABRecord uniqueId] is for. 
>  You should get the uniqueId, pass that around, and then use -[ABAddressBook 
> recordForUniqueId:] to look up the contact.
> 
> - Ben
> 
>> 
>> When doing this, the UID of my person gets re-generated. I wanted to use the 
>> UID as my reference to my original address book record and dig the 
>> information using it. But since its re-generated upon read of the vCard, no 
>> luck. So the call:
>>  ABAddressBook* addressBook = [ABAddressBook addressBook];
>>  ABRecord* abRecord = [addressBook recordForUniqueId:personId];
>> 
>> always return null. 
>> But, if I use the sharedAddressBook instead, my UIDs still get re-generated 
>> but this guy (the sharedAddressBook) can find the records but only in the 
>> same execution of the application. Upon restart, same old no-match problem.
>> 
>> There must be something i REALLY don't understand about the AB but can't 
>> find anything more, out of ideas.
>> 
>> Anybody knows what's going on? Any way we can prevent my vCard 
>> initialization from re-genrating the UID? If not, then what would be the 
>> correct way to refer to AB records from another application? Running a 
>> search based on names sounds bad compared to using direct pointers to 
>> records, the UID.
> 

Eric Giguere
eric.gigu...@videotron.ca





smime.p7s
Description: S/MIME cryptographic signature
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to Define Project Wide Static Strings?

2010-04-08 Thread Filip van der Meeren

On 08 Apr 2010, at 15:32, Graham Cox wrote:

> 
> On 08/04/2010, at 9:23 PM, Dave wrote:
> 
>> I have a number of Constant Strings that are project wide
> 
>> static NSString  kString1 = @"some string";

that is NOT a constant string.

NSString * const kString1 = @"lol";

is a constant string.

> 
> 
> If they are project-wide they should not be 'static', which has the scope 
> only of the file that they are declared in. On the other hand if that's what 
> you want, the best (and only) place for them is the file where they're used.
> 
>> What is a good way to handle this? Is there a preferred method?
> 
> 
> Constant strings have to exist somewhere, so they may as well exist in the 
> file where they are most relevant. If you need to refer to them elsewhere, in 
> the header for that file you can use 'extern'. Include that header wherever 
> you need the string.
> 
> e.g. 
> 
> // foo.h
> 
> extern NSString* kString1;
> 
> // foo.m
> 
> NSString* kString1 = @"bar";

To make your string constant and available everywhere:

extern NSString * const kString1;

NSString * const kString1 = @"lol";

> 
> 
> Dunno if this is the preferred method but it's what I do. What I don't 
> generally do is centralise all my strings in one file, on the basis that if I 
> reuse a class in another project, any strings it uses go with it.
> 
> --Graham
> 
> 
> ___
> 
> 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/mailman/options/cocoa-dev/filip%40code2develop.com
> 
> This email sent to fi...@code2develop.com


___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


[NSMutableArray array]

2010-04-08 Thread Patrick M. Rutkowski
Is is safe to do [NSMutableArray array], even with the "array" class
method is actually declared as +[NSArray array]. In other words, is it
safe to call a super-class' class method.

If not, why?

If so, why? And also, is it generally safe in _all_ cases, or only
just when specifically crafted to work?

Many thanks,
-Patrick
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How to force a 32-bit/64-bit universal app to start in 32-bit mode on Leopard?

2010-04-08 Thread Oleg Krupnov
Hi,

While it's good for my app to run in 64-bit mode on Snow Leopard, it
turns out not desirable on Leopard, because of the delay of loading
all 64-bit frameworks (in case if my app is the first 64-bit app
launched after system boot). It literally makes me wait for about ten
seconds, and the performance gain of my app in 64-bit mode is
definitely not worth it on Leopard.

My app is assembled as a universal binary that supports 3
architectures: 32-bit intel, 32-bit ppc and 64-bit intel. Obviously,
the system chooses the best architecture it can run, which is 64-bit
intel in case of Leopard.

Is there a way to change that and force my app to run in 32 bit mode on Leopard?

I would hate to have to supply two versions, one for Leopard and
another one for Snow Leopard.

Thanks!
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [NSMutableArray array]

2010-04-08 Thread Dave DeLong
Yes, that is safe to use.  It's safe to use because classes are really just 
special objects, which means they get all the class method inheritance that 
instances get with instance methods.  This will work in every case where the 
implementors have used:

[[[self alloc] init] autorelease]  //this will instantiate a new instance of 
whatever class invokes this method

Instead of

[[[MyClass alloc] init] autorelease]  //this will instantiate a new instance of 
MyClass, regardless of which class invoked this method

Just like in instance methods, class methods have an implicit "self" variable 
that refers to the Class itself.

Beyond that, NSMutableArray and NSArray are really just the same class 
(NSCFArray, usually), with mutability determined by an internal flag.

Cheers,

Dave

On Apr 8, 2010, at 8:20 AM, Patrick M. Rutkowski wrote:

> Is is safe to do [NSMutableArray array], even with the "array" class
> method is actually declared as +[NSArray array]. In other words, is it
> safe to call a super-class' class method.
> 
> If not, why?
> 
> If so, why? And also, is it generally safe in _all_ cases, or only
> just when specifically crafted to work?
> 
> Many thanks,
> -Patrick


smime.p7s
Description: S/MIME cryptographic signature
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Configuring NSPrinterInfo to print on a labeled paper.

2010-04-08 Thread Gustavo Pizano
Hello, Im working on a application that generates custom labels to stick into 
magazines with some information in it.
Now I have an NSArray of Stickies on a NSViewController, so in the drawRect 
method of its view, Im iterating thru the array and displaying all the 
information per label moving the NSPoint  the some deltax or deltaY pixels, so 
at the end when I click print and then I open as a pdf I see the paper with 
many labels on it. Now the problems

1. on the page break it breaks the label on half, I think its because I will 
have to implement the method knowsPageRange and rectForPage of the NSView,,  

2. one sheet contains 24 labels, but I hadn't been able to aligned what I print 
with the borders of each label in the sheet horizontally,  I tried setting the 
NSPrinterInfo setMargin  methods to 0, and it helped a little but still at 
the bottom rows of labels all start being messed up, 

So I stop printing papers to save the world a little and im writing to you guys 
asking for help. 

If the label sheet has 8 rows and 3 columns, top and bottom margin of 4-5mm and 
left and right margin of 0mm, how to set up the printer and therefore my view 
so all the label's info will be within the bounds of each label on the sheet?

OH and the Sheet is a A4 size.


Thanks in advance, I hope somebody out there can give me some lights on this 
one.


Gustavo ___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to force a 32-bit/64-bit universal app to start in 32-bit mode on Leopard?

2010-04-08 Thread Kevin Wojniak
In your Info.plist add:

LSMinimumSystemVersionByArchitecture

x86_64
10.6.0



Kevin


On Apr 8, 2010, at 7:21 AM, Oleg Krupnov wrote:

> Hi,
> 
> While it's good for my app to run in 64-bit mode on Snow Leopard, it
> turns out not desirable on Leopard, because of the delay of loading
> all 64-bit frameworks (in case if my app is the first 64-bit app
> launched after system boot). It literally makes me wait for about ten
> seconds, and the performance gain of my app in 64-bit mode is
> definitely not worth it on Leopard.
> 
> My app is assembled as a universal binary that supports 3
> architectures: 32-bit intel, 32-bit ppc and 64-bit intel. Obviously,
> the system chooses the best architecture it can run, which is 64-bit
> intel in case of Leopard.
> 
> Is there a way to change that and force my app to run in 32 bit mode on 
> Leopard?
> 
> I would hate to have to supply two versions, one for Leopard and
> another one for Snow Leopard.
> 
> Thanks!
> ___
> 
> 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/mailman/options/cocoa-dev/kainjow%40kainjow.com
> 
> This email sent to kain...@kainjow.com

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [NSMutableArray array]

2010-04-08 Thread Patrick M. Rutkowski
Ah, hmm; well in the case of them both being NSCFArray's, that does
sound right; thanks :-)

What I was worried about is that maybe NSMutableArray (or any
sub-class in general) would need to do some special sub-class-specific
initialization, which it might not have implemented. I guess though,
if you're going to be sub-classing a class, then you ought to
generally make sure that all of it's static method will work on your
new sub-class?

There's always the danger that the super-class will have new static
methods added without your knowledge though.

-Patrick

On Thu, Apr 8, 2010 at 10:25 AM, Dave DeLong  wrote:
> Yes, that is safe to use.  It's safe to use because classes are really just 
> special objects, which means they get all the class method inheritance that 
> instances get with instance methods.  This will work in every case where the 
> implementors have used:
>
> [[[self alloc] init] autorelease]  //this will instantiate a new instance of 
> whatever class invokes this method
>
> Instead of
>
> [[[MyClass alloc] init] autorelease]  //this will instantiate a new instance 
> of MyClass, regardless of which class invoked this method
>
> Just like in instance methods, class methods have an implicit "self" variable 
> that refers to the Class itself.
>
> Beyond that, NSMutableArray and NSArray are really just the same class 
> (NSCFArray, usually), with mutability determined by an internal flag.
>
> Cheers,
>
> Dave
>
> On Apr 8, 2010, at 8:20 AM, Patrick M. Rutkowski wrote:
>
>> Is is safe to do [NSMutableArray array], even with the "array" class
>> method is actually declared as +[NSArray array]. In other words, is it
>> safe to call a super-class' class method.
>>
>> If not, why?
>>
>> If so, why? And also, is it generally safe in _all_ cases, or only
>> just when specifically crafted to work?
>>
>> Many thanks,
>> -Patrick
>
> ___
>
> 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/mailman/options/cocoa-dev/rutski89%40gmail.com
>
> This email sent to rutsk...@gmail.com
>
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Delayed Autorelease

2010-04-08 Thread Patrick M. Rutkowski
Is it common in either Cocoa or UIKit to have an autorelease run
happen only when the user does something?

I'm in a situation where I believe the autorelease run is happening
only when I push a bush or otherwise fiddled with a UI item; might
that be the case, or am I confused?

-Patrick

P.S.
Is there perhaps a way to have it logged to the console whenever an
autorelease run happens?
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Delayed Autorelease

2010-04-08 Thread Patrick M. Rutkowski
It turns out that my memory error is coming form somewhere else. If
you don't mind changing the topic of the thread for a moment:

I have a Foo object which has an NSMutableArray of Bar objects. The
Bar objects each have their own NSMutableArray of Baz objects.

The weird thing is that the Foo and it's array of Bar's are all living
well and good, but the Bar's are all getting dealloc'd, even though
their containing parent are still alive.

Still digging into it; not quite sure that you guys would even have
any advice to offer here, I think I'm on my own :-/

-Patrick

On Thu, Apr 8, 2010 at 10:36 AM, Patrick M. Rutkowski
 wrote:
> Is it common in either Cocoa or UIKit to have an autorelease run
> happen only when the user does something?
>
> I'm in a situation where I believe the autorelease run is happening
> only when I push a bush or otherwise fiddled with a UI item; might
> that be the case, or am I confused?
>
> -Patrick
>
> P.S.
> Is there perhaps a way to have it logged to the console whenever an
> autorelease run happens?
>
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


What is the best approach for custom tab bar interface?

2010-04-08 Thread Philip Mobley
I need to have a tab style interface, but am not able to use the built in 
NSTabView because the style is not customizable.  Basically I need something 
similar in look to the Safari tabs, but on a VERTICAL direction.  At this point 
I am thinking about a custom NSView with CALayers for each tab element and then 
handling the MouseDown and MouseUp events to "capture" the button press.  Or is 
there another approach I can take?


___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Delayed Autorelease

2010-04-08 Thread Hank Heijink (Mailinglists)
On Apr 8, 2010, at 10:36 AM, Patrick M. Rutkowski wrote:

> Is it common in either Cocoa or UIKit to have an autorelease run
> happen only when the user does something?

> I'm in a situation where I believe the autorelease run is happening
> only when I push a bush or otherwise fiddled with a UI item; might
> that be the case, or am I confused?

I think you may be confused here. There's no such thing as an 'autorelease 
run'. Autoreleased objects are collected in autorelease pools. The main 
autorelease pool in an application with a UI is drained every so often (every 
time the application goes through its main event loop).

You shouldn't have to worry about when autoreleased objects get released: the 
only thing you need to know is whether or not you're responsible for the 
release of an object. This is explained at length in the Memory Management 
Programming Guide:

http://developer.apple.com/mac/library/documentation/cocoa/conceptual/MemoryMgmt/MemoryMgmt.html

Also, check the documentation for NSAutoreleasePool.

Hope this helps,
Hank

> 
> -Patrick
> 
> P.S.
> Is there perhaps a way to have it logged to the console whenever an
> autorelease run happens?

I'm assuming you're referring to the draining of an autorelease pool again. 
Since the main autorelease pool is drained at the end of the event loop, I 
guess you could attach an observer to the main run loop (search the docs for 
runloop observer), but there may be better ways. Why would you want to know 
this?

> ___
> 
> 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/mailman/options/cocoa-dev/hank.list%40runbox.com
> 
> This email sent to hank.l...@runbox.com
> 

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Delayed Autorelease

2010-04-08 Thread Steve Bird

On Apr 8, 2010, at 10:36 AM, Patrick M. Rutkowski wrote:

> Is it common in either Cocoa or UIKit to have an autorelease run
> happen only when the user does something?
> 
> I'm in a situation where I believe the autorelease run is happening
> only when I push a bush or otherwise fiddled with a UI item; might
> that be the case, or am I confused?

I don't know about pushing bushes, but in general the "autorelease run" is at 
the end of an event loop, when your code has finished responding to an event, 
and the system is about ready to look for another one.

> Is there perhaps a way to have it logged to the console whenever an
> autorelease run happens?

--- A log to the console on every event would swamp you in data, I think.


Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175


___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Delayed Autorelease

2010-04-08 Thread Steve Bird

On Apr 8, 2010, at 11:03 AM, Patrick M. Rutkowski wrote:

> It turns out that my memory error is coming form somewhere else. If
> you don't mind changing the topic of the thread for a moment:
> 
> I have a Foo object which has an NSMutableArray of Bar objects. The
> Bar objects each have their own NSMutableArray of Baz objects.
> 
> The weird thing is that the Foo and it's array of Bar's are all living
> well and good, but the Bar's are all getting dealloc'd, 

How are Bars (no apostrophe) "living well" if they are deallocated?



Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175


___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Delayed Autorelease

2010-04-08 Thread Joar Wingfors

On 8 apr 2010, at 08.03, Patrick M. Rutkowski wrote:

> I have a Foo object which has an NSMutableArray of Bar objects. The
> Bar objects each have their own NSMutableArray of Baz objects.
> 
> The weird thing is that the Foo and it's array of Bar's are all living
> well and good, but the Bar's are all getting dealloc'd, even though
> their containing parent are still alive.
> 
> Still digging into it; not quite sure that you guys would even have
> any advice to offer here, I think I'm on my own :-/


If you can reproduce the problem you can use the ObjectAlloc instrumentation in 
Instruments to track down the issue. It allows you to track all memory 
management events (alloc, retain, release, autorelease, etc.) in your 
application, so that you can figure out where your objects are being mismanaged.

j o a r


___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Single-click words in NSTableView / NSTextFieldCell

2010-04-08 Thread Tony P

Hi Folks,

I'm trying to implement single-clicking for multiple words/phrases  
within an NSTableView / NSTextFieldCell, which seems surprisingly  
tricky. I've tried using NSAttributedString (in the hope I can use a  
special NSURLProtocol to intercept the hyperlink), but it takes four  
clicks to get there (row select, cell select, edit, and link-click).  
I've tried numerous tricks but to no avail.


I can over-ride hitTestForEvent (see the "Hyperlinks in Table Views"  
thread) so the other alternative would be some way of getting  
characterIndexForPoint for the NSTextFieldCell, but that doesn't seem  
to exist. I'm hoping I don't need to do something wacky with an off- 
screen view.


How can I get the NSTextFieldCell to react with just one click? Or is  
there a way to get characterIndexForPoint for the NSTextFieldCell?


Tony Pollard
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Delayed Autorelease

2010-04-08 Thread Dru Satori
This is a really common problem for developers coming from other platforms.  In 
the Windows world the only thing really analogous to retain/release is the COM 
addref concepts, and even those lack the equivalent of autorelease.

The short version, in my experience, is when in doubt, manage the memory with 
retain and release pairs.  Garbage collection is good, but can have unexpected 
behaviors that become tricky to debug.  I know there are people that idol 
disagree, but between apple's leak finding tools, llvm's analysis tools and 
shark, it is often easier to hunt down a leak using old school retain/release 
methods than new school garbage collection.

Sent from my iPad

On Apr 8, 2010, at 11:09 AM, Steve Bird  wrote:

> 
> On Apr 8, 2010, at 10:36 AM, Patrick M. Rutkowski wrote:
> 
>> Is it common in either Cocoa or UIKit to have an autorelease run
>> happen only when the user does something?
>> 
>> I'm in a situation where I believe the autorelease run is happening
>> only when I push a bush or otherwise fiddled with a UI item; might
>> that be the case, or am I confused?
> 
> I don't know about pushing bushes, but in general the "autorelease run" is at 
> the end of an event loop, when your code has finished responding to an event, 
> and the system is about ready to look for another one.
> 
>> Is there perhaps a way to have it logged to the console whenever an
>> autorelease run happens?
> 
> --- A log to the console on every event would swamp you in data, I think.
> 
> 
> Steve Bird
> Culverson Software - Elegant software that is a pleasure to use.
> www.Culverson.com (toll free) 1-877-676-8175
> 
> 
> ___
> 
> 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/mailman/options/cocoa-dev/dru%40druware.com
> 
> This email sent to d...@druware.com
> 
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What is the best approach for custom tab bar interface?

2010-04-08 Thread Gideon King
Absolutely. Use an NSTabView, but set it to be tabless, and create your own 
control to change the selected tab.

Regards

Gideon
On 09/04/2010, at 1:06 AM, Philip Mobley wrote:

> I need to have a tab style interface, but am not able to use the built in 
> NSTabView because the style is not customizable.  Basically I need something 
> similar in look to the Safari tabs, but on a VERTICAL direction.  At this 
> point I am thinking about a custom NSView with CALayers for each tab element 
> and then handling the MouseDown and MouseUp events to "capture" the button 
> press.  Or is there another approach I can take?
> 
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Delayed Autorelease

2010-04-08 Thread Hank Heijink (Mailinglists)
On Apr 8, 2010, at 11:03 AM, Patrick M. Rutkowski wrote:

> It turns out that my memory error is coming form somewhere else. If
> you don't mind changing the topic of the thread for a moment:
> 
> I have a Foo object which has an NSMutableArray of Bar objects. The
> Bar objects each have their own NSMutableArray of Baz objects.
> 
> The weird thing is that the Foo and it's array of Bar's are all living
> well and good, but the Bar's are all getting dealloc'd, even though
> their containing parent are still alive.

I assume that 'living well and good' means that they haven't been released? 
Nothing weird about Baz objects (you say Bar but I think you mean Baz) getting 
dealloc'd when their parents are alive: Bar retains its objects when you add 
them, but if you overrelease them somewhere else, being contained in an array 
doesn't prevent them from being deallocated.

> Still digging into it; not quite sure that you guys would even have
> any advice to offer here, I think I'm on my own :-/

Posting code would be helpful if you'd like advice. Meanwhile you could search 
Google for NSZombieEnabled, or just run your application in Instruments with 
the Zombies template to find out what's wrong. If the error is obvious, you 
might even be able to find it with the static analyzer.

Hank

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Delayed Autorelease

2010-04-08 Thread Patrick M. Rutkowski
I meant that I believe that the array itself was still alive, but the
Bar objects inside of it were getting dealloc'd

>
> How are Bars (no apostrophe) "living well" if they are deallocated?
>
>
> 
> Steve Bird
> Culverson Software - Elegant software that is a pleasure to use.
> www.Culverson.com                     (toll free) 1-877-676-8175
>
>
>
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Delayed Autorelease

2010-04-08 Thread Patrick M. Rutkowski
Sorry for the useless thread guys, I worked it all out :-)

It was due to silly mistakes like forgetting to initialize the array
in -init, and then having [self.array addObject: bar] be a no-op due
to self.array being nil.

Another mistake was self.array being initialized as
self.array = [[NSMutableArray alloc] init]

when it should have been
self.array = [NSMutableArray array]

I'm still somewhat new to this :-)

I totally get what's going on, I'm just not good at spotting the usual
mistakes yet; and I'm a bit sleepy at the moment.

Yawn,
-Patrick

On Thu, Apr 8, 2010 at 11:03 AM, Patrick M. Rutkowski
 wrote:
> It turns out that my memory error is coming form somewhere else. If
> you don't mind changing the topic of the thread for a moment:
>
> I have a Foo object which has an NSMutableArray of Bar objects. The
> Bar objects each have their own NSMutableArray of Baz objects.
>
> The weird thing is that the Foo and it's array of Bar's are all living
> well and good, but the Bar's are all getting dealloc'd, even though
> their containing parent are still alive.
>
> Still digging into it; not quite sure that you guys would even have
> any advice to offer here, I think I'm on my own :-/
>
> -Patrick
>
> On Thu, Apr 8, 2010 at 10:36 AM, Patrick M. Rutkowski
>  wrote:
>> Is it common in either Cocoa or UIKit to have an autorelease run
>> happen only when the user does something?
>>
>> I'm in a situation where I believe the autorelease run is happening
>> only when I push a bush or otherwise fiddled with a UI item; might
>> that be the case, or am I confused?
>>
>> -Patrick
>>
>> P.S.
>> Is there perhaps a way to have it logged to the console whenever an
>> autorelease run happens?
>>
>
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Delayed Autorelease

2010-04-08 Thread Joar Wingfors

On 8 apr 2010, at 08.37, Patrick M. Rutkowski wrote:

> Another mistake was self.array being initialized as
> self.array = [[NSMutableArray alloc] init]
> 
> when it should have been
> self.array = [NSMutableArray array]
> 
> I'm still somewhat new to this :-)
> 
> I totally get what's going on, I'm just not good at spotting the usual
> mistakes yet; and I'm a bit sleepy at the moment.


If you're using Xcode 3.2 (requires Mac OS X 10.6), you should be using the 
static analyzer. It is good at finding problems like these.

j o a r


___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to force a 32-bit/64-bit universal app to start in 32-bit mode on Leopard?

2010-04-08 Thread Oleg Krupnov
This would be a perfect solution, but I've found that on Leopard, this
key seems to be ignored, the system still launches my app in 64-bit
mode (via Finder).

What may I be doing wrong?

Thanks!

On Thu, Apr 8, 2010 at 7:28 AM, Kevin Wojniak  wrote:
> In your Info.plist add:
>
> LSMinimumSystemVersionByArchitecture
> 
>        x86_64
>        10.6.0
> 
>
>
> Kevin
>
>
> On Apr 8, 2010, at 7:21 AM, Oleg Krupnov wrote:
>
>> Hi,
>>
>> While it's good for my app to run in 64-bit mode on Snow Leopard, it
>> turns out not desirable on Leopard, because of the delay of loading
>> all 64-bit frameworks (in case if my app is the first 64-bit app
>> launched after system boot). It literally makes me wait for about ten
>> seconds, and the performance gain of my app in 64-bit mode is
>> definitely not worth it on Leopard.
>>
>> My app is assembled as a universal binary that supports 3
>> architectures: 32-bit intel, 32-bit ppc and 64-bit intel. Obviously,
>> the system chooses the best architecture it can run, which is 64-bit
>> intel in case of Leopard.
>>
>> Is there a way to change that and force my app to run in 32 bit mode on 
>> Leopard?
>>
>> I would hate to have to supply two versions, one for Leopard and
>> another one for Snow Leopard.
>>
>> Thanks!
>> ___
>>
>> 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/mailman/options/cocoa-dev/kainjow%40kainjow.com
>>
>> This email sent to kain...@kainjow.com
>
>
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to force a 32-bit/64-bit universal app to start in 32-bit mode on Leopard?

2010-04-08 Thread Kevin Wojniak
Are you launching with NSTask or some other variant? If so it won't work. You 
need to use Launch Services instead. I think there are some low-level APIs to 
use to launch with a specific architecture, but if you can use LS it handles 
all the dirty work for you.


On Apr 8, 2010, at 8:53 AM, Oleg Krupnov wrote:

> This would be a perfect solution, but I've found that on Leopard, this
> key seems to be ignored, the system still launches my app in 64-bit
> mode (via Finder).
> 
> What may I be doing wrong?
> 
> Thanks!
> 
> On Thu, Apr 8, 2010 at 7:28 AM, Kevin Wojniak  wrote:
>> In your Info.plist add:
>> 
>> LSMinimumSystemVersionByArchitecture
>> 
>>x86_64
>>10.6.0
>> 
>> 
>> 
>> Kevin
>> 
>> 
>> On Apr 8, 2010, at 7:21 AM, Oleg Krupnov wrote:
>> 
>>> Hi,
>>> 
>>> While it's good for my app to run in 64-bit mode on Snow Leopard, it
>>> turns out not desirable on Leopard, because of the delay of loading
>>> all 64-bit frameworks (in case if my app is the first 64-bit app
>>> launched after system boot). It literally makes me wait for about ten
>>> seconds, and the performance gain of my app in 64-bit mode is
>>> definitely not worth it on Leopard.
>>> 
>>> My app is assembled as a universal binary that supports 3
>>> architectures: 32-bit intel, 32-bit ppc and 64-bit intel. Obviously,
>>> the system chooses the best architecture it can run, which is 64-bit
>>> intel in case of Leopard.
>>> 
>>> Is there a way to change that and force my app to run in 32 bit mode on 
>>> Leopard?
>>> 
>>> I would hate to have to supply two versions, one for Leopard and
>>> another one for Snow Leopard.
>>> 
>>> Thanks!
>>> ___
>>> 
>>> 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/mailman/options/cocoa-dev/kainjow%40kainjow.com
>>> 
>>> This email sent to kain...@kainjow.com
>> 
>> 

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Delayed Autorelease

2010-04-08 Thread Patrick M. Rutkowski
Ah, a very good point, I'll turn that on right away; I can't believe I
forgot that. Thanks :-)

On Thu, Apr 8, 2010 at 11:40 AM, Joar Wingfors  wrote:
>
> On 8 apr 2010, at 08.37, Patrick M. Rutkowski wrote:
>
>> Another mistake was self.array being initialized as
>> self.array = [[NSMutableArray alloc] init]
>>
>> when it should have been
>> self.array = [NSMutableArray array]
>>
>> I'm still somewhat new to this :-)
>>
>> I totally get what's going on, I'm just not good at spotting the usual
>> mistakes yet; and I'm a bit sleepy at the moment.
>
>
> If you're using Xcode 3.2 (requires Mac OS X 10.6), you should be using the 
> static analyzer. It is good at finding problems like these.
>
> j o a r
>
>
>
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to force a 32-bit/64-bit universal app to start in 32-bit mode on Leopard?

2010-04-08 Thread Oleg Krupnov
No, I'm just double-clicking it in Finder.

On Thu, Apr 8, 2010 at 8:57 AM, Kevin Wojniak  wrote:
> Are you launching with NSTask or some other variant? If so it won't work. You 
> need to use Launch Services instead. I think there are some low-level APIs to 
> use to launch with a specific architecture, but if you can use LS it handles 
> all the dirty work for you.
>
>
> On Apr 8, 2010, at 8:53 AM, Oleg Krupnov wrote:
>
>> This would be a perfect solution, but I've found that on Leopard, this
>> key seems to be ignored, the system still launches my app in 64-bit
>> mode (via Finder).
>>
>> What may I be doing wrong?
>>
>> Thanks!
>>
>> On Thu, Apr 8, 2010 at 7:28 AM, Kevin Wojniak  wrote:
>>> In your Info.plist add:
>>>
>>> LSMinimumSystemVersionByArchitecture
>>> 
>>>        x86_64
>>>        10.6.0
>>> 
>>>
>>>
>>> Kevin
>>>
>>>
>>> On Apr 8, 2010, at 7:21 AM, Oleg Krupnov wrote:
>>>
 Hi,

 While it's good for my app to run in 64-bit mode on Snow Leopard, it
 turns out not desirable on Leopard, because of the delay of loading
 all 64-bit frameworks (in case if my app is the first 64-bit app
 launched after system boot). It literally makes me wait for about ten
 seconds, and the performance gain of my app in 64-bit mode is
 definitely not worth it on Leopard.

 My app is assembled as a universal binary that supports 3
 architectures: 32-bit intel, 32-bit ppc and 64-bit intel. Obviously,
 the system chooses the best architecture it can run, which is 64-bit
 intel in case of Leopard.

 Is there a way to change that and force my app to run in 32 bit mode on 
 Leopard?

 I would hate to have to supply two versions, one for Leopard and
 another one for Snow Leopard.

 Thanks!
 ___

 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/mailman/options/cocoa-dev/kainjow%40kainjow.com

 This email sent to kain...@kainjow.com
>>>
>>>
>
>
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [NSMutableArray array]

2010-04-08 Thread Jens Alfke


On Apr 8, 2010, at 7:35 AM, Patrick M. Rutkowski wrote:


What I was worried about is that maybe NSMutableArray (or any
sub-class in general) would need to do some special sub-class-specific
initialization, which it might not have implemented.


That's taken care of by the initializer methods (-init etc.) Every  
class should have a "designated initializer" method that the other  
initializers call first. Subclasses should override at least that  
designated initializer to add their own initialization code. That  
ensures all initializers and factory methods will set up the object  
correctly.



There's always the danger that the super-class will have new static
methods added without your knowledge though.


Yes, in general that can be a problem. Usually it's not an issue when  
the classes are part of the same project/framework, as the base  
collection classes are. But if you're subclassing an external class  
and making some significant changes in its behavior, you might run  
into issues. In practice, though, this usually only happens if you're  
trying to do sneaky things to hack framework classes to do things they  
weren't meant to do...


—Jens___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to change to the smoother single-stage animation

2010-04-08 Thread David Duncan
On Apr 7, 2010, at 8:19 PM, Roy Lovejoy wrote:

> something *else* is going on


Yes, and it is probably a bug in the OS. If you can generate these warnings 
with a template, then please file a bug.
--
David Duncan
Apple DTS Animation and Printing

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: CSS style string to NSAttributedString attributes conversion

2010-04-08 Thread Jens Alfke


On Apr 8, 2010, at 2:53 AM, jonat...@mugginsoft.com wrote:


I want to convert CSS style strings to NSAttributedString attributes.
AppKit and WebKit don't seem to offer a solution.
Does anyone know of any permissive licence third part code?



I'm not aware of anything that does this.
Are you talking about parsing entire CSS files, or just a single  
"property: value;" rule?
Even the simple case isn't that simple; CSS can be pretty complex. And  
most of the attributes don't map cleanly into AppKit text attributes.


—Jens___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Query on File Wrapping

2010-04-08 Thread Jens Alfke


On Apr 7, 2010, at 11:56 PM, Swetha Chinthireddy wrote:

Currently once the file size reaches 10MB , we are creating a new  
file and copying the last 4KB messages to the new file.But the  
requirement is to wrap the file i.e  to always keep the latest 10MB  
traces.


There isn't any filesystem call to delete bytes from within the file.  
Just create a new file and copy the last 10MB to it. But don't do this  
on every write, of course, because copying 10MB isn't cheap.


—Jens___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: CSS style string to NSAttributedString attributes conversion

2010-04-08 Thread Douglas Davidson

On Apr 8, 2010, at 2:53 AM, jonat...@mugginsoft.com wrote:

> I want to convert CSS style strings to NSAttributedString attributes.
> 
> AppKit and WebKit don't seem to offer a solution.
> 
> Does anyone know of any permissive licence third part code?

AppKit doesn't expose anything to handle CSS by itself, but if CSS is applied 
to HTML, AppKit's HTML import will convert it to attributes on the text.  You 
might be able to make use of that.

Douglas Davidson

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Single-click words in NSTableView / NSTextFieldCell

2010-04-08 Thread Corbin Dunn

On Apr 8, 2010, at 8:17 AM, Tony P wrote:

> Hi Folks,
> 
> I'm trying to implement single-clicking for multiple words/phrases within an 
> NSTableView / NSTextFieldCell, which seems surprisingly tricky. I've tried 
> using NSAttributedString (in the hope I can use a special NSURLProtocol to 
> intercept the hyperlink), but it takes four clicks to get there (row select, 
> cell select, edit, and link-click). I've tried numerous tricks but to no 
> avail.
> 
> I can over-ride hitTestForEvent (see the "Hyperlinks in Table Views" thread) 
> so the other alternative would be some way of getting characterIndexForPoint 
> for the NSTextFieldCell, but that doesn't seem to exist. I'm hoping I don't 
> need to do something wacky with an off-screen view.
> 
> How can I get the NSTextFieldCell to react with just one click? Or is there a 
> way to get characterIndexForPoint for the NSTextFieldCell?

You'll have to implement the logic in an NSTableView subclass. Override 
-mouseDown:, grab the cell at the mouse location, look at the cell's contents 
to see if you hit a link, and if so, do your link stuff. If not, call super for 
the default selection/tracking/editing behavior to take place.

corbin


___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to force a 32-bit/64-bit universal app to start in 32-bit mode on Leopard?

2010-04-08 Thread Kevin Wojniak
Not sure if it's needed, but you may need to run touch on the .app.


On Apr 8, 2010, at 8:59 AM, Oleg Krupnov wrote:

> No, I'm just double-clicking it in Finder.
> 
> On Thu, Apr 8, 2010 at 8:57 AM, Kevin Wojniak  wrote:
>> Are you launching with NSTask or some other variant? If so it won't work. 
>> You need to use Launch Services instead. I think there are some low-level 
>> APIs to use to launch with a specific architecture, but if you can use LS it 
>> handles all the dirty work for you.
>> 
>> 
>> On Apr 8, 2010, at 8:53 AM, Oleg Krupnov wrote:
>> 
>>> This would be a perfect solution, but I've found that on Leopard, this
>>> key seems to be ignored, the system still launches my app in 64-bit
>>> mode (via Finder).
>>> 
>>> What may I be doing wrong?
>>> 
>>> Thanks!
>>> 
>>> On Thu, Apr 8, 2010 at 7:28 AM, Kevin Wojniak  wrote:
 In your Info.plist add:
 
 LSMinimumSystemVersionByArchitecture
 
x86_64
10.6.0
 
 
 
 Kevin
 
 
 On Apr 8, 2010, at 7:21 AM, Oleg Krupnov wrote:
 
> Hi,
> 
> While it's good for my app to run in 64-bit mode on Snow Leopard, it
> turns out not desirable on Leopard, because of the delay of loading
> all 64-bit frameworks (in case if my app is the first 64-bit app
> launched after system boot). It literally makes me wait for about ten
> seconds, and the performance gain of my app in 64-bit mode is
> definitely not worth it on Leopard.
> 
> My app is assembled as a universal binary that supports 3
> architectures: 32-bit intel, 32-bit ppc and 64-bit intel. Obviously,
> the system chooses the best architecture it can run, which is 64-bit
> intel in case of Leopard.
> 
> Is there a way to change that and force my app to run in 32 bit mode on 
> Leopard?
> 
> I would hate to have to supply two versions, one for Leopard and
> another one for Snow Leopard.
> 
> Thanks!
> ___
> 
> 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/mailman/options/cocoa-dev/kainjow%40kainjow.com
> 
> This email sent to kain...@kainjow.com
 
 
>> 
>> 

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [NSMutableArray array]

2010-04-08 Thread Bill Bumgarner

On Apr 8, 2010, at 7:35 AM, Patrick M. Rutkowski wrote:

> What I was worried about is that maybe NSMutableArray (or any
> sub-class in general) would need to do some special sub-class-specific
> initialization, which it might not have implemented. I guess though,
> if you're going to be sub-classing a class, then you ought to
> generally make sure that all of it's static method will work on your
> new sub-class?
> 
> There's always the danger that the super-class will have new static
> methods added without your knowledge though.

There is no such thing as a static method in Objective-C;  there are class 
methods and instance methods.  Class methods are inherited just like instance 
methods.

Thus, when you say [NSMutableArray array], NSMutableArray's implementation of 
+array will be invoked (if it exists), regardless of whether or not said method 
is declared in the @interface of NSMutableArray.

b.bum

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: "Toll free" bridge from NSAttributedString * to CFAttributedStringRef

2010-04-08 Thread vincent habchi
Glenn,

> NSAttributedString and CFAttributedStringRef "the data structure" are toll 
> free bridged, but that just means that the objects themselves can be 
> interchanged.  The problem is that, like an NSDictionary, they can store 
> arbitrary objects that may not be toll free bridged - in this case, NSColor 
> and CGColorRef are not interchangeable, nor are the keys NSForegroundColor 
> and kCTForegroundColorAttributeName documented as the same.
> 
> So CTLineDraw expects to have the color specified as a CGColorRef in 
> kCTForegroundColorAttributeName, while drawString: expects to have the color 
> specified as an NSColor in NSForegroundColor.

So what's the point in saying that both NSAttributed… and CFAttributed… are 
toll free bridged, if you cannot use one for another? I find it misleading.

Cheers!
Vincent___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to force a 32-bit/64-bit universal app to start in 32-bit mode on Leopard? [SOLVED]

2010-04-08 Thread Oleg Krupnov
I have found the reason of my problem.

It was due to one of the frameworks linked to my app. Namely, it's the
Growl framework. When I remove this framework from the project, the
app is launched with respect of the
LSMinimumSystemVersionByArchitecture key.

There is obviously a problem in the last build of the Growl framework.
I am using version 1.2.1. The previous versions did not support 64-bit
altogether, but this latest one, although it supports 64-bit, has some
bug that causes the app project fail to build on Leopard, and now I
found this other bug that prevents the app from running in 32-bit mode
on Leopard. There is no such problem on Snow Leopard though. I will
file the problem to the Growl developers.

Thanks for your help!

On Thu, Apr 8, 2010 at 9:37 AM, Kevin Wojniak  wrote:
> Not sure if it's needed, but you may need to run touch on the .app.
>
>
> On Apr 8, 2010, at 8:59 AM, Oleg Krupnov wrote:
>
>> No, I'm just double-clicking it in Finder.
>>
>> On Thu, Apr 8, 2010 at 8:57 AM, Kevin Wojniak  wrote:
>>> Are you launching with NSTask or some other variant? If so it won't work. 
>>> You need to use Launch Services instead. I think there are some low-level 
>>> APIs to use to launch with a specific architecture, but if you can use LS 
>>> it handles all the dirty work for you.
>>>
>>>
>>> On Apr 8, 2010, at 8:53 AM, Oleg Krupnov wrote:
>>>
 This would be a perfect solution, but I've found that on Leopard, this
 key seems to be ignored, the system still launches my app in 64-bit
 mode (via Finder).

 What may I be doing wrong?

 Thanks!

 On Thu, Apr 8, 2010 at 7:28 AM, Kevin Wojniak  wrote:
> In your Info.plist add:
>
> LSMinimumSystemVersionByArchitecture
> 
>        x86_64
>        10.6.0
> 
>
>
> Kevin
>
>
> On Apr 8, 2010, at 7:21 AM, Oleg Krupnov wrote:
>
>> Hi,
>>
>> While it's good for my app to run in 64-bit mode on Snow Leopard, it
>> turns out not desirable on Leopard, because of the delay of loading
>> all 64-bit frameworks (in case if my app is the first 64-bit app
>> launched after system boot). It literally makes me wait for about ten
>> seconds, and the performance gain of my app in 64-bit mode is
>> definitely not worth it on Leopard.
>>
>> My app is assembled as a universal binary that supports 3
>> architectures: 32-bit intel, 32-bit ppc and 64-bit intel. Obviously,
>> the system chooses the best architecture it can run, which is 64-bit
>> intel in case of Leopard.
>>
>> Is there a way to change that and force my app to run in 32 bit mode on 
>> Leopard?
>>
>> I would hate to have to supply two versions, one for Leopard and
>> another one for Snow Leopard.
>>
>> Thanks!
>> ___
>>
>> 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/mailman/options/cocoa-dev/kainjow%40kainjow.com
>>
>> This email sent to kain...@kainjow.com
>
>
>>>
>>>
>
>
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: IB Parses Class Names?

2010-04-08 Thread Kevin Cathey
Kyle has suggested the best approach.

We try to make things easier to read by parsing the class name. However if you 
use the outline view, you can still always see the original type (GPSManager).

Kevin

On 7 Apr 2010, at 20:34, Kyle Sluder wrote:

> On Apr 7, 2010, at 3:44 PM, "Patrick M. Rutkowski"  wrote:
> 
>> Is there a way to turn this IB feature off?
> 
> No. Just give the object a name. Much better than having a bunch of nameless 
> Custom Objects floating around.
> 
> --Kyle Sluder
> ___
> 
> 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/mailman/options/cocoa-dev/cathey%40apple.com
> 
> This email sent to cat...@apple.com

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What is the best approach for custom tab bar interface?

2010-04-08 Thread Philip Mobley
On Apr 8, 2010, at 8:22 AM, Gideon King wrote:

> Absolutely. Use an NSTabView, but set it to be tabless, and create your own 
> control to change the selected tab.

My question isn't how to get the Tabs to work, but the control which controls 
the tab switching.  =)

> I need to have a tab style interface, but am not able to use the built in 
> NSTabView because the style is not customizable.  Basically I need something 
> similar in look to the Safari tabs, but on a VERTICAL direction.  At this 
> point I am thinking about a custom NSView with CALayers for each tab element 
> and then handling the MouseDown and MouseUp events to "capture" the button 
> press.  Or is there another approach I can take?

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: "Toll free" bridge from NSAttributedString * to CFAttributedStringRef

2010-04-08 Thread Jens Alfke


On Apr 8, 2010, at 9:48 AM, vincent habchi wrote:

So what's the point in saying that both NSAttributed… and  
CFAttributed… are toll free bridged, if you cannot use one for  
another? I find it misleading.


The objects themselves are bridged. NSAttributedString is fairly  
general-purpose and doesn't care what the attribute names and values  
are. (In fact it's implemented in the Foundation framework, not  
AppKit, because it doesn't have any dependencies on graphics.)


It's kind of like you're saying that NSDictionary isn't really  
bridged, because AppKit and CoreText are putting different key strings  
into them.


—Jens___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: IB Parses Class Names?

2010-04-08 Thread Patrick M. Rutkowski
Indeed, yeah.

On Thu, Apr 8, 2010 at 12:59 PM, Kevin Cathey  wrote:
> Kyle has suggested the best approach.
>
> We try to make things easier to read by parsing the class name. However if 
> you use the outline view, you can still always see the original type 
> (GPSManager).
>
> Kevin
>
> On 7 Apr 2010, at 20:34, Kyle Sluder wrote:
>
>> On Apr 7, 2010, at 3:44 PM, "Patrick M. Rutkowski"  
>> wrote:
>>
>>> Is there a way to turn this IB feature off?
>>
>> No. Just give the object a name. Much better than having a bunch of nameless 
>> Custom Objects floating around.
>>
>> --Kyle Sluder
>> ___
>>
>> 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/mailman/options/cocoa-dev/cathey%40apple.com
>>
>> This email sent to cat...@apple.com
>
>
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [NSMutableArray array]

2010-04-08 Thread Patrick M. Rutkowski
Agreed, but there's always the danger the +array method, which might
actually be implemented in NSArray.m, will not properly initialize the
more specific NSMutableArray object.

Of course, in this specific case that's the case, but it might be the
case with other class hierarchies.

But, nonetheless I'm troubled that nobody in this thread has
acknowledged that yet :-o

-Patrick

On Thu, Apr 8, 2010 at 12:37 PM, Bill Bumgarner  wrote:
>
> On Apr 8, 2010, at 7:35 AM, Patrick M. Rutkowski wrote:
>
>> What I was worried about is that maybe NSMutableArray (or any
>> sub-class in general) would need to do some special sub-class-specific
>> initialization, which it might not have implemented. I guess though,
>> if you're going to be sub-classing a class, then you ought to
>> generally make sure that all of it's static method will work on your
>> new sub-class?
>>
>> There's always the danger that the super-class will have new static
>> methods added without your knowledge though.
>
> There is no such thing as a static method in Objective-C;  there are class 
> methods and instance methods.  Class methods are inherited just like instance 
> methods.
>
> Thus, when you say [NSMutableArray array], NSMutableArray's implementation of 
> +array will be invoked (if it exists), regardless of whether or not said 
> method is declared in the @interface of NSMutableArray.
>
> b.bum
>
>
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [NSMutableArray array]

2010-04-08 Thread Fritz Anderson
On 8 Apr 2010, at 12:21 PM, Patrick M. Rutkowski wrote:

> Agreed, but there's always the danger the +array method, which might
> actually be implemented in NSArray.m, will not properly initialize the
> more specific NSMutableArray object.
> 
> Of course, in this specific case that's the case, but it might be the
> case with other class hierarchies.
> 
> But, nonetheless I'm troubled that nobody in this thread has
> acknowledged that yet :-o

Because acknowledging that some people will release buggy frameworks goes 
without saying. I'm not aware of any Apple classes that have that bug.

— F

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What is the best approach for custom tab bar interface?

2010-04-08 Thread Jack Carbaugh
Any control can tell the tab bar to switch the tabview ... or the tab  
bar itself...


what was suggested was go tabless ... then have a button or any other  
control send a message to the tab bar to switch it's tab. Far easier  
to do this than to subclass the tab bar to display its tabs vertically.


On Apr 8, 2010, at 1:10 PM, Philip Mobley wrote:


On Apr 8, 2010, at 8:22 AM, Gideon King wrote:

Absolutely. Use an NSTabView, but set it to be tabless, and create  
your own control to change the selected tab.


My question isn't how to get the Tabs to work, but the control which  
controls the tab switching.  =)


I need to have a tab style interface, but am not able to use the  
built in NSTabView because the style is not customizable.   
Basically I need something similar in look to the Safari tabs, but  
on a VERTICAL direction.  At this point I am thinking about a  
custom NSView with CALayers for each tab element and then handling  
the MouseDown and MouseUp events to "capture" the button press.  Or  
is there another approach I can take?


___

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/mailman/options/cocoa-dev/intrntmn%40aol.com

This email sent to intrn...@aol.com


___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [NSMutableArray array]

2010-04-08 Thread Shawn Erickson
On Thu, Apr 8, 2010 at 10:21 AM, Patrick M. Rutkowski
 wrote:
> Agreed, but there's always the danger the +array method, which might
> actually be implemented in NSArray.m, will not properly initialize the
> more specific NSMutableArray object.

A correct subclass MUST ensure that things are correctly initialized
otherwise document that it doesn't do that.

> Of course, in this specific case that's the case, but it might be the
> case with other class hierarchies.

It would be a poorly implemented if that was the case and either
should be reworked or clearly documented.

> But, nonetheless I'm troubled that nobody in this thread has acknowledged 
> that yet :-o

Not acknowledged what? You can always write buggy code that doesn't
conform to expectations / conventions... the goal is to not do that.

-Shawn
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [NSMutableArray array]

2010-04-08 Thread Bill Bumgarner

On Apr 8, 2010, at 10:21 AM, Patrick M. Rutkowski wrote:

> Agreed, but there's always the danger the +array method, which might
> actually be implemented in NSArray.m, will not properly initialize the
> more specific NSMutableArray object.
> 
> Of course, in this specific case that's the case, but it might be the
> case with other class hierarchies.
> 
> But, nonetheless I'm troubled that nobody in this thread has
> acknowledged that yet :-o

Because, in practice, that doesn't generally happen. 

Across the system supplied frameworks, classes generally have designated 
initializers and those initializers are inherited properly.  The convenience 
creation methods -- factory methods, if you will -- are dead simple stupid, 
generally doing the equivalent of '[[[self alloc] init*] autorelease]' where 
the init part calls the designated initializer.

If a subclass needs a more specific initializer, the inherited, simpler, 
initializer from the superclass is typically overridden to barf an error or 
call the more specific with a default argument.

Thus, the risk is largely -- there are probably an exception or two and, if you 
know of one, file a bug -- confined to the code you write.   Generally, class 
hierarchies in Objective-C tend to be relatively shallow and relatively well 
factored (if you are doing it right, anyway).When there is inheritance, the 
most effective use is in maintaining consistency in interface across super and 
subclasses, including the designated initializers.

So, again, in your own code the risk should be relatively minor in a clean 
design.

Now, of course, none of us are perfect and just about all of us have put 
together a shoddily architected, way too deep, class hierarchy now and again.   
Even when slinging crap code, there is no reason why it can't be defensive crap 
code, too!

b.bum

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How does Finder determine when a file is busy being written to the disk?

2010-04-08 Thread Lee Gillen
On Wed, Apr 7, 2010 at 11:25 PM, Jens Alfke  wrote:
> That may be true, but it's not directly related to the Finder graying out the 
> source file. As I said, it grays out the file when it itself starts copying 
> it. It has no way of telling when some other process is doing the copy.

Unfortunately my theory is not true. Part of the file is written while
Finder is copying the file and there is no swap.

Is there anyway for my app to see that the file is being written to? I
was thinking of looking at 'fuser' or trying to open the file in write
mode as a test.

I haven't tried looking at kMagicBusyCreationDate, is that recommended?
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How does Finder determine when a file is busy being written to the disk?

2010-04-08 Thread Jens Alfke


On Apr 8, 2010, at 10:53 AM, Lee Gillen wrote:


Is there anyway for my app to see that the file is being written to? I
was thinking of looking at 'fuser' or trying to open the file in write
mode as a test.


I don't know what 'fuser' is. Opening the file in write mode will  
always succeed; Unix doesn't have the concept of a 'busy' file. If the  
Finder uses an exclusive lock on the file while it's being written to,  
then you could attempt to open the file with an exclusive lock, and it  
would fail if the Finder already had the file locked. (This is all  
standard Unix file stuff that you could learn more about from books or  
online references...)


Maybe you should describe in detail what you're trying to do? There  
might be a better way to approach the problem.


—Jens___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How does Finder determine when a file is busy being written to the disk?

2010-04-08 Thread Lee Gillen
On Thu, Apr 8, 2010 at 1:58 PM, Jens Alfke  wrote:

> Maybe you should describe in detail what you're trying to do? There might be
> a better way to approach the problem.

My app watches a folder using FSEvents to see when files are added to
it and then uploads those files to a server. It's kind of like a hot
folder. The issue is that when users are copying large files,
especially from a network drive, the upload will begin before the file
has been completely written to the disk.

'fuser' is a command line utility that tell you what app PID has the
file open. I see that if I pass 'fuser' the file path I see that
Finder has the file open.
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How does Finder determine when a file is busy being written to the disk?

2010-04-08 Thread Paul Sanders
Maybe poll the file size when you get your event and wait for it 
to stop changing.

Paul Sanders.

- Original Message - 
From: "Lee Gillen" 
To: "Jens Alfke" 
Cc: "Apple Developer Mailing List" 
Sent: Thursday, April 08, 2010 7:08 PM
Subject: Re: How does Finder determine when a file is busy being 
written to the disk?


My app watches a folder using FSEvents to see when files are 
added to
it and then uploads those files to a server. It's kind of like a 
hot
folder. The issue is that when users are copying large files,
especially from a network drive, the upload will begin before 
the file
has been completely written to the disk.

'fuser' is a command line utility that tell you what app PID has 
the
file open. I see that if I pass 'fuser' the file path I see that
Finder has the file open.



___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [NSMutableArray array]

2010-04-08 Thread glenn andreas

On Apr 8, 2010, at 12:29 PM, Bill Bumgarner wrote:

> 
> On Apr 8, 2010, at 10:21 AM, Patrick M. Rutkowski wrote:
> 
>> Agreed, but there's always the danger the +array method, which might
>> actually be implemented in NSArray.m, will not properly initialize the
>> more specific NSMutableArray object.
>> 
>> Of course, in this specific case that's the case, but it might be the
>> case with other class hierarchies.
>> 
>> But, nonetheless I'm troubled that nobody in this thread has
>> acknowledged that yet :-o
> 
> Because, in practice, that doesn't generally happen. 
> 
> Across the system supplied frameworks, classes generally have designated 
> initializers and those initializers are inherited properly.  The convenience 
> creation methods -- factory methods, if you will -- are dead simple stupid, 
> generally doing the equivalent of '[[[self alloc] init*] autorelease]' where 
> the init part calls the designated initializer.

There is a problem with "things that look like convenience creation methods but 
aren't" - most notably +[NSParagraphStyle defaultParagraphStyle].  You might 
expect:

NSMutableParagraphStyle *ps = [NSMutableParagraphStyle defaultParagraphStyle];
[ps setAlignment: NSCenterTextAlignement];

to work.  It doesn't (since ps is actually an immutable NSParagraphStyle).

The major clue that is isn't a convenience creation method being found in the 
declaration:

- (NSParagraphStyle *) defaultParagraphStyle;

instead of:

- (id) defaultParagraphStyle;


Glenn Andreas  gandr...@gandreas.com 
The most merciful thing in the world ... is the inability of the human mind to 
correlate all its contents - HPL

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [NSMutableArray array]

2010-04-08 Thread Michael Ash
On Thu, Apr 8, 2010 at 1:21 PM, Patrick M. Rutkowski  wrote:
> Agreed, but there's always the danger the +array method, which might
> actually be implemented in NSArray.m, will not properly initialize the
> more specific NSMutableArray object.
>
> Of course, in this specific case that's the case, but it might be the
> case with other class hierarchies.
>
> But, nonetheless I'm troubled that nobody in this thread has
> acknowledged that yet :-o

Take a look at the declaration for this method:

+ (id)array;

This is subtle... but it actually tells you everything you need to
know for this question.

The key is the "id" return type. Although at the language level this
just means that it returns some kind of object, it has a deeper
meaning when it comes to Cocoa conventions. More specifically, an "id"
type on a factory method like this means that the method will return
an instance of the class that the message is sent to, even if it's a
subclass. (It could return an instance of a subclass of that class,
but that's perfectly legal.) The "id' means that subclasses will work
correctly, and that the implementation uses [self alloc].

Virtually all factory methods are declared like this, and thus that's
how they work.

As a counterexample, look at +[NSParagraphStyle defaultParagraphStyle]:

+ (NSParagraphStyle *)defaultParagraphStyle;

It's not declared to return 'id'. This means that
[NSMutableParagraphStyle defaultParagraphStyle] is *not* guaranteed to
return an instance of NSMutableParagraphStyle. It could, but you
shouldn't count on it. You have to assume that the object you get is
always a straight NSParagraphStyle, and code accordingly. (In this
particular case, you'd make a mutable copy of the returned object,
then use that.)

As a bonus, this convention means that the compiler will yell at you
if you try to write code like:

NSMutableParagraphStyle *style = [NSMutableParagraphStyle
defaultParagraphStyle];

Of course you can't count on warnings to keep you safe all the time,
but it helps.

So check for the 'id' return value, and if it's there, you can code in
confidence.

Mike
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: OS X Game Programming

2010-04-08 Thread Pascal Harris
Wow.  What a fantastic collection of resources for me to digest.  Thank you all 
so much.  I'm very grateful.

On 7 Apr 2010, at 21:52, Raffael Cavallaro wrote:

> 
> On Apr 7, 2010, at 3:58 PM, Jens Alfke wrote:
> 
>> On Apr 7, 2010, at 11:08 AM, Raffael Cavallaro wrote:
>> 
>>> At the top of the page it says:
>>> 
>>> "Clone this repository (size: 959.4 KB): HTTPS / SSH
>>> $ hg clone http://bitbucket.org/snej/geekgameboard/";
>>> 
>>> This means you need mercurial:
>> 
>> No you don't — you can just click the "get source" button at the top right 
>> and download as zip or tar.
> 
> Sorry about the misinformation - I only saw the hg clone line up top, so 
> that's how I got the source.
> 
> warmest regards,
> 
> Ralph
> 
> 
> Raffael Cavallaro
> raffaelcavall...@me.com
> 
> 
> 
> 
> 
> ___
> 
> 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/mailman/options/cocoa-dev/45rpmlists%40googlemail.com
> 
> This email sent to 45rpmli...@googlemail.com

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What gets automatically localized?

2010-04-08 Thread Dave DeLong
This ticket has popped up on my radar again at work, and I still have a hard 
time believing that I have to translate things like "File", "Edit", "Undo", 
"Special Characters", etc myself.

Is that really the case?

Thanks,

Dave

On Jan 5, 2010, at 3:11 PM, Dave DeLong wrote:

> Hi everyone,
> 
> I'm working on localizing an application, and I've been trying to figure out 
> what the runtime/OS/whatever will automatically localize for me (specifically 
> referring to the standard menubar).  Obviously, if I add my own NSMenuItems, 
> I have to localize them myself.  Some menuitems seem to be translated 
> automatically (Undo, Redo, Special Characters), while others don't (Find, 
> Spelling, Services).  Is there any rhyme or reason to why some menuitems get 
> localized without intervention and others don't?  Do I, for example, need to 
> manually localize "About MyApp", "MyApp Help", "Hide MyApp", "File" (the menu 
> title), "Edit" (menu title), etc?
> 
> Any insight would be greatly appreciated.
> 
> Thanks!
> 
> Dave DeLong



smime.p7s
Description: S/MIME cryptographic signature
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

CFRunLoopStop exception

2010-04-08 Thread vincent habchi
Hi,

I was running quite an intensive test on creating/freeing threads running 
RunLoops, and I got a rather unexpected crash while executing CFRunLoopStop ():

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0002, 0x
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   com.apple.CoreFoundation0x7fff801da6d1 CFRunLoopWakeUp + 129
[…]

Since I had 34 other threads active, I wonder if there is any practical 
threshold on the number of Run Loops Snow Leopard can manage?

Thanks,
Vincent___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [NSMutableArray array]

2010-04-08 Thread Patrick M. Rutkowski
Wow! Good stuff Michael :-)

I can't believe I never noticed that.

On Thu, Apr 8, 2010 at 3:07 PM, Michael Ash  wrote:
> On Thu, Apr 8, 2010 at 1:21 PM, Patrick M. Rutkowski  
> wrote:
>> Agreed, but there's always the danger the +array method, which might
>> actually be implemented in NSArray.m, will not properly initialize the
>> more specific NSMutableArray object.
>>
>> Of course, in this specific case that's the case, but it might be the
>> case with other class hierarchies.
>>
>> But, nonetheless I'm troubled that nobody in this thread has
>> acknowledged that yet :-o
>
> Take a look at the declaration for this method:
>
> + (id)array;
>
> This is subtle... but it actually tells you everything you need to
> know for this question.
>
> The key is the "id" return type. Although at the language level this
> just means that it returns some kind of object, it has a deeper
> meaning when it comes to Cocoa conventions. More specifically, an "id"
> type on a factory method like this means that the method will return
> an instance of the class that the message is sent to, even if it's a
> subclass. (It could return an instance of a subclass of that class,
> but that's perfectly legal.) The "id' means that subclasses will work
> correctly, and that the implementation uses [self alloc].
>
> Virtually all factory methods are declared like this, and thus that's
> how they work.
>
> As a counterexample, look at +[NSParagraphStyle defaultParagraphStyle]:
>
> + (NSParagraphStyle *)defaultParagraphStyle;
>
> It's not declared to return 'id'. This means that
> [NSMutableParagraphStyle defaultParagraphStyle] is *not* guaranteed to
> return an instance of NSMutableParagraphStyle. It could, but you
> shouldn't count on it. You have to assume that the object you get is
> always a straight NSParagraphStyle, and code accordingly. (In this
> particular case, you'd make a mutable copy of the returned object,
> then use that.)
>
> As a bonus, this convention means that the compiler will yell at you
> if you try to write code like:
>
> NSMutableParagraphStyle *style = [NSMutableParagraphStyle
> defaultParagraphStyle];
>
> Of course you can't count on warnings to keep you safe all the time,
> but it helps.
>
> So check for the 'id' return value, and if it's there, you can code in
> confidence.
>
> Mike
> ___
>
> 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/mailman/options/cocoa-dev/rutski89%40gmail.com
>
> This email sent to rutsk...@gmail.com
>
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: CFRunLoopStop exception

2010-04-08 Thread vincent habchi
Well, I forgot to mention that each thread is responsible for the drawing of a 
CATileLayer, if that matters.

Vincent

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: CFRunLoopStop exception

2010-04-08 Thread Jesper Storm Bache
FYI: Remember that corefoundation is open source. 10.6.2 can be found at: 
http://www.opensource.apple.com/source/CF/CF-550.13/
EXC_BREAKPOINT is an "int 3" instruction (and HALT in CF code is typically used 
for this).

>From CFRunLoopStop from 10.6.2 sources:

void CFRunLoopWakeUp(CFRunLoopRef rl) {
CHECK_FOR_FORK();
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED
kern_return_t ret;
/* We unconditionally try to send the message, since we don't want
 * to lose a wakeup, but the send may fail if there is already a
 * wakeup pending, since the queue length is 1. */
ret = __CFSendTrivialMachMessage(rl->_wakeUpPort, 0, MACH_SEND_TIMEOUT, 0);
if (ret != MACH_MSG_SUCCESS && ret != MACH_SEND_TIMED_OUT) {
HALT;
}
#else

Maybe this is what caused your crash.

Jesper


On Apr 8, 2010, at 1:03 PM, vincent habchi wrote:

Hi,

I was running quite an intensive test on creating/freeing threads running 
RunLoops, and I got a rather unexpected crash while executing CFRunLoopStop ():

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0002, 0x
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   com.apple.CoreFoundation   0x7fff801da6d1 CFRunLoopWakeUp + 129
[…]

Since I had 34 other threads active, I wonder if there is any practical 
threshold on the number of Run Loops Snow Leopard can manage?

Thanks,
Vincent___

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/mailman/options/cocoa-dev/jsbache%40adobe.com

This email sent to jsba...@adobe.com

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: CFRunLoopStop exception

2010-04-08 Thread Greg Parker
On Apr 8, 2010, at 1:03 PM, vincent habchi wrote:
> I was running quite an intensive test on creating/freeing threads running 
> RunLoops, and I got a rather unexpected crash while executing CFRunLoopStop 
> ():
> 
> Exception Type:  EXC_BREAKPOINT (SIGTRAP)
> Exception Codes: 0x0002, 0x
> Crashed Thread:  0  Dispatch queue: com.apple.main-thread
> 
> Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
> 0   com.apple.CoreFoundation  0x7fff801da6d1 CFRunLoopWakeUp + 129
> […]
> 
> Since I had 34 other threads active, I wonder if there is any practical 
> threshold on the number of Run Loops Snow Leopard can manage?

This crash usually means you're trying to wake a run loop that is already dead. 
Register rax will be an error code from mach_msg(). It's probably equal to this:

#define MACH_SEND_INVALID_DEST  0x1003
/* Bogus destination port. */


-- 
Greg Parker gpar...@apple.com Runtime Wrangler


___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: The right place for an importer in the document architecture

2010-04-08 Thread Seth Willits
On Apr 8, 2010, at 4:46 AM, Gideon King wrote:

> So I need to know where in the process I need to intercept the original file 
> open request and do the conversion, and forward the request to open the 
> converted file.


It depends on your interface. If you're offering the ability to simply "open" 
this type of document using the normal mechanisms like the Open menu item, or 
dragging the file onto the application icon, then you would add the document 
type to Info.plist. In the normal file reading methods, you would read from the 
file and convert it to your format, and set the url to nil etc.

Here's an example:
http://www.sethwillits.com/temp/DocChangeTest.zip


If you want a separate import process like using File -> Import, which does an 
open dialog, pick a file and it creates an untitled document, you'd just stick 
all of that in a normal top-level controller that does the reading, creates a 
new document of your native type, and sets the data on that document.


--
Seth Willits


___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What gets automatically localized?

2010-04-08 Thread Ken Thomases
On Apr 8, 2010, at 2:53 PM, Dave DeLong wrote:

> This ticket has popped up on my radar again at work, and I still have a hard 
> time believing that I have to translate things like "File", "Edit", "Undo", 
> "Special Characters", etc myself.
> 
> Is that really the case?

Apple provides a number of translation glossaries for AppleGlot (although I'm 
sure you can extract their contents for use with other tools, too).  Go to 
http://connect.apple.com, log in, go to Downloads, Internationalization.

Cheers,
Ken

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What gets automatically localized?

2010-04-08 Thread Dave DeLong
Aha, I knew I'd seen those around somewhere.  Unfortunately, our setup is such 
that we can't use AppleGlot without a major overhaul of our build process, so I 
guess we're stuck with manual translation. :(

Thanks,

Dave

On Apr 8, 2010, at 2:38 PM, Ken Thomases wrote:

> On Apr 8, 2010, at 2:53 PM, Dave DeLong wrote:
> 
>> This ticket has popped up on my radar again at work, and I still have a hard 
>> time believing that I have to translate things like "File", "Edit", "Undo", 
>> "Special Characters", etc myself.
>> 
>> Is that really the case?
> 
> Apple provides a number of translation glossaries for AppleGlot (although I'm 
> sure you can extract their contents for use with other tools, too).  Go to 
> http://connect.apple.com, log in, go to Downloads, Internationalization.
> 
> Cheers,
> Ken
> 



smime.p7s
Description: S/MIME cryptographic signature
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

initWithObject Confusion

2010-04-08 Thread John Nairn

How is this possible?

I wrote code in Snow Leopard to create an array with a single object  
using


 NSArray *myArray = [ [NSArray alloc] initWithObject:oneObject ] ;

and it worked fine. When it crashed in either Leopard or Tiger, I went  
to NSArray documentation and found out that it does not have the  
method initWithObject. Once I found that out, it was easy to fix with  
the proper


 NSArray *myArray = [ [NSArray alloc]  
initWithObjects:oneObject ,nil] ;


But, the remaining questions are:

1. Why would the initWithObject: compile in the first place? (perhaps  
because one of my custom classes defines an initWithObject: method)


2. Even if it compiles, how can it run in Snow Leopard when there is  
no initWithObject: selector for NSArray (or at least according to the  
NSArray docmentation there isn't one)?


---
John Nairn (1-541-737-4265, FAX:1-541-737-3385)
Professor and Richardson Chair
Web Page: http://www.cof.orst.edu/cof/wse/faculty/Nairn/
FEA/MPM Web Page: http://oregonstate.edu/~nairnj




___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: initWithObject Confusion

2010-04-08 Thread Kyle Sluder
On Thu, Apr 8, 2010 at 2:05 PM, John Nairn  wrote:
> 1. Why would the initWithObject: compile in the first place? (perhaps
> because one of my custom classes defines an initWithObject: method)

Correct. +alloc is typed to return id, which the compiler won't warn
about if it has ever seen the method you're sending defined on any
class.

> 2. Even if it compiles, how can it run in Snow Leopard when there is no
> initWithObject: selector for NSArray (or at least according to the NSArray
> docmentation there isn't one)?

Have you checked your console output? Or there might be a private
-initWithObject: method and you happened to get lucky.

--Kyle Sluder
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What gets automatically localized?

2010-04-08 Thread Kyle Sluder
On Thu, Apr 8, 2010 at 1:58 PM, Dave DeLong  wrote:
> Aha, I knew I'd seen those around somewhere.  Unfortunately, our setup is 
> such that we can't use AppleGlot without a major overhaul of our build 
> process, so I guess we're stuck with manual translation. :(

The files aren't too bad. You could probably write a script to convert
them to whatever format you needed.

--Kyle Sluder
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What gets automatically localized?

2010-04-08 Thread Gary L. Wade
I don't know if this is documented somewhere, but if all you're needing is
an actual string to copy into your project, you could try checking the
frameworks' resources on your disk.  If your project is linking against the
actual runtime frameworks rather than one of the SDK versions, try doing a
"Find in Project", "In Frameworks", "Special Characters".

In the meantime, I'll open a bug requesting documentation for standard UI
text strings that we can pull in at runtime, and I suggest you do the same.

On 04/08/2010 1:58 PM, "Dave DeLong"  wrote:

> Aha, I knew I'd seen those around somewhere.  Unfortunately, our setup is such
> that we can't use AppleGlot without a major overhaul of our build process, so
> I guess we're stuck with manual translation. :(
> 
> Thanks,
> 
> Dave
> 
> On Apr 8, 2010, at 2:38 PM, Ken Thomases wrote:
> 
>> On Apr 8, 2010, at 2:53 PM, Dave DeLong wrote:
>> 
>>> This ticket has popped up on my radar again at work, and I still have a hard
>>> time believing that I have to translate things like "File", "Edit", "Undo",
>>> "Special Characters", etc myself.
>>> 
>>> Is that really the case?
>> 
>> Apple provides a number of translation glossaries for AppleGlot (although I'm
>> sure you can extract their contents for use with other tools, too).  Go to
>> http://connect.apple.com, log in, go to Downloads, Internationalization.
>> 
>> Cheers,
>> Ken
>> 


___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How does Finder determine when a file is busy being written to the disk?

2010-04-08 Thread Jens Alfke


On Apr 8, 2010, at 11:08 AM, Lee Gillen wrote:


My app watches a folder using FSEvents to see when files are added to
it and then uploads those files to a server. It's kind of like a hot
folder. The issue is that when users are copying large files,
especially from a network drive, the upload will begin before the file
has been completely written to the disk.


Apple's Folder Actions feature runs into this issue too. I suspect  
they use a heuristic like waiting for the file's mod date and size to  
stop changing for a few seconds, but I'm not sure.


You should ask on the darwin-userlevel or darwin-dev lists, where the  
real Unix graybeards hang out.


—Jens___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSPredicateEditor, _NSRuleEditorViewUnboundRowHolder and boundArray error moving to 10.6

2010-04-08 Thread Barry Wark
I have an application originally written for the 10.5 SDK. The app
presents a document modal sheet (owned by a separate
NSWindowController subclass) which contains an NSPredicateEditor.
Starting with the move to OS X 10.6, I am getting the following
exception when calling setObjectValue: on the predicate editor
instance from within my window controller subclass:

[<_NSRuleEditorViewUnboundRowHolder 0x1005ccf50>
valueForUndefinedKey:]: this class is not key value coding-compliant
for the key boundArray.

I have verified that the nib containing the window has been loaded
correctly and that the object value I'm trying to set is a valid
NSPredicate. Since my app uses several custom row templates, I removed
the call to setRowTemplates and put some generic row templates in the
editor via Interface Builder. I still receive the same error.

I am *not* able to replicate this error with a small test project,
hence the problem is clearly in my code, but I am lost in tracking
down the source of the problem. Has anyone come across this issue
and/or have a suggestion for where to start?

Any help greatly appreciated.

Thanks,
Barry
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


ATSApplicationFontsPath "just doesn't work" Was: Can I add my own chars...?

2010-04-08 Thread Jerry Krinock

On 2010 Mar 24, at 15:18, Quincey Morris wrote:

> http://developer.apple.com/mac/library/documentation/General/Reference/InfoPlistKeyReference/Articles/GeneralPurposeKeys.html#//apple_ref/doc/uid/TP40009253-SW8

Well, it looks so damned simple.  I can use an app such as SigMaker to make a 
new font containing several symbols which are rendered poorly in my app.  After 
installing this new font my app, the system should use my symbols instead of 
Lucida Grande whenever their unicode points appear in strings.  But the install 
just doesn't work...

• To eliminate my own newbie errors with SigMaker, I go into /Library/Fonts and 
make a copy of a known-good font, Herculanum.ttf.  This font has at least all 
the ASCII characters.

• I put the copy of Herculanum.ttf in my app's Contents/Resources.

• Editing my app's Info.plist, add
 Key: ATSApplicationFontsPath
String Value: Herculanum.ttf

• Launch my app

Expected Result: Text fields' "System font" is Herculanum.
Actual Result: Text fields' "System font" is still the usual Lucida Grande.

Repeat without the .ttf extension in Info.plist.  Still Lucida Grande.

Move Herculanum.ttf into Contents/Resources/Fonts and try each of the following 
values for key ATSApplicationFontsPath in Info.plist:
   Fonts
   Fonts/Herculanum
   Fonts/Herculanum.ttf

Still, all I ever get is Lucida Grande.

What else do I need to do?

I also looked at Gerriet's code...

On 2010 Mar 24, at 22:54, Gerriet M. Denkmann wrote:

> I have no documentation references but I do it like this:
> 
> NSFont *font = ... something...
> NSString *thaiFont = [ font isFixedPitch ] ? @"Ayuthaya" : @"Thonburi";
> CGFloat size = [ font pointSize ];
> NSFontDescriptor *fode2 = [ NSFontDescriptor fontDescriptorWithName: thaiFont 
> size: size ];
> NSArray *fodArray = [ NSArray arrayWithObject: fode2 ];
> NSDictionary *fodDict = [ NSDictionary dictionaryWithObject: fodArray
>  forKey: 
> NSFontCascadeListAttribute ];
> NSFontDescriptor *fode1 = [ font fontDescriptor ];
> NSFontDescriptor *fofo = [ fode1 fontDescriptorByAddingAttributes: fodDict ];
> NSFont *aFont = [ NSFont fontWithDescriptor: fofo size: size ];
> if ( aFont == nil )... error handling
> font = aFont;

But this looks like a different problem, Gerriet.  You've got the font and 
you're creating a font description.

Thanks for reading,

Jerry Krinock

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: ATSApplicationFontsPath "just doesn't work" Was: Can I add my own chars...?

2010-04-08 Thread Kyle Sluder
On Thu, Apr 8, 2010 at 3:50 PM, Jerry Krinock  wrote:
> • Editing my app's Info.plist, add
>             Key: ATSApplicationFontsPath
>    String Value: Herculanum.ttf
>
> • Launch my app
>
> Expected Result: Text fields' "System font" is Herculanum.
> Actual Result: Text fields' "System font" is still the usual Lucida Grande.
>

Why would you expect this? Nowhere does the documentation say that
this key will change the return value of +[NSFont systemFontOfSize:].

--Kyle Sluder
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: initWithObject Confusion

2010-04-08 Thread John Nairn

On Apr 8, 2010, at 2:10 PM, Kyle Sluder wrote:

2. Even if it compiles, how can it run in Snow Leopard when there  
is no
initWithObject: selector for NSArray (or at least according to the  
NSArray

docmentation there isn't one)?


Have you checked your console output? Or there might be a private
-initWithObject: method and you happened to get lucky.



Yes I did check console and that is how I finally solved the problem.  
On Leopard and Tiger it would correctly (IMHO) report something like


 [NSPlaceHolderArray initWithObject:] selector not recognized

and would then crash.

In Snow Leopard, however, there was no message and it worked fine as  
if Snow Leopard read my mind and realized I wanted to create an array  
with a single object. But, I am nervous about relying on the OS to  
read my mind (or even have an idea of how it did that)?


---
John Nairn (1-541-737-4265, FAX:1-541-737-3385)
Professor and Richardson Chair
Web Page: http://www.cof.orst.edu/cof/wse/faculty/Nairn/
FEA/MPM Web Page: http://oregonstate.edu/~nairnj




___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: ATSApplicationFontsPath "just doesn't work" Was: Can I add my own chars...?

2010-04-08 Thread Jerry Krinock

On 2010 Apr 08, at 15:59, Kyle Sluder wrote:

> On Thu, Apr 8, 2010 at 3:50 PM, Jerry Krinock  wrote:
>> • Editing my app's Info.plist, add
>> Key: ATSApplicationFontsPath
>>String Value: Herculanum.ttf
>> 
>> Expected Result: Text fields' "System font" is Herculanum.
>> Actual Result: Text fields' "System font" is still the usual Lucida Grande.
> 
> Why would you expect this? Nowhere does the documentation say that
> this key will change the return value of +[NSFont systemFontOfSize:].

Well, because a couple weeks ago you said that there was a way to do this...

On 2010 Mar 24, at 12:21, Kyle Sluder wrote:

> I would create a custom font containing the characters you need, and
> insert that font into the cascade list ahead of the system font.

And I searched far and wide for how to "insert that font into the cascade 
list", but this was the closest thing I could find.  Do you know how to "insert 
that font into the cascade list"?

Thanks,

Jerry

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: initWithObject Confusion

2010-04-08 Thread Nick Zitzmann

On Apr 8, 2010, at 5:03 PM, John Nairn wrote:

> In Snow Leopard, however, there was no message and it worked fine as if Snow 
> Leopard read my mind and realized I wanted to create an array with a single 
> object. But, I am nervous about relying on the OS to read my mind (or even 
> have an idea of how it did that)?

It happened because you used a method that is present but private in Snow 
Leopard and apparently nonexistent in earlier versions of the frameworks:

% otool -ov /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
[...]
   isa 0x19cd00 _OBJC_METACLASS_$_NSArray
superclass 0x19d4a8 _OBJC_CLASS_$_NSObject
[...]
  name 0x13597e initWithObject:
 types 0x139f58 @2...@0:8...@16
   imp 0x101820 -[NSArray initWithObject:]

Nick Zitzmann


___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: ATSApplicationFontsPath "just doesn't work" Was: Can I add my own chars...?

2010-04-08 Thread Kyle Sluder
On Thu, Apr 8, 2010 at 4:05 PM, Jerry Krinock  wrote:
> Well, because a couple weeks ago you said that there was a way to do this...

But the plist key you mentioned is documented to activate a font for a
process, thus making it usable in your application. It has nothing to
do with font cascades.

> And I searched far and wide for how to "insert that font into the cascade 
> list", but this was the closest thing I could find.  Do you know how to 
> "insert that font into the cascade list"?

The code Gerriet provided is directly related to what you want to do.
It creates a font descriptor with the appropriate cascade list and
then creates a font from that descriptor. You would then assign that
font to the text view in which you want your special characters to
appear.

Since Core Text is really where this magic happens (Core Text
underlies the Cocoa Text System), you will want to read the Core Text
Programming Guide, specifically the third paragraph of the Fonts
section in the Core Text Overview:
http://developer.apple.com/mac/library/documentation/Carbon/Conceptual/CoreText_Programming/Overview/Overview.html

--Kyle Sluder
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Moderator: iPhone OS 4.0 OFF LIMITS

2010-04-08 Thread Scott Anguish
iPhone OS 4.0 is under Non-Disclosure. We’ve already seen this NDA broken on 
another list (and pre-emptive moderation has been taken)

There will be no second chances here. You break the NDA, you’re moderated and 
your information is sent to WWDR.

Apple provides developer forms at devforums.apple.com that allow this type of 
discussion for paying developers.

Once again. It is off limits. 

Scott
[Moderator]___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Changing the drag image on the fly

2010-04-08 Thread David Riggle
I'd like to change the drag image based on the drop location, the way iCal 
does. I found this tantalizing snippet in the WebCore code:

  if (cocoaImage) {
  // Dashboard wants to be able to set the drag image during dragging, 
but Cocoa does not allow this.
  // Instead we must drop down to the CoreGraphics API.
  wkSetDragImage(cocoaImage, cocoaLoc);

  // Hack: We must post an event to wake up the NSDragManager, which is 
sitting in a nextEvent call
  // up the stack from us because the CoreFoundation drag manager does 
not use the run loop by itself.
  // This is the most innocuous event to use, per Kristen Forster.
  NSEvent* ev = [NSEvent mouseEventWithType:NSMouseMoved 
location:NSZeroPoint
  modifierFlags:0 timestamp:0 windowNumber:0 context:nil 
eventNumber:0 clickCount:0 pressure:0];
  [NSApp postEvent:ev atStart:YES];
  }

http://www.opensource.apple.com/source/WebCore/WebCore-1A543a/platform/mac/ClipboardMac.mm

I can't find the implementation to wkSetDragImage(). Does anybody know what 
CoreGraphics APIs are used to set the drag image?

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSTableView Key Value Observing performance pickle

2010-04-08 Thread Chris Idou


I seem to have got myself into some pickle with key value observing whereby 
things to do with NSTableView are freezing up for minutes at a time. Every time 
I pause the program there are things to do with adding and removing observers, 
but all of it is in Apple's code, so I'm not quite sure what I've done to cause 
this problem.





#00x7fff8453d06b in append_referrer_no_lock
#10x7fff8453ea58 in weak_register
#20x7fff845366e2 in auto_assign_weak_reference
#30x7fff81d6a36e in -[NSConcretePointerArray arrayGrow:]
#40x7fff81c64cdd in -[NSConcretePointerArray addPointer:]
#50x7fff81c6aa99 in -[NSKeyValueObservationInfo _initWithObservances:count:]
#60x7fff81c70399 in _NSKeyValueObservationInfoCreateByRemoving
#70x7fff81c6fcfe in -[NSObject(NSKeyValueObserverRegistration) 
_removeObserver:forProperty:]
#80x7fff81c6fc3f in -[NSObject(NSKeyValueObserverRegistration) 
removeObserver:forKeyPath:]
#90x7fff81c70522 in -[NSKeyValueNestedProperty 
object:didRemoveObservance:recurse:]
#100x7fff81c7077f in -[NSKeyValueUnnestedProperty 
object:didRemoveObservance:recurse:]
#110x7fff81c6fd5b in -[NSObject(NSKeyValueObserverRegistration) 
_removeObserver:forProperty:]
#120x7fff81c6fc3f in -[NSObject(NSKeyValueObserverRegistration) 
removeObserver:forKeyPath:]
#130x7fff81c70522 in -[NSKeyValueNestedProperty 
object:didRemoveObservance:recurse:]
#140x7fff81c7077f in -[NSKeyValueUnnestedProperty 
object:didRemoveObservance:recurse:]
#150x7fff81c6fd5b in -[NSObject(NSKeyValueObserverRegistration) 
_removeObserver:forProperty:]
#160x7fff81c6fc3f in -[NSObject(NSKeyValueObserverRegistration) 
removeObserver:forKeyPath:]
#170x7fff810e23c7 in -[_NSModelObservingTracker 
_registerOrUnregister:observerNotificationsForModelObject:]
#180x7fff810e1a07 in -[_NSModelObservingTracker clearAllModelObjectObserving]
#190x7fff811bc4b3 in -[_NSModelObservingTracker 
setIndexReferenceModelObjectArray:clearAllModelObjectObserving:]
#200x7fff811bc44c in -[NSArrayController _setObjects:]
#210x7fff81255d9f in -[NSArrayController 
_arrangeObjectsWithSelectedObjects:avoidsEmptySelection:operationsMask:useBasis:]
#220x7fff811bc9ff in -[NSArrayController setContent:]
#240x7fff8125ad66 in -[NSArrayDetailBinder _refreshDetailContentInBackground:]
#250x7fff81c791a1 in -[NSObject(NSKeyValueObservingPrivate) 
_notifyObserversForKeyPath:change:]
#260x7fff810de96e in -[NSController _notifyObserversForKeyPath:change:]
#270x7fff811e8575 in -[NSArrayController 
didChangeValuesForArrangedKeys:objectKeys:indexKeys:]
#280x7fff811e894b in -[NSArrayController 
_selectObjectsAtIndexesNoCopy:avoidsEmptySelection:sendObserverNotifications:forceUpdate:]
#290x7fff81c6f43d in -[NSObject(NSKeyValueCoding) setValue:forKey:]
#300x7fff81ccdf42 in -[NSObject(NSKeyValueCoding) setValue:forKeyPath:]
#310x7fff8126a3ed in -[NSBinder 
_setValue:forKeyPath:ofObject:mode:validateImmediately:raisesForNotApplicableKeys:error:]
#320x7fff8126a2a5 in -[NSBinder setValue:forBinding:error:]
#330x7fff812655c8 in -[NSTableBinder tableView:didChangeToSelectedRowIndexes:]
#340x7fff81261e8f in -[_NSBindingAdaptor 
tableView:didChangeToSelectedRowIndexes:]
#350x7fff811368e2 in -[NSTableView _enableSelectionPostingAndPost]
#360x7fff811f8556 in -[NSTableView mouseDown:]
#370x7fff81199f1b in -[NSWindow sendEvent:]
#380x7fff810cf662 in -[NSApplication sendEvent:]




___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problems with repetetive execution of netstat using NSTask and NSTimer

2010-04-08 Thread William Squires
Can you put a watchpoint on the expression "pipe == nil"? Maybe that  
would show you where it's going kablooey!


On Apr 6, 2010, at 2:08 PM, Kazior Fukacz wrote:


Thanks for your answers!

By the way, are you using garbage collection?  If not, then  
you're leaking several objects (those pointed to by 'netstat',  
'pipe', and 'string').


Yeah, I suspect that the pipes (and corresponding NSFileHandles)  
are indeed leaking, and that's the real problem.  You may also  
want to create and launch NSTask instances inside an exception  
handler, since it and NSFileHandle/NSPipe can raise some  
unexpected exceptions.


I'm coding under Tiger using XCode 2.5. As far as I know garbage  
collection was introduced in XCode 3 which came with Objective-C  
2.0, am I right?


Anyway, I tried putting a NSAutoreleasePool and draining it every  
time my method finishes its work. I also tried releasing the pipe  
manually. Still no luck.


However, putting "assert(pipe != null)" right before "[netstat  
setStandardOutput: pipe];" ended up with "(...)/IPShowX/IPShowX.m: 
32: failed assertion `pipe != nil'". It happened about 15 minutes  
after launching. This might be helpful in determining what the  
reason of this problem might be. As we can see it is NSPipe- 
related. Something about allocation, initialization and releasing?


How is it that it starts to malfunction after such amount of time?

Regards,
kaziorvb
___

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/mailman/options/cocoa-dev/wsquires% 
40satx.rr.com


This email sent to wsqui...@satx.rr.com


___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: "Toll free" bridge from NSAttributedString * to CFAttributedStringRef

2010-04-08 Thread Adam R. Maxwell

On Apr 8, 2010, at 5:02 AM, vincent habchi wrote:

> I've been fiddling with NSAttributedString lately, and the way to display 
> them through Core Text. In the docs, I've read that NSAttributedString and 
> CFAttributedStringRef were supposed to be "toll free" bridged; I assumed that 
> meant that one could be used in lieu of the other with (or maybe even 
> without) a simple cast.
> 
> But I found this is not true. Specifically, I was getting strange errors like 
> "CFSet[Stroke|Fill]ColorFromColor : invalid context 0x0" each time I printed 
> my NSAttributedString by CTLineDraw(), although I had a perfectly valid 
> context. The glyph were drawn, but always in black, while I was attempting to 
> get another color via the NSForegroundColorAttributeName. At the end, I had 
> to replace the pair (NSColor, NSForeground…) by a (CGColorRef, 
> kCTForeground…), and now it works.
> 
> Is that supposed to be a "normal" behavior, did I misunderstand the meaning 
> of "toll free", or is it a bug?

You need to have a current NSGraphicsContext for NSColor (and possibly other) 
attributes.  This is pretty easy, as in the following snippet from my own code:

[NSGraphicsContext saveGraphicsState];
[NSGraphicsContext setCurrentContext:[NSGraphicsContext 
graphicsContextWithGraphicsPort:ctxt flipped:NO]];

CTFrameDraw(frame, ctxt);
CGContextFlush(ctxt);
CFRelease(frame);

[NSGraphicsContext restoreGraphicsState];

If this works, you can thank David Duncan for the fix: 
http://lists.apple.com/archives/quartz-dev/2008/Jun/msg00043.html


hth,
Adam

___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Interface Builder input panel fields not updated when OK button clicked

2010-04-08 Thread Ben Golding

This must be an old question but I can't seem to find a way to ask it so Google 
will lead me to the answer.

I have an input sheet that drops down from the window, it works fine.  A user 
updates input fields on it and then presses the OK button to close the sheet 
and update the app.  In one of the NSTextFields on the form, if the user enters 
text (without leaving the field) and then clicks the OK button, the value to 
which the field is bound isn't updated.  So if they enter "100" into the value 
field and click "OK", the value back in the app stays "0" (or whatever it was 
before).

I can't seem to find a way of ending editing on all the fields when the button 
is pressed?  Is there a way to do this?

Thanks,

Ben.

smime.p7s
Description: S/MIME cryptographic signature
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Interface Builder input panel fields not updated when OK button clicked

2010-04-08 Thread Jon Pugh
At 3:02 PM +1000 4/9/10, Ben Golding wrote:
>I can't seem to find a way of ending editing on all the fields when the button 
>is pressed?  Is there a way to do this?

NSWindow

endEditingFor:
Forces the field editor to give up its first responder status and prepares it 
for its next assignment.

- (void)endEditingFor:(id)object


Jon
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Interface Builder input panel fields not updated when OK button clicked

2010-04-08 Thread Ben Golding

On 09/04/2010, at 15:08, Jon Pugh wrote:

> At 3:02 PM +1000 4/9/10, Ben Golding wrote:
>> I can't seem to find a way of ending editing on all the fields when the 
>> button is pressed?  Is there a way to do this?
> 
> NSWindow
> 
> endEditingFor:
> Forces the field editor to give up its first responder status and prepares it 
> for its next assignment.
> 
> - (void)endEditingFor:(id)object

That's great, works exactly how I'd asked.  Thanks.

If the user has entered, say, a non-numeric value in a numeric field and they 
then hit "OK", this closes the sheet and accepts whatever the input field can 
make sense of.  Is there a way to make the app go "boop" (say) and leave the 
sheet present until the user inputs conforming text?

Ben.

smime.p7s
Description: S/MIME cryptographic signature
___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: "Toll free" bridge from NSAttributedString * to CFAttributedStringRef

2010-04-08 Thread vincent habchi
Adam,

> You need to have a current NSGraphicsContext for NSColor (and possibly other) 
> attributes.  This is pretty easy, as in the following snippet from my own 
> code:
> 
>[NSGraphicsContext saveGraphicsState];
>[NSGraphicsContext setCurrentContext:[NSGraphicsContext 
> graphicsContextWithGraphicsPort:ctxt flipped:NO]];
> 
>CTFrameDraw(frame, ctxt);
>CGContextFlush(ctxt);
>CFRelease(frame);
> 
>[NSGraphicsContext restoreGraphicsState];

Nice, I must admit I hadn't think about NSGraphicsContext at all, having a 
valid CGContext. I'll try this. Thanks at lot!

Vincent___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: CFRunLoopStop exception

2010-04-08 Thread vincent habchi
Jesper,

> FYI: Remember that corefoundation is open source. 10.6.2 can be found at: 
> http://www.opensource.apple.com/source/CF/CF-550.13/

Thanks for the link, very instructive.

> void CFRunLoopWakeUp(CFRunLoopRef rl) {
> CHECK_FOR_FORK();
> #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED
> kern_return_t ret;
> /* We unconditionally try to send the message, since we don't want
>  * to lose a wakeup, but the send may fail if there is already a
>  * wakeup pending, since the queue length is 1. */
> ret = __CFSendTrivialMachMessage(rl->_wakeUpPort, 0, MACH_SEND_TIMEOUT, 
> 0);
> if (ret != MACH_MSG_SUCCESS && ret != MACH_SEND_TIMED_OUT) {
>   HALT;
> }

Okay, so that means it is impossible to ask a run loop to stop while it is 
being messaged to wake up. Practically, this might not be a severe threat, but 
when you begin to create/destroy threads at small intervals (say, 50 ms), the 
collision seems to be inevitable (especially since I also use timers to wake up 
the loops). I wonder why the queue has only a single entry.

Anyhow, thanks again!
Vincent___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: CFRunLoopStop exception

2010-04-08 Thread Greg Parker
On Apr 8, 2010, at 10:40 PM, vincent habchi wrote:
>> void CFRunLoopWakeUp(CFRunLoopRef rl) {
>>CHECK_FOR_FORK();
>> #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED
>>kern_return_t ret;
>>/* We unconditionally try to send the message, since we don't want
>> * to lose a wakeup, but the send may fail if there is already a
>> * wakeup pending, since the queue length is 1. */
>>ret = __CFSendTrivialMachMessage(rl->_wakeUpPort, 0, MACH_SEND_TIMEOUT, 
>> 0);
>>if (ret != MACH_MSG_SUCCESS && ret != MACH_SEND_TIMED_OUT) {
>>  HALT;
>>}
> 
> Okay, so that means it is impossible to ask a run loop to stop while it is 
> being messaged to wake up. Practically, this might not be a severe threat, 
> but when you begin to create/destroy threads at small intervals (say, 50 ms), 
> the collision seems to be inevitable (especially since I also use timers to 
> wake up the loops). I wonder why the queue has only a single entry.

In this circumstance, mach_msg() will block if the queue is full, and either 
succeed later or time out. Neither of those paths should end up at HALT. 
(mach_msg() may do other things in other circumstances.)

Presumably mach_msg() returned something other than MACH_MSG_SUCCESS or 
MACH_SEND_TIMED_OUT in your example. What's in register rax in your crash log?


-- 
Greg Parker gpar...@apple.com Runtime Wrangler


___

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/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com