Re: Making an Outline View delete a rows children when the parent is deleted.

2009-09-06 Thread Joshua Garnham
I would like the Data to be deleted permanently.

Cheers,
Josh.





From: Jack Carbaugh 
To: Joshua Garnham 
Cc: cocoa-dev@lists.apple.com
Sent: Saturday, 5 September, 2009 22:37:00
Subject: Re: Making an Outline View delete a rows children when the parent is 
deleted.

That depends on your meaning.

Do you only want them deleted visibly in the table/outline view OR do  
you want the data to be deleted permanently

The table/outline is SEPARATE from the actual data.


On Sep 5, 2009, at 2:14 PM, Joshua Garnham wrote:

> How would I make a rows children be deleted when the parent is  
> deleted?
>
> Cheers,
> Josh.
>
>
>
> ___
>
> 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: What about revamping OpenUp.app for Snow Leopard?

2009-09-06 Thread Giulio Cesare Solaroli
On Fri, Sep 4, 2009 at 7:14 AM, Scott Anguish wrote:
> While I'm honored by the loyalty, you really do get most of the
> functionality from Finder now.

Feature wise, you are probably right. But the fact that OpenUp kept
all the expanded files into a separate folder and was able to clean
everything up when exiting is still a unique feature I am loving in
OpenUp.


> [...]
> There are better apps for this in the modern world. BetterZip is the one
> I've looked at.

I will give it a try.

Thanks!

Regards,

Giulio Cesare
___

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: NSString width

2009-09-06 Thread Dave Keck
> Also, keep in mind that character shapes may stick out of either edge by a
> few pixels, especially with italics or script fonts. It's usually safest to
> pad your bounding box by some fraction of the point-size.

I've noticed this too. If you need the absolute precise pixel-size of
some text, then the only way I know of (that works with all different
styles of text) is manually drawing the text into some temporary
context, and analyzing its pixels.

I'd love to be wrong on that, though, if anyone knows a better way.
___

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: Making an Outline View delete a rows children when the parent is deleted.

2009-09-06 Thread Kyle Sluder
On Sep 6, 2009, at 12:02 AM, Joshua Garnham  
 wrote:



Ok, I understand what you mean.
So how would I implement it in the Controller?


That's a question only you can answer. Break down the problem.

You also never answered the question of whether this is a behavior of  
your model objects or just a convenience you're offering in your UI.


I'm CC'ing the list. It sounds like you might have a bit if reading  
ahead of you.


--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


Code Signing

2009-09-06 Thread Peter Hudson
I notice that when I sign code ( the whole app )  I  land up with 2  
additional items in my /Contents directory in the app bundle.
These items are a folder called _CodeSignature  and an alias called  
CodeResources.


If I delete these two items, the code still identifies itself as  
signed ( when I attempt to run codesign on it again ).

Also, the app still runs.

I was wondering if these files are meant to remain or if removing them  
is not an issue ?


Peter
___

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


NSAppleScript error

2009-09-06 Thread Marco Cassinerio
I'm writing a System Service under 10.6 that launchs an apple script  
with NSAppleScript. When the apple script target app is not running,  
the script works, but when the app is already running, the  
executeAndReturnError: will return nil and an error in the dictionary.

Launching the same apple script with AppleScript Editor works well.

The same System Service under 10.5 works.

I think there's a bug on 10.6 or maybe i'm missing something.
___

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


Should we release a CGImage created from NSBitmapImageRep ?

2009-09-06 Thread DairyKnight
I'm working on a program which does lots of switching between CGImage,
CIIMage and NSImage. One thing I found out is
that it seems if you get a CGImage from NSBitmapImageRep:

CGImage *cgImg = [NSBitmapImageRep CGImage];

And later you release it, by:

CGImageRelease(cgImg);

It would cause a BAD_ACCESS error. The same thing happened when you have a
NSBitmapImageRep created from CGImage.

outputBitmapRep = [[[NSBitmapImageRep alloc] initWithCGImage:cgImg]
autorelease];
CGImageRelease(cgImg); > This causes BAD_ACCESS when the pool drains.

So is it true that those routines only get a reference to the image?

Thanks.

Regards,
DairyKnight
___

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: Should we release a CGImage created from NSBitmapImageRep ?

2009-09-06 Thread Dave Keck
>From the docs on -CGImage

"Returns an autoreleased CGImage object (an opaque type) from the
receiver’s current bitmap data."

... if you expect it to stick around, you need to retain it.
Otherwise, you needn't do anything: you shouldn't CGImageRelease() it,
because you don't own it.
___

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: Code Signing

2009-09-06 Thread Dave Keck
These files are certainly meant to be there. (If you happen to look in the
bundles of any number of the standard Mac apps, these two resources are
present.) Signing your code should happen at the very last stage of
development; deleting something from your bundle after it's been signed is
wrong.

You didn't say what arguments you're feeding codesign, but if you do a
simple test of your technique on a copy of Mail, using the following
command:

   codesign -d -r- /Applications/Mail\ copy.app

Before you delete resources: "designated => identifier "com.apple.mail" and
anchor apple"
And after: "/Applications/Mail copy.app: code or signature modified"

... which should speak for itself. :)
___

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: Composite Array Controller

2009-09-06 Thread Brent Gulanowski
On Sat, Sep 5, 2009 at 8:30 PM, Richard Somers
wrote:

> I have a simple Core Data model with two entities, A and B. Each entity has
> several attributes but no relationships.
>
> I need a single array controller which contains all A and B objects in the
> model.
>
> In Interface Builder this works.
>
> File's Owner (managedObjectContext)
> A Array Controller (bind to File's Owner)
>
> or
>
> File's Owner (managedObjectContext)
> B Array Controller (bind to File's Owner)
>
> But I can not figure out how to get this to work.
>
> File's Owner (managedObjectContext)
> Composite Array Controller (bind to File's Owner)
> A Array Controller (bind somehow to Composite Array Controller)
> B Array Controller (bind somehow to Composite Array Controller)
>
> Any help or insight would be appreciated.
>
> Richard
>
>
I'm understanding you correctly, you need to give up one or the other of
your conflicting design goals.

Based on the constraints you're implying, there is no way to do it. It
appears that you want the composite array controller to be configured to
support an entity, as opposed to a class. Of course that's not possible,
with the model as you've described it.

One solution would be to change your model to make the two entities inherit
from a common parent entity (internally, this means they are all in the same
SQLite table, if you use a SQLite store). The the composite AC can be
configured with the parent entity and the other ACs can be configured to
filter on entity.name = @"A"/@"B" or something.

Alternately, you have to synthesize your composite array in code as a
property of your File's Owner, and configure your composite AC to gets its
content array from there. The complexity there depends on whether you want
to support adding objects from your specialist ACs. It basically means
writing a glue layer.

-- 
Brent Gulanowski
___

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: Get error message about registered observers when Object receives dealloc message

2009-09-06 Thread Roland King


On 06-Sep-2009, at 2:22 PM, Quincey Morris wrote:





I haven't tried to evaluate the GC side of this under 10.6, but I  
can't imagine that the basic rule has (or could be changed) under  
GC: that cleanup relating to the relationships between objects needs  
to be done prior to entry to 'finalize' instead of during it.


The irony here is that although the dealloc pattern for removing  
observers is now reliable, anyone relying on it is going to have to  
throw it away as soon as they switch over to GC. (Or worse, that  
relying on it is going to tend to lock them out of GC because  
switching over is going to require an awkward redesign.)





You made me go read the Snow Leopard note about KVO under GC a few  
times, it's repeated at the end of the mail. The way I read that is  
that in fact doing it during the finalize method is ok and that lots  
of code ended up having finalize methods just for that purpose, so I  
would say the same method just discussed would still work, just  
implemented in finalize instead of in dealloc.


The note however says that in order to reduce the amount of finalizer  
methods written just to do KVO registration removal, the runtime now  
does it for you automatically in 10.6. So if you're observing  
something and are collected, the observations you registered are  
automatically removed. It doesn't say if it works the other way  
around, ie if A is observing B and B is collected, whether A's  
observation is removed; if it were not, when A is eventually collected  
I'm not sure what would happen as A's still outstanding observation on  
a non-existant object would be removed. Of course that shouldn't  
happen as A should have a reference to B anyway in that case in order  
to do KVO teardown the normal way so B should always persist at least  
as long as A does. Or even the built-in runtime ability to teardown  
your KVO for you must keep a reference to B in order to do that job  
so .. it's probably never an issue.


That's my read but I'm way behind the curve on GC in general and don't  
totally have the full mental picture I have of retain/release so I  
could be a little off base.



With the addition of support for Objective-C garbage collection to  
Foundation in Mac OS 10.5 one of the basic rules of key-value  
observing (KVO) remained, and still applied to garbage-collected  
applications: all invocations of KVO's - 
addObserver:forKeyPath:options:context: method must be balanced by  
invocations of -removeObserver:forKeyPath: or KVO will leak memory.  
(KVO logs when it senses failure to follow this rule but only when  
running non-garbage-collected.) The same rule applied to use of KVO's  
NSArray batched observer registration methods. This resulted in  
situations in which classes of observers had to have -finalize methods  
just to do observer deregistration when they otherwise would not have  
to. -finalize methods are supposed to be rarer than that. In Mac OS  
10.6, explicit removal of observers when they're finalized is now  
never necessary. KVO automatically removes observers as they're  
collected. Actually, in Mac OS 10.6 all invocations of -[NSObject 
(NSKeyValueObserverRegistration) removeObserver:forKeyPath:] and - 
[NSArray(NSKeyValueObserverRegistration)  
removeObserver:fromObjectsAtIndexes:forKeyPath:] do virtually nothing  
when either the receiver or the observer is being finalized (so it's  
not very bad for performance to leave them there in applications that  
still have to run on Mac OS 10.5).



___

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


Symbolic Links in Snow Leopard

2009-09-06 Thread Gerriet M. Denkmann

I am trying to replace the deprecated fileSystemAttributesAtPath:

1. Although Kyle Sluder stated:

The header file describes the correct behavior.
The current behavior is the only one that makes sense.


I am a bit troubled by the documentation stating that "This behavior  
may change in a future version of the Mac OS X.".


I would really very much like an official statement from Apple  
(although I fully agree with Kyle's statements).



But to get to the point:
If I need to replace this:
a = [ fm fileAttributesAtPath: path traverseLink: YES];
then an obvious replacement would be:
a = [ fm attributesOfItemAtPath: [path stringByStandardizingPath]  
error: NULL];


The problem is: neither stringByStandardizingPath (which is documented  
to remove symlinks) nor stringByResolvingSymlinksInPath does anything.
Well, they are documented to return self if an error occurs, but I  
cannot find any error messages in my console.log.


This is the directory used (/Volumes/เม่น/Users/gerriet/ 
Downloads):

-rw-r--r--@  1 gerriet  staff  36  6 Sep 19:30 abc
-rw-r--r--@  1 gerriet  staff   47908  6 Sep 19:37 abc alias
lrwxr-xr-x   1 gerriet  staff   3  4 Sep 21:31 abcSymlink -> abc
lrwxr-xr-x   1 gerriet  staff  49  6 Sep 19:45 absAbsSymlink -> / 
Volumes/เม่น/Users/gerriet/Downloads/abc


Here is my code:
NSLog(@"%s start \"%...@\"",__FUNCTION__, pat1);

NSString *pat2 = [ pat1 stringByTrimmingCharactersInSet:  
[ NSCharacterSet whitespaceAndNewlineCharacterSet ] ];

NSLog(@"%s removed white: \"%...@\"",__FUNCTION__, pat2);

NSString *pat3 = [ pat2 stringByStandardizingPath ];
NSLog(@"%s standardized \"%...@\"",__FUNCTION__, pat3);

And this is the result:
start "/Volumes/เม่น/Users/gerriet/Downloads/absAbsSymlink"
removed white: "/Volumes/เม่น/Users/gerriet/Downloads/ 
absAbsSymlink"
standardized "/Volumes/เม่น/Users/gerriet/Downloads/ 
absAbsSymlink" <-- BAD



What am I doing wrong?

Kind regards,

Gerriet.


___

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 stop NSImage from resizing while calling 'drawInRect' ?

2009-09-06 Thread DairyKnight
Hi all,
I'm trying to clip an NSImage, not so sure if this is the right thing to do,
but my solution is
to create a smaller NSImage, and draw the original at point(0,0) with the
user-defined clipping rectangle.

It sounds straight forward, but every time I get a messed up image. Then I
tried:

[myNSImg drawAtPoint:NSMakePoint(0, 0) withInRect:NSMakeRect(0, 0, 100, 100)
ops:copy alpha:1];


And found out NSImage is resizing the clipping rect to match the
destination. Is there anyway to turn this
off?

Thanks.

Regards,
DairyKnight
___

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: NSMenuItem font size of the keyboard shortcut text

2009-09-06 Thread Steven Degutis
It seems to me that it should stay the same size for a good reason
(consistency, etc) and that only universal access should be able to change
it (if anything). I've seen some apps use custom shortcuts but generally
it's always looked the same as the rest of them. In conclusion, I wouldn't
bother trying, were I you.
-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.org/


On Sun, Sep 6, 2009 at 1:23 AM, aaron smith  wrote:

> Does anyone know of a way to change the font size of the keyboard
> shortcut text in an NSMenuItem?
>
> I use NSAttributedString to set the text on a menu item in order to
> change the size. But the keyboard shortcut text stays the same size.
>
> 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/steven.degutis%40gmail.com
>
> This email sent to steven.degu...@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: Should we release a CGImage created from NSBitmapImageRep ?

2009-09-06 Thread Clark Cox
On Sun, Sep 6, 2009 at 4:13 AM, DairyKnight wrote:
> I'm working on a program which does lots of switching between CGImage,
> CIIMage and NSImage. One thing I found out is
> that it seems if you get a CGImage from NSBitmapImageRep:
>
> CGImage *cgImg = [NSBitmapImageRep CGImage];

Nothing about the method name suggests that it returns an object with
an outstanding reference (i.e. it doesn't have copy in it's name, it
doesn't start with copy or new, etc.). Absent any of these indicators
(described in 
)
you must assume that you do not hold an outstanding reference, and
therefore must not release it.

Once you commit, to memory, the 4 rules described at the above link,
all the information you need to determine the status of a returned
object are in the method name.


-- 
Clark S. Cox III
clarkc...@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: How to stop NSImage from resizing while calling 'drawInRect' ?

2009-09-06 Thread Dave Keck
I'm not clear on which method is giving you issues, -drawInRect: or
-drawAtPoint:? If it's -drawAtPoint: then it sounds like you may be
hitting a bug in the frameworks on Leopard:
http://developer.apple.com/mac/library/releasenotes/Cocoa/AppKit.html,
search for "NSImage: Breaking change to drawAtPoint:"

If the issue you're having is with -drawInRect:, then you need to make
sure your source and destination rectangles are the same size, to
prevent scaling.
___

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


NSArrayController design/usage question

2009-09-06 Thread Gregory Holden


NSArrayController seems great if you want to point it at repeating  
objects, but I can't find any clear way to add that one-off column  
that isn't part of the actual model objects (i.e. The "Now Playing"  
speaker in itunes, or a column with row numbers - independent of  
sorting).


I've tried a couple things myself, but feel the best thing to do is  
throw NSArrayController away in these situations, and stick to the  
DataSource.
Would this be an accurate assessment?  How have others dealt with this  
problem?


I did try setting up the bindings AND a datasource on the same table.   
It appears to work, but it also seems very dangerous as I'm obviously  
still getting requests for the bound data via  
tableView:objectValueForTableColumn.


Thanks
Greg
___

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: change in launch services binding behavior?

2009-09-06 Thread Ross Carter


On Sep 6, 2009, at 1:50 AM, Mark Munz wrote:


On Sat, Sep 5, 2009 at 5:46 PM, Matt Neuburg wrote:

Yeah, that's just FUD. It supports creator codes, but not in the  
same *way*
that Leopard did. And since this is a major undocumented change,  
which has
broken the way apps like BBEdit and Nisus (and I guess some Adobe  
apps)

work, I'm hoping to get some official word on what's going on. m.



Sorry Matt.. it's broken. And it's not just BBEdit, Nisus & Adobe,
it's every app that makes use of creator codes. It's a major problem
for any app dealing with generic types like .txt, .rtf, .html, .png,
.jpg or anything where the app the creates it is not the default app
to open the given filetype. Snow Leopard appears to ignore the creator
code and launch the default app, making creator codes useless.


AFAICT, Snow Leopard's behavior re creator codes has not been  
consistent. It originally consulted creator codes when a file has no  
extension, but starting with build 10A394 it ignores them always.  
(That's my observation, anyway.) I filed a bug report and got the  
response "Engineering has determined that this issue behaves as  
intended." So I don't think you can say that 10.6 is broken, it's just  
not yet documented. What's broken is the expectation of users who've  
had 20 years to get used to the old (superior, IMHO, but many  
disagree) behavior.

___

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


help book and appleicon meta tag

2009-09-06 Thread Rick C.
hello again,

i have revised my help book and the problem i'm having is with the AppleIcon 
meta tag and getting my icon to show in the help book.  i never had a problem 
with the previous version of my help book and now all the paths are identical 
i've made sure of it, yet no icon.  my guess is with some of the new html/css 
i've put into my help that something is conflicting with the AppleIcon tag.  
has anyone experienced something like this before?  and is there another way to 
setup the icon without using the new .help style books?  for the record my tag 
is like this:

http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


website like ebay.com's flash content crashing webKit like app?

2009-09-06 Thread jon

can someone else confirm this on 10.5,  and then 10.6 system..

if you create a simple cocoa Application  (not document based,  
although that will exhibit same problem)


then in Interface builder put in a webView,  and then a textfield into  
the Window of the simple application project,  use textfield as an  
address field for the webview.


include the Webkit framework in the project.

in IB,  hook the textfield to the Webview address bar field.

compile,   and type into the textfield of the running app:   "http://www.google.com/ 
" which works fine...


but if you change that to:   "http://www.ebay.com/";   then the  
application crashes after a few seconds of loading..


I believe that the flash content of ebay is crashing the app?can  
someone confirm?   is this a known bug?   something wrong with flash?   
my system?


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: NSAppleScript error

2009-09-06 Thread Kyle Sluder

You need to share you applescript and this error with us. :)

--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: NSArrayController design/usage question

2009-09-06 Thread Steven Degutis
Greg,
Generally these would be called "derived properties" from my experience, and
it's possible to add them on the classes that your Entities use, using KVO
methods. For instance, if you have 2 genuine properties on your "Person"
entity called firstName and lastName then you can create a fullName property
on your Person class, and when firstName or lastName change, call
-willChangeValueForKey: and -didChangeValueForKey: on "fullName" and then
have your -fullName method return a concatenation of the first and last
names. This doesn't work as well in your example of Now Playing, since it
has less to do with your model itself, but it works fairly well when you
have a property derived from other properties on your Entity.

-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.org/


On Sun, Sep 6, 2009 at 10:41 AM, Gregory Holden  wrote:

>
> NSArrayController seems great if you want to point it at repeating objects,
> but I can't find any clear way to add that one-off column that isn't part of
> the actual model objects (i.e. The "Now Playing" speaker in itunes, or a
> column with row numbers - independent of sorting).
>
> I've tried a couple things myself, but feel the best thing to do is throw
> NSArrayController away in these situations, and stick to the DataSource.
> Would this be an accurate assessment?  How have others dealt with this
> problem?
>
> I did try setting up the bindings AND a datasource on the same table.  It
> appears to work, but it also seems very dangerous as I'm obviously still
> getting requests for the bound data via tableView:objectValueForTableColumn.
>
> Thanks
> Greg
> ___
>
> 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/steven.degutis%40gmail.com
>
> This email sent to steven.degu...@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: website like ebay.com's flash content crashing webKit like app?

2009-09-06 Thread Kyle Sluder

On Sep 6, 2009, at 10:38 AM, jon  wrote:

I believe that the flash content of ebay is crashing the app?can  
someone confirm?   is this a known bug?   something wrong with  
flash?  my system?


Have you enabled developer crash logs and checked the backtrace? Have  
you updated to the latest version of Flash and Safari?


--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: website like ebay.com's flash content crashing webKit like app?

2009-09-06 Thread jon
Are you saying that a version of this type of app is not crashing the  
Application  when you do this type of thing?   are you on snow  
leopard?  this simple app makes it through without exiting?  (using  
ebay.com?)


nothing too interesting about the console log,  here it is:   more  
like an abrupt exit...   nothing was spit out in the debugger as a  
crash.


-
[Session started at 2009-09-06 12:02:51 -0600.]
Debugger() was called!

The Debugger has exited due to signal 2 (SIGINT).The Debugger has  
exited due to signal 2 (SIGINT).

-

i have 10.5 and the latest version of Safari for leopard.   I am  
checking to see what version of flash this app would be running  
into... (not sure how to check that yet)


Jon.


On Sep 6, 2009, at 11:59 AM, Kyle Sluder wrote:


On Sep 6, 2009, at 10:38 AM, jon  wrote:

I believe that the flash content of ebay is crashing the app? 
can someone confirm?   is this a known bug?   something wrong with  
flash?  my system?


Have you enabled developer crash logs and checked the backtrace?  
Have you updated to the latest version of Flash and Safari?


--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: website like ebay.com's flash content crashing webKit like app?

2009-09-06 Thread jon
after installing flash again from Adobe,  to make sure it was the  
latest..(didn't help).   I realized that maybe the app needs to know  
about a "flash" type of framework or something like that?


is that type of thing needed?  possible?

Jon.


On Sep 6, 2009, at 11:59 AM, Kyle Sluder wrote:

Have you enabled developer crash logs and checked the backtrace?  
Have you updated to the latest version of Flash and Safari?


___

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: website like ebay.com's flash content crashing webKit like app?

2009-09-06 Thread Kyle Sluder

On Sep 6, 2009, at 11:11 AM, jon  wrote:

Are you saying that a version of this type of app is not crashing  
the Application  when you do this type of thing?   are you on snow  
leopard?  this simple app makes it through without exiting?  (using  
ebay.com?)


I have not tried it yet. It does not make sense for everyone else to  
go out and set things up if you already have it done and provide a  
backtrace.




nothing too interesting about the console log,  here it is:   more  
like an abrupt exit...   nothing was spit out in the debugger as a  
crash.


Backtraces come from CrashReporter. The console will not provide you  
the information you need.


--- 
--

[Session started at 2009-09-06 12:02:51 -0600.]
Debugger() was called!



This is normal. Flash calls Debugger for no good reason. If you have  
"Break on Debugger()" enabled, then your program will pause in gdb.



The Debugger has exited due to signal 2 (SIGINT).The Debugger has  
exited due to signal 2 (SIGINT).


This is not normal. Unless you wound up in the debugger and quit it  
yourself.


i have 10.5 and the  
latest version of Safari for leopard.   I am checking to see what  
version of flash this app would be running into... (not sure how to  
check that yet)


Hopefully you plan on upgrading to Snow Leopard soon. 64-bit Webkit  
gives you process isolation for plugins like Flash.


--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: Get error message about registered observers when Object receives dealloc message

2009-09-06 Thread Quincey Morris

On Sep 6, 2009, at 05:46, Roland King wrote:

The note however says that in order to reduce the amount of  
finalizer methods written just to do KVO registration removal, the  
runtime now does it for you automatically in 10.6. So if you're  
observing something and are collected, the observations you  
registered are automatically removed. It doesn't say if it works the  
other way around, ie if A is observing B and B is collected, whether  
A's observation is removed; if it were not, when A is eventually  
collected I'm not sure what would happen as A's still outstanding  
observation on a non-existant object would be removed. Of course  
that shouldn't happen as A should have a reference to B anyway in  
that case in order to do KVO teardown the normal way so B should  
always persist at least as long as A does. Or even the built-in  
runtime ability to teardown your KVO for you must keep a reference  
to B in order to do that job so .. it's probably never an issue.


[...]

["]With the addition of support for Objective-C garbage collection  
to Foundation in Mac OS 10.5 one of the basic rules of key-value  
observing (KVO) remained, and still applied to garbage-collected  
applications: all invocations of KVO's - 
addObserver:forKeyPath:options:context: method must be balanced by  
invocations of -removeObserver:forKeyPath: or KVO will leak memory.  
(KVO logs when it senses failure to follow this rule but only when  
running non-garbage-collected.) The same rule applied to use of  
KVO's NSArray batched observer registration methods. This resulted  
in situations in which classes of observers had to have -finalize  
methods just to do observer deregistration when they otherwise would  
not have to. -finalize methods are supposed to be rarer than that.  
In Mac OS 10.6, explicit removal of observers when they're finalized  
is now never necessary. KVO automatically removes observers as  
they're collected. Actually, in Mac OS 10.6 all invocations of - 
[NSObject(NSKeyValueObserverRegistration)  
removeObserver:forKeyPath:] and -[NSArray 
(NSKeyValueObserverRegistration)  
removeObserver:fromObjectsAtIndexes:forKeyPath:] do virtually  
nothing when either the receiver or the observer is being finalized  
(so it's not very bad for performance to leave them there in  
applications that still have to run on Mac OS 10.5).["]


I'm trying to be careful here not to say anything stupid or just plain  
wrong, but ...


There are two separate issues in the GC case. One deals with the need  
to provide a mechanism for observers to remove their observations  
before they're destroyed. (Notice that the above quote says  
"observers", not "observed objects" or just "objects".) If it's  
illegal for an observer to reach its moment of destruction with a  
observation still in place, then (this release note seems to say) you  
were previously forced (oftener than is desirable) to provide a  
'finalize' method as a safety clean-up choke point. So now that clean- 
up behavior comes for free.


This says nothing about the need to to remove observations of an  
*observed* object that's being collected. I suspect that in 10.6, if  
both the observed and observer objects are being collected in the same  
cycle, then removing the observers happens automatically first (vid.  
the last quoted sentence). I suspect that in 10.5 and 10.6, if the  
observed object is collected, but the observers are not being  
collected, you will get the error message about an object being  
finalized with observations still in place.


Note 1: It seemed to me that KVO observers *were* being removed in  
Leopard under GC. At least I thought I had seen situations where there  
was no explicit invocation of 'removeObserver:' that didn't complain  
when the relevant observer objects were collected. Maybe that happened  
sometimes but not always. Maybe I was just fooling myself.


Note 2: Compare this with NSNotificationCenter-style observations  
under GC. Those have always been removed automatically. (And what a  
heady sense of freedom it is, not having to write 'removeObserver:'  
invocations. :) )


The second issue is the larger one that it's unsafe in 'finalize' to  
message other objects that might themselves be in the process of  
collection. That is, specifically, if you wrote a 'finalize' in an  
observer object class in order to remove its observations, you might  
not be able to send the 'removeObserver:' message to the observed  
object if it was being collected too. Catch-22.


It's this *second* issue which motivated my comment about needing to  
initiate clean-up before rather than during 'finalize'. The first  
issue is really about the circumstances when you can avoid writing any  
clean-up code at all.




___

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.

Translating selection area in imageView

2009-09-06 Thread Development
I am using the croppingImageView example to allow me to place a  
picture of the desktop in to a window (about 400X300). I then want to  
be able to select an area of that picture and translate it to pick up  
that part of the desktop however what I get is completely  
unpredictable. It almost looks like the selection is off by the height  
of the selection but attempting to add the height of the selection to  
the origin.y seems to make no change what so ever. Below is the code  
I'm using to translate the selection.


double percent = [movieWidth doubleValue] / [theScreen  
frame].size.width;


selected.origin.x = selection.origin.x *([theScreen frame].size.width/ 
([theScreen frame].size.width *percent));


selected.origin.y = selection.origin.y / percent;

selected.size.height = selection.size.height / percent;
selected.size.width = selection.size.width / percent;

movieFrame.size.width = [movieWidth doubleValue];
movieFrame.size.height = [theScreen frame].size.height * percent;
___

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: NSArrayController design/usage question

2009-09-06 Thread Quincey Morris

On Sep 6, 2009, at 08:41, Gregory Holden wrote:

NSArrayController seems great if you want to point it at repeating  
objects, but I can't find any clear way to add that one-off column  
that isn't part of the actual model objects (i.e. The "Now Playing"  
speaker in itunes, or a column with row numbers - independent of  
sorting).


If you want to use a binding, then the data model** must have a  
property to bind to. You have 3 choices for that:


1. A derived property (a property whose value is produced on the fly,  
which isn't backed by its own instance variable in your data model).


2. A transient property (a property backed by its own instance  
variable which isn't saved when the data model is saved, and which is  
reinitialized when the data model is loaded).


3. A persistent property (i.e. a normal property).

#3 may seem like an odd choice, but if calculating the property value  
is expensive or awkward, it may be cheaper overall just to "waste" the  
disk space involved in making the property persistent.


I did try setting up the bindings AND a datasource on the same  
table.  It appears to work, but it also seems very dangerous as I'm  
obviously still getting requests for the bound data via  
tableView:objectValueForTableColumn.


It may feel "dangerous" but for me it's always worked just fine to  
bind some columns and to use a data source for others. I've never seen  
any documentation saying that the technique is unsupported. So go for  
it, I'd say.



**I should have said "a data model" instead of "the data model".  
Depending on what the property represents, you may choose to add it to  
(say) the window controller instead of your actual data model. If you  
follow that approach, then you'll likely also need to have the window  
controller observe the underlying data in the data model. That's more  
work, but consider the case you where might want to have row numbers  
in table views of the same data in 2 different windows, where the  
tables might be sorted differently. Obviously in that case you can't  
supply the row numbers from the underlying data model.



___

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


NSDivideRect and 64-bit

2009-09-06 Thread Mitchell Livingston

Hey,

I want to use NSDivideRect in my app, but the documentation for  
NSRectEdge (one of the parameter types) says "Not available to 64-bit  
applications.". Can I not use this function anymore? Is there an  
appropriate replacement for the function?


Thanks,
Mitch
___

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: NSString width

2009-09-06 Thread Jens Alfke


On Sep 6, 2009, at 2:03 AM, Dave Keck wrote:


I've noticed this too. If you need the absolute precise pixel-size of
some text, then the only way I know of (that works with all different
styles of text) is manually drawing the text into some temporary
context, and analyzing its pixels.


-[NSString boundingRectWithSize:...] might do this, especially with  
the NSStringDrawingUsesDeviceMetrics flag ("Uses image glyph bounds  
instead of typographic bounds").


Failing that, you ought to be able to use NSLayoutManager to compute  
the bounding box of all the glyphs, but I don't know how.


—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: Symbolic Links in Snow Leopard

2009-09-06 Thread Jens Alfke


On Sep 6, 2009, at 6:15 AM, Gerriet M. Denkmann wrote:

The problem is: neither stringByStandardizingPath (which is  
documented to remove symlinks) nor stringByResolvingSymlinksInPath  
does anything.


I also ran into this problem with -stringByStandardizingPath, right  
after upgrading to 10.6. It seems to be a regression.
However, -stringByResolvingSymlinksInPath is working for me. Are you  
sure it fails to resolve symlinks? The code sample you posted didn't  
use it.


—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: help book and appleicon meta tag

2009-09-06 Thread Matt Neuburg
On Sun, 6 Sep 2009 09:10:26 -0700 (PDT), "Rick C."  said:
>hello again,
>
>i have revised my help book and the problem i'm having is with the AppleIcon
meta tag and getting my icon to show in the help book.  i never had a problem
with the previous version of my help book and now all the paths are identical
i've made sure of it, yet no icon.  my guess is with some of the new html/css
i've put into my help that something is conflicting with the AppleIcon tag.  has
anyone experienced something like this before?  and is there another way to
setup the icon without using the new .help style books?  for the record my tag
is like this:
>
>
>the help displays fine it's just the icon.  thanks for the help,

What if you change the URL to "../mypic.png"?

m.

PS This is really the wrong list for this stuff, you know.

-- 
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



___

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: NSDivideRect and 64-bit

2009-09-06 Thread Jens Alfke


On Sep 6, 2009, at 12:01 PM, Mitchell Livingston wrote:

I want to use NSDivideRect in my app, but the documentation for  
NSRectEdge (one of the parameter types) says "Not available to 64- 
bit applications.". Can I not use this function anymore? Is there an  
appropriate replacement for the function?


Where does it say that? In both the 10.5 and 10.6 NSGeometry.h,  
NSDivideRect and NSRectEdge are available.


—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: website like ebay.com's flash content crashing webKit like app?

2009-09-06 Thread jon


On Sep 6, 2009, at 1:11 PM, Jens Alfke wrote:

Run your app with 'breakpoints enabled', to make sure the gdb  
debugger loads. Then when it crashes you'll be in the debugger and  
can look at the stack and such. (Type "bt" into the gdb command area  
to get a textual bactkrace you can easily copy and paste into email.)




here is what it dumped out...

Jon.

[Session started at 2009-09-06 13:14:14 -0600.]
GNU gdb 6.3.50-20050815 (Apple version gdb-967) (Tue Jul 14 02:11:58  
UTC 2009)

Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and  
you are
welcome to change it and/or distribute copies of it under certain  
conditions.

Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for  
details.
This GDB was configured as "i386-apple-darwin".sharedlibrary apply- 
load-rules all

Attaching to process 4216.
=shlibs-removed,shlib- 
info=[num="101",name="JavaPluginCocoa",kind="B",dyld- 
addr="0x16a0",reason="dyld",requested-state="E",state="E",path="/ 
System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Resources/ 
JavaPluginCocoa.bundle/Contents/MacOS/JavaPluginCocoa",description="/ 
System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Resources/ 
JavaPluginCocoa.bundle/Contents/MacOS/ 
JavaPluginCocoa",loaded_addr="0x16a0",slide="0x16a0",prefix=""]
=shlibs-removed,shlib- 
info=[num="102",name="JavaNativeFoundation",kind="F",dyld- 
addr="0x16a14000",reason="dyld",requested-state="Y",state="Y",path="/ 
System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/ 
JavaNativeFoundation.framework/Versions/A/ 
JavaNativeFoundation",description="/System/Library/Frameworks/ 
JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework/ 
Versions/A/ 
JavaNativeFoundation 
",loaded_addr="0x16a14000",slide="0x16a14000",prefix=""]

Debugger() was called!
(gdb) bt
#0  0x940cb402 in __pthread_kill ()
#1  0x940cb24f in pthread_kill ()
#2  0x93d59190 in Debugger ()
#3  0x17ad6e05 in dyld_stub_syslog ()
#4  0x17ad70bf in NP_Initialize ()
#5  0x95d365ef in -[WebNetscapePluginPackage _tryLoad] ()
#6  0x95d36217 in -[WebNetscapePluginPackage load] ()
#7  0x95d813cf in -[WebNetscapePluginDocumentView  
initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element 
:] ()

#8  0x95d6ecd9 in WebFrameLoaderClient::createPlugin ()
#9  0x90866554 in WebCore::FrameLoader::loadPlugin ()
#10 0x90866071 in WebCore::FrameLoader::requestObject ()
#11 0x907b46ca in WebCore::RenderPartObject::updateWidget ()
#12 0x907123b6 in WebCore::FrameView::updateWidgets ()
#13 0x90712081 in WebCore::FrameView::performPostLayoutTasks ()
#14 0x906f1eed in WebCore::FrameView::layout ()
#15 0x906f190b in WebCore::Timer::fired ()
#16 0x906d8bf2 in WebCore::ThreadTimers::fireTimers ()
#17 0x906d8612 in WebCore::ThreadTimers::sharedTimerFiredInternal ()
#18 0x906d8596 in WebCore::ThreadTimers::sharedTimerFired ()
#19 0x90d5dc64 in WebCore::timerFired ()
#20 0x900f48f5 in CFRunLoopRunSpecific ()
#21 0x900f4aa8 in CFRunLoopRunInMode ()
#22 0x916fa2ac in RunCurrentEventLoopInMode ()
#23 0x916fa0c5 in ReceiveNextEventCommon ()
#24 0x916f9f39 in BlockUntilNextEventMatchingListInMode ()
#25 0x954836d5 in _DPSNextEvent ()
#26 0x95482f88 in -[NSApplication  
nextEventMatchingMask:untilDate:inMode:dequeue:] ()

#27 0x9547bf9f in -[NSApplication run] ()
#28 0x954491d8 in NSApplicationMain ()
#29 0x1ffc in main (argc=1, argv=0xb730) at /Users/jonkai/ 
Desktop/junk2 11-43-39/main.m:14
(gdb) 
___


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: website like ebay.com's flash content crashing webKit like app?

2009-09-06 Thread Jens Alfke


On Sep 6, 2009, at 12:18 PM, jon wrote:


#0  0x940cb402 in __pthread_kill ()
#1  0x940cb24f in pthread_kill ()
#2  0x93d59190 in Debugger ()
#3  0x17ad6e05 in dyld_stub_syslog ()
#4  0x17ad70bf in NP_Initialize ()
#5  0x95d365ef in -[WebNetscapePluginPackage _tryLoad] ()


Flash is calling Debugger(), an old function for breaking into the  
debugger. It does this a lot, for some reason. Did you make sure to  
uncheck "Stop On Debugger()" in Xcode's Run menu?


—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: NSDivideRect and 64-bit

2009-09-06 Thread Mitchell Livingston
Under NSRectEdge in the documentation.

For example:

"NSMinXEdge
Specifies the left edge of the input rectangle.

The input rectangle is divided vertically, and the leftmost rectangle with the 
width of amount is placed in slice.

Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in NSGeometry.h."

Cheers,
Mitch

On Sunday, September 06, 2009, at 03:14PM, "Jens Alfke"  
wrote:
>
>On Sep 6, 2009, at 12:01 PM, Mitchell Livingston wrote:
>
>> I want to use NSDivideRect in my app, but the documentation for  
>> NSRectEdge (one of the parameter types) says "Not available to 64- 
>> bit applications.". Can I not use this function anymore? Is there an  
>> appropriate replacement for the function?
>
>Where does it say that? In both the 10.5 and 10.6 NSGeometry.h,  
>NSDivideRect and NSRectEdge are available.
>
>—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: website like ebay.com's flash content crashing webKit like app?

2009-09-06 Thread jon

I just unchecked it,  now it runs through without the crash.

so there is something in flash that is checked that shouldn't be  
checked?or just sort of normal  and i always have to uncheck that  
when ever using the webkit?


Jon.



On Sep 6, 2009, at 1:22 PM, Jens Alfke wrote:

Flash is calling Debugger(), an old function for breaking into the  
debugger. It does this a lot, for some reason. Did you make sure to  
uncheck "Stop On Debugger()" in Xcode's Run menu?


—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: NSAppleScript error

2009-09-06 Thread Marco Cassinerio



You need to share you applescript and this error with us. :)

--Kyle Sluder


I tried a lot of AS and the error is related to the AS request.
For example, this to get the current playing track in iTunes:

tell application "iTunes"
set curr_path to get location of current track
return POSIX path of curr_path
end tell

The error:

NSAppleScriptErrorAppName = iTunes;
NSAppleScriptErrorBriefMessage = "Can\U2019t get location of  
current track.";
NSAppleScriptErrorMessage = "iTunes got an error: Can\U2019t get  
location of current track.";

NSAppleScriptErrorNumber = -1728;
NSAppleScriptErrorRange = NSRange: {47, 8};

I've found a (ugly) solution to overcome the problem. I've build a  
command line tool that will run the apple script as it's passed by the  
argv. The Service has just to launch the command line tool as a task  
and pass the script text as first argument.


___

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: NSDivideRect and 64-bit

2009-09-06 Thread Jens Alfke


On Sep 6, 2009, at 12:28 PM, Mitchell Livingston wrote:


Under NSRectEdge in the documentation.
For example:
"NSMinXEdge
Specifies the left edge of the input rectangle.
The input rectangle is divided vertically, and the leftmost  
rectangle with the width of amount is placed in slice.

Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.


That has to be a bug in the docs, since NSDivideRect itself isn't  
marked as unavailable, and it really doesn't make sense for an integer  
constant to be 'unavailable'.


In cases of a disagreement between the docs and the headers, I tend to  
trust the headers :)


—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: NSDivideRect and 64-bit

2009-09-06 Thread James W. Walker


On Sep 6, 2009, at 12:28 PM, Mitchell Livingston wrote:


Under NSRectEdge in the documentation.

For example:

"NSMinXEdge
Specifies the left edge of the input rectangle.

The input rectangle is divided vertically, and the leftmost  
rectangle with the width of amount is placed in slice.


Available in Mac OS X v10.0 and later.

Not available to 64-bit applications.

Declared in NSGeometry.h."




True.   If you look in NSGeometry.h, you find that the constants are  
still there, but they are #defines instead of enumerated constants in  
64 bits.



___

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: website like ebay.com's flash content crashing webKit like app?

2009-09-06 Thread Jens Alfke


On Sep 6, 2009, at 12:30 PM, jon wrote:

so there is something in flash that is checked that shouldn't be  
checked?or just sort of normal  and i always have to uncheck  
that when ever using the webkit?


If you're debugging an app that uses WebKit, and it loads a page that  
uses the Flash plugin, you need to uncheck that Xcode setting to avoid  
falling into the debugger all the time in Flash code. (Or, you can  
just press Continue and keep going. The app didn't crash, it's just  
like a breakpoint.)


(There are similar issues with other system code — like, if you set  
breakpoints on C++ 'throw' calls, and the app uses the Security  
framework, you'll hit lots of exceptions that the security/crypto code  
throws and then catches internally. This has annoyed me for a long  
time.)


—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: website like ebay.com's flash content crashing webKit like app?

2009-09-06 Thread jon
thanks for the replys,  that helped alot,   (now i've got to figure  
out why the sample code that comes with xcode "MiniBrowser"  does not  
load flash at all  (if garbage collection is turned on,  no other  
changes)...


it must be something related...   i've already tried unchecking for  
that project,   but it still doesn't load the flash content,
(miniBrowser also never stopped at a "break point" kind of thing  
either though)


but you've gotten me closer i think.

thanks,
Jon.


On Sep 6, 2009, at 1:39 PM, Jens Alfke wrote:

you'll hit lots of exceptions that the security/crypto code throws  
and then catches internally. This has annoyed me for a long time.)


___

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: NSDivideRect and 64-bit

2009-09-06 Thread Kyle Sluder

On Sep 6, 2009, at 12:37 PM, "James W. Walker"  wrote:

True.   If you look in NSGeometry.h, you find that the constants are  
still there, but they are #defines instead of enumerated constants  
in 64 bits.


Definitely file a bug about that. They have special tools to deal with  
all the enums-that-are-no-longer on 64bit, they should be able to  
handle this as well.


And after filing the bug post it here. I know there are documentation  
authors who read the list. ;-)


--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


completion handlers?

2009-09-06 Thread Todd Heberlein
It seems that the way I previously used an NSSavePanel has been  
deprecated. :(


The new approach seems to use an approach (a function definition  
embedded in the message) that I am not familiar with (I hear ghosts of  
lambda notation whispering into my ear). I assume this is an Objective  
C 2.0 feature, but I am not even sure of the name for this approach.


I would like to look up information on this approach, but I don't even  
know a name for it in order to google it. Could someone give me a  
pointer for pages or keywords?


Thanks,

Todd


[savePanel beginSheetModalForWindow:window completionHandler:^ 
(NSInteger result) {

if (result) {
NSLog(@"Save as: %@", savePanel.URL);
}
}];
___

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: completion handlers?

2009-09-06 Thread Kyle Sluder
On Sep 6, 2009, at 12:56 PM, Todd Heberlein   
wrote:


The new approach seems to use an approach (a function definition  
embedded in the message) that I am not familiar with (I hear ghosts  
of lambda notation whispering into my ear). I assume this is an  
Objective C 2.0 feature, but I am not even sure of the name for this  
approach.


It's called a block. Kinda unfortunate that the term also has another  
computer science meaning, but them's the breaks. It's a new Snow  
Leopard feature.


Best part is they work in C and C++ too! :)

--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: NSString width

2009-09-06 Thread Dave Keck
> -[NSString boundingRectWithSize:...] might do this, especially with the
> NSStringDrawingUsesDeviceMetrics flag ("Uses image glyph bounds instead of
> typographic bounds").

Indeed. When I tried that method in the past, I got it working
half-way with italicized text (the width was correct, but the height
wasn't.) I ended up having to do more math on top of
-boundingRectWithSize: based on the font's descender. Eventually it
worked for my specific case, but I doubt my technique works in every
scenario.

I'll keep NSLayoutManager in mind for the future...
___

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: completion handlers?

2009-09-06 Thread Steven Degutis
As mentioned before, the new feature is called Blocks, and is available only
for Snow Leopard for the moment (probably being ported to the iPhone too).
I've written an introductory guide on what they are and how they work,
specifically intended for people who have experience with Objective-C and/or
Cocoa, but never heard of Blocks before. Here's the link:

http://www.degutis.org/dev/2009/08/30/beginners-guide-to-blocks-in-cocoa/

In a nutshell, Blocks are very simple, and greatly improve your code's
readability and maintainability. (And yes, they work for C as well as ObjC!)

-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.org/


On Sun, Sep 6, 2009 at 2:56 PM, Todd Heberlein wrote:

> It seems that the way I previously used an NSSavePanel has been deprecated.
> :(
>
> The new approach seems to use an approach (a function definition embedded
> in the message) that I am not familiar with (I hear ghosts of lambda
> notation whispering into my ear). I assume this is an Objective C 2.0
> feature, but I am not even sure of the name for this approach.
>
> I would like to look up information on this approach, but I don't even know
> a name for it in order to google it. Could someone give me a pointer for
> pages or keywords?
>
> Thanks,
>
> Todd
>
>
> [savePanel beginSheetModalForWindow:window completionHandler:^(NSInteger
> result) {
>if (result) {
>NSLog(@"Save as: %@", savePanel.URL);
>}
>}];
> ___
>
> 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/steven.degutis%40gmail.com
>
> This email sent to steven.degu...@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: NSAppleScript error

2009-09-06 Thread has

Marco Cassinerio wrote:


I tried a lot of AS and the error is related to the AS request.
For example, this to get the current playing track in iTunes:

tell application "iTunes"
set curr_path to get location of current track
return POSIX path of curr_path
end tell

The error:

NSAppleScriptErrorAppName = iTunes;
NSAppleScriptErrorBriefMessage = "Can\U2019t get location of
current track.";
NSAppleScriptErrorMessage = "iTunes got an error: Can\U2019t get
location of current track.";
NSAppleScriptErrorNumber = -1728;



That suggests the iTunes player is currently stopped, in which case a  
'current track' reference usually isn't available. If you need to, you  
can find out iTunes' current state by querying the application's  
'player state' property. Or you can trap the -1728 error raised if  
that's easier using a 'try' block.


FWIW, it's always a good idea to double-check AppleScript-related  
problems in the [Apple]Script Editor before posting for help. If the  
issue is NSAppleScript itself, post here or to the applescript- 
implementors list for help. If it's a general AppleScript query, you  
will have most luck posting it to applescript-users as that's where  
most of the AppleScripting experts reside.


http://lists.apple.com/mailman/listinfo/applescript-implementors
http://lists.apple.com/mailman/listinfo/applescript-users

HTH

has

--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net

___

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: Symbolic Links in Snow Leopard

2009-09-06 Thread Greg Guerin

Gerriet M. Denkmann wrote:

This is the directory used (/Volumes/เม่น/Users/gerriet/  
Downloads):

-rw-r--r--@ 1 gerriet staff 36 6 Sep 19:30 abc
-rw-r--r--@ 1 gerriet staff 47908 6 Sep 19:37 abc alias
lrwxr-xr-x 1 gerriet staff 3 4 Sep 21:31 abcSymlink -> abc
lrwxr-xr-x 1 gerriet staff 49 6 Sep 19:45 absAbsSymlink -> /  
Volumes/เม่น/Users/gerriet/Downloads/abc


Here is my code:
NSLog(@"%s start \"%...@\"",__FUNCTION__, pat1);

NSString *pat2 = [ pat1 stringByTrimmingCharactersInSet:  
[ NSCharacterSet whitespaceAndNewlineCharacterSet ] ];

NSLog(@"%s removed white: \"%...@\"",__FUNCTION__, pat2);

NSString *pat3 = [ pat2 stringByStandardizingPath ];
NSLog(@"%s standardized \"%...@\"",__FUNCTION__, pat3);

And this is the result:
start "/Volumes/เม่น/Users/gerriet/Downloads/absAbsSymlink"
removed white: "/Volumes/เม่น/Users/gerriet/Downloads/  
absAbsSymlink"
standardized "/Volumes/เม่น/Users/gerriet/Downloads/  
absAbsSymlink" <-- BAD



Try using a pathname that contains only Latin alphabet characters  
(for reference, the original chars of the volume-name are Thai: \u0e40 
\u0e21\u0e48\u0e19).  If necessary, create and mount a disk-image in  
order to get only Latin chars.


Also, please show the code that assigns a value to pat1.  How that  
pathname is determined may have a bearing on the problem.


Finally, I'm a little puzzled why stringByTrimmingCharactersInSet:  
should be needed.  Maybe the problem lies with the pathname itself,  
and trimming its whitespace turns it into a pathname that doesn't  
exist.  For visibility, you might want to display every char of the  
original pat1 that's outside the range 0x21-0x7E as a \U value.   
There may also be an encoding you could use, non-lossy ASCII.


You should be able to do a file-system function on the standardized  
pathname pat3 and have it tell you it's a symlink (e.g. stat()).  If  
there's no file-system object for the pathname, then that tells you  
something.


  -- GG

___

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: NSAppleScript error

2009-09-06 Thread Marco Cassinerio


On Sep 6, 2009, at 22:25, has wrote:


Marco Cassinerio wrote:


I tried a lot of AS and the error is related to the AS request.
For example, this to get the current playing track in iTunes:

tell application "iTunes"
set curr_path to get location of current track
return POSIX path of curr_path
end tell

The error:

   NSAppleScriptErrorAppName = iTunes;
   NSAppleScriptErrorBriefMessage = "Can\U2019t get location of
current track.";
   NSAppleScriptErrorMessage = "iTunes got an error: Can\U2019t get
location of current track.";
   NSAppleScriptErrorNumber = -1728;



That suggests the iTunes player is currently stopped, in which case  
a 'current track' reference usually isn't available. If you need to,  
you can find out iTunes' current state by querying the application's  
'player state' property. Or you can trap the -1728 error raised if  
that's easier using a 'try' block.


FWIW, it's always a good idea to double-check AppleScript-related  
problems in the [Apple]Script Editor before posting for help. If the  
issue is NSAppleScript itself, post here or to the applescript- 
implementors list for help. If it's a general AppleScript query, you  
will have most luck posting it to applescript-users as that's where  
most of the AppleScripting experts reside.


http://lists.apple.com/mailman/listinfo/applescript-implementors
http://lists.apple.com/mailman/listinfo/applescript-users

HTH

has


As i said in the first message, i checked the AS with AppleScript  
Editor and also by executing the script with an ad hoc command tool  
app that uses NSAppleScript. They both work!
iTunes was playing a track and the script works both on AppleScript  
Editor and command line app. It doesn't work in the Service. I haven't  
mentioned i'm writing a .service add-on and not a service provided by  
an application.


___

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: completion handlers?

2009-09-06 Thread Todd Heberlein

Thanks for the information.

OK, now a scoping rule question, in the sample code below, does "self"  
refer to my object (i.e., the "self" when the block is declared) or  
the NSSavePanel (i.e., the "self" when the code is executed)?


Todd

[savePanel beginSheetModalForWindow:window completionHandler:^ 
(NSInteger result) {

   if (result) {
   [self someMethod];   //   <-- what "self" should be used?
   }
   }];


___

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


Mutation in Enumeration -- Breakpoint?

2009-09-06 Thread Seth Willits


I'm updating some rally old code, and I'm getting a bunch of:

Collection  was mutated while being enumerated.

I'm wondering if there's a handy method I can break on to drop right  
into the location of these errors?




--
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: Mutation in Enumeration -- Breakpoint?

2009-09-06 Thread Seth Willits

On Sep 6, 2009, at 2:04 PM, Seth Willits wrote:


I'm updating some rally old code, and I'm getting a bunch of:

Collection  was mutated while being enumerated.

I'm wondering if there's a handy method I can break on to drop right  
into the location of these errors?


Ok, nevermind… Xcode just decided to not stop on any breakpoints (I  
added one in objc_exception_throw) unless I manually added one  
somewhere in my code. It really is throwing one as I expected it to,  
so all is well.



Sorry for the noise.

--
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: NSMenuItem font size of the keyboard shortcut text

2009-09-06 Thread aaron smith
that stinks. because I've noticed an alignment problem in snow
leopard. If the menu font size is smaller, and the key shortcut size
is bigger. They don't line up middle aligned. The smaller text is a
couple pixels off. Which looks bad. In leopard the alignment was ok.



On Sun, Sep 6, 2009 at 7:59 AM, Steven Degutis wrote:
> It seems to me that it should stay the same size for a good reason
> (consistency, etc) and that only universal access should be able to change
> it (if anything). I've seen some apps use custom shortcuts but generally
> it's always looked the same as the rest of them. In conclusion, I wouldn't
> bother trying, were I you.
> --
> Steven Degutis
> http://www.thoughtfultree.com/
> http://www.degutis.org/
>
> On Sun, Sep 6, 2009 at 1:23 AM, aaron smith
>  wrote:
>>
>> Does anyone know of a way to change the font size of the keyboard
>> shortcut text in an NSMenuItem?
>>
>> I use NSAttributedString to set the text on a menu item in order to
>> change the size. But the keyboard shortcut text stays the same size.
>>
>> 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/steven.degutis%40gmail.com
>>
>> This email sent to steven.degu...@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: NSMenuItem font size of the keyboard shortcut text

2009-09-06 Thread Eric Schlegel


On Sep 6, 2009, at 2:18 PM, aaron smith wrote:


that stinks. because I've noticed an alignment problem in snow
leopard. If the menu font size is smaller, and the key shortcut size
is bigger. They don't line up middle aligned. The smaller text is a
couple pixels off. Which looks bad. In leopard the alignment was ok.


Please file a bug about this issue, thanks. Sounds like a regression  
in SnowLeopard.


-eric

___

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: Symbolic Links in Snow Leopard

2009-09-06 Thread Jens Alfke


On Sep 6, 2009, at 1:26 PM, Greg Guerin wrote:

Try using a pathname that contains only Latin alphabet characters  
(for reference, the original chars of the volume-name are Thai:  
\u0e40\u0e21\u0e48\u0e19).  If necessary, create and mount a disk- 
image in order to get only Latin chars.


I don't think it has anything to do with the characters in the filename:

NSLog(@"path = %@", [@"/etc" stringByStandardizingPath]);
results in
path = /etc
when the result ought to be "/private/etc".

The same thing happens with a custom symlink I created, like "/Code",  
which links to "/Volumes/snoog/Code":


NSLog(@"path = %@", [@"/Code/Murky" stringByStandardizingPath]);
results in
path = /Code/Murky

—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: completion handlers?

2009-09-06 Thread Jens Alfke


On Sep 6, 2009, at 2:02 PM, Todd Heberlein wrote:

OK, now a scoping rule question, in the sample code below, does  
"self" refer to my object (i.e., the "self" when the block is  
declared) or the NSSavePanel (i.e., the "self" when the code is  
executed)?


Your object. Even though the save panel is calling that block, that  
has no effect on what 'self' is (just as in a normal method call.)
Blocks keep track of the values of variables declared in the function/ 
method they're in, and keep those values when they're run; that's part  
of what makes them so powerful.


—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: Code Signing

2009-09-06 Thread Charles Srstka

On Sep 6, 2009, at 6:00 AM, Peter Hudson wrote:

I notice that when I sign code ( the whole app )  I  land up with 2  
additional items in my /Contents directory in the app bundle.
These items are a folder called _CodeSignature  and an alias called  
CodeResources.


If I delete these two items, the code still identifies itself as  
signed ( when I attempt to run codesign on it again ).

Also, the app still runs.

I was wondering if these files are meant to remain or if removing  
them is not an issue ?


On my machine, codesign identifies the signature as invalid if those  
files are deleted. As it should, since those files spell out what the  
structure of the .app bundle is supposed to be.


Why are you wanting to go around deleting files from the insides of  
app bundles? In general, stuff inside an app's bundle should be left  
alone.


Charles
___

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: completion handlers?

2009-09-06 Thread Jens Alfke


On Sep 6, 2009, at 12:56 PM, Todd Heberlein wrote:

It seems that the way I previously used an NSSavePanel has been  
deprecated. :(


By the way, it's only deprecated if you want to write 10.6-only apps.  
If you want to remain 10.5-compatible, you can't use any of the cool  
block-based APIs, so it's fine to keep using the old ones.


That's why it's not formally deprecated yet ... though it probably  
will become so when 10.7 ships.


—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: Symbolic Links in Snow Leopard

2009-09-06 Thread Jeff Johnson

On Sep 6, 2009, at 4:26 PM, Jens Alfke wrote:


On Sep 6, 2009, at 1:26 PM, Greg Guerin wrote:

Try using a pathname that contains only Latin alphabet characters  
(for reference, the original chars of the volume-name are Thai:  
\u0e40\u0e21\u0e48\u0e19).  If necessary, create and mount a disk- 
image in order to get only Latin chars.


I don't think it has anything to do with the characters in the  
filename:


NSLog(@"path = %@", [@"/etc" stringByStandardizingPath]);
results in
path = /etc
when the result ought to be "/private/etc".

The same thing happens with a custom symlink I created, like "/ 
Code", which links to "/Volumes/snoog/Code":


NSLog(@"path = %@", [@"/Code/Murky" stringByStandardizingPath]);
results in
path = /Code/Murky


Not sure about the second example, but the first example has been a  
problem for a long time:


rdar://problem/6121719 -[NSString stringByResolvingSymlinksInPath] is  
contradictory and untrustworthy


http://lapcatsoftware.com/rdar/6121719/index.html

(Note that stringByStandardizingPath is documented as calling  
stringByResolvingSymlinksInPath.)


-Jeff

___

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: Code Signing

2009-09-06 Thread Hal Mueller
On Sep 6, 2009, at 14:37, Charles Srstka   
wrote:


Why are you wanting to go around deleting files from the insides of  
app bundles?


Maybe to see what happens if the bad guys try the same trick. 
___


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


Distributed Objects in Foundation Tool

2009-09-06 Thread Luke Evans

Somebody may be able to provide clue here and save me a deal of time...

I'm intending using DO between a Foundation Tool and what is currently  
a normal Cocoa app.  I have used DO before between 2 normal Cocoa apps  
(i.e. where NSApplication starts the run loop etc.) - that just worked  
first time with no problems, but a Foundation App probably needs a  
little more TLC.


Right now, I have some test code in my 'main' function that attempts  
to connect to a remote object.  This seems to be able to produce an  
NSConnection (I provide a sendPort configured with IP and port of the  
remote socket/NSConnection, and receivePort is nil).
However, when I attempt to get the 'distant object' proxy, the call  
never returns.


I'm trying to figure out how to get a handle on what's happening here,  
and there are a bunch of questions to work on:
1. If you manage to get a connection instance, does that mean the  
connection is established correctly?

2. What runloop apparatus do I need to have various pieces of this work?

So far, regarding (1), I have tried to connect to arbitrary ports on  
the remote machine, and indeed get different (expected) behaviour: an  
NSPortTimeoutException.  So, I have reason to believe that when the  
NSConnection instance is returned, things should be set up correctly.


I'm beginning to think that (2) is where the issue lies.  I've read  
that replies use a special NSConnectionReplyMode, and that might also  
explain why I can't even get the NSDistantObject from -[NSConnection  
rootProxy] at this time (because I run a runloop at the bottom of my  
main function).


Anyway, while I fiddle with trying to find a magic incantation and  
particularly, how I should configure my runloop in a foundation app to  
get DO to work (and then where it will work), someone might already  
have some insight into how to get this going.


Cheers

-- Luke


___

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: Code Signing

2009-09-06 Thread Chris Suter
Hi Peter,

On Sun, Sep 6, 2009 at 9:00 PM, Peter Hudson wrote:
> I notice that when I sign code ( the whole app )  I  land up with 2
> additional items in my /Contents directory in the app bundle.
> These items are a folder called _CodeSignature  and an alias called
> CodeResources.
>
> If I delete these two items, the code still identifies itself as signed (
> when I attempt to run codesign on it again ).
> Also, the app still runs.
>
> I was wondering if these files are meant to remain or if removing them is
> not an issue ?

Within an application bundle there are signatures for all the files
within the bundle and then there's a signature for the binary itself.
The signature for the binary is stored within executable and you can
see it if you use the otool -l command (look for the
LC_CODE_SIGNATURE). The signature for all the resources is stored
within the file you've discovered.

As far as I know, except for static validation (using the codesign
tool), the signature for the resources isn't used by much (or at least
it wasn't for Leopard).

The signature for the binary is used by the system for various things.
For example you can set the kill flag to have your application
terminated if there's an invalid signature, and it's used for Keychain
access (so that if you upgrade an application, you won't be prompted
again for password access provided the signature remains valid).

It's important to remember that code signatures are not really there
to prevent malware from running, or make it harder for hackers (since
it's trivial to remove a code signature or replace them other valid
signatures).

At any rate, you shouldn't be deleting those files. If you remove
them, the signature will be invalidated.

By the way, the best list for code signing questions is the apple-cdsa list.

Kind regards,

Chris
___

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 do I update a constraint on my CALayer?

2009-09-06 Thread Austin Grigg

Thanks, that did the trick.

Austin

On Sep 6, 2009, at 5:29 PM, Kevin Cathey wrote:

You cannot update a single constraint, but you can replace the  
entire constraints array:

@property(copy) NSArray *constraints;

Kevin



___

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: Symbolic Links in Snow Leopard

2009-09-06 Thread Greg Guerin

Jens Alfke wrote:


NSLog(@"path = %@", [@"/etc" stringByStandardizingPath]);
results in
path = /etc
when the result ought to be "/private/etc".

The same thing happens with a custom symlink I created, like "/ 
Code", which links to "/Volumes/snoog/Code":


NSLog(@"path = %@", [@"/Code/Murky" stringByStandardizingPath]);
results in
path = /Code/Murky



The OP said stringByResolvingSymlinksInPath does the same thing,  
which seems incorrect to me, if the pathname is initially valid and  
contains symlinks.  However, if the pathname is invalid (doesn't  
exist, as determined by some function like stat()), then the behavior  
for both stringByResolvingSymlinksInPath and  
stringByStandardizingPath seems correct to me.


The use of stringByTrimmingCharactersInSet shouldn't be necessary if  
one is using valid pathnames in the first place, i.e. pathnames that  
are known to refer to actual file-system objects.  If the original  
'pat1' pathname was produced by something that knows the pathname to  
be valid, then trimming its whitespace is incorrect: the pathname  
should be used as-is.


Another possibility is a permissions restriction somewhere in trying  
to follow symlinks.  For example, Downloads might have restricted  
permissions or ACL, and/or the app might not be running under the  
'gerriet' uid.


If the code confirms at each step that there is a file-system object  
referenced by the resulting pathname, it should be easier to identify  
the point where things might be going wrong.  If the pathname becomes  
invalid, then the resulting error code should identify the reason for  
the failure.  It may be necessary to use stat() and errno in order to  
have sufficient information.


These are just ideas for further investigation, since we don't know  
the origin of the incoming 'pat1' pathname nor its original  
validity.  A well-isolated fail-case should help clarify things.


  -- GG

___

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


NSString drawAtPoint and vertical font alignment

2009-09-06 Thread Stephen Blinkhorn

Hi all,

I would have thought that the code below will center text horizontally  
and vertically within a NSRect.  Sometimes it does but it depends on  
the font I am using.  So the below may work for Verdana but if I  
change to Helvetica then the vertical centering is off.


Is there a better way to do this?

Thanks,
Stephen


displayString = @"Test"
viewRect = [self bounds];

attributes = [[NSMutableDictionary alloc] init];
[attributes setObject:textFont forKey:NSFontAttributeName];
[attributes setObject:textColor forKey:NSForegroundColorAttributeName];

NSSize titleSize = [displayString sizeWithAttributes:attributes];
int x_pos = (viewRect.size.width - titleSize.width) / 2;
int y_pos = (viewRect.size.height - titleSize.height);
NSPoint p = {x_pos, y_pos};
[displayString drawAtPoint:p withAttributes:attributes];
___

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: Symbolic Links in Snow Leopard

2009-09-06 Thread Joar Wingfors


On 6 sep 2009, at 14.26, Jens Alfke wrote:


NSLog(@"path = %@", [@"/etc" stringByStandardizingPath]);
results in
path = /etc
when the result ought to be "/private/etc".



This is the documented behavior:

	"Remove an initial component of “/private” from the path if the  
result still
	indicates an existing file or directory (checked by consulting the  
file system)."



The same thing happens with a custom symlink I created, like "/ 
Code", which links to "/Volumes/snoog/Code":


NSLog(@"path = %@", [@"/Code/Murky" stringByStandardizingPath]);
results in
path = /Code/Murky



The documentation is less clear on this. It says:

"If stringByStandardizingPath detects symbolic links in a pathname, the
stringByResolvingSymlinksInPath method is called to resolve them."

...but also:

	"Note that the path returned by this method may still have symbolic  
link components in it."


I would suspect that the first comment is incorrect, and that this  
method simply isn't attempting to resolve all symbolic links. The high  
level description of the method certainly doesn't give that impression:


	"Returns a new string made by removing extraneous path components  
from the receiver."


Compare that with the high level description for - 
stringByResolvingSymlinksInPath:


	"Returns a new string made from the receiver by resolving all  
symbolic links and standardizing path."



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: Distributed Objects in Foundation Tool [adjunct]

2009-09-06 Thread Luke Evans
Mmm... I can see a run loop running on the stack of the main thread of  
my frozen app when it is trying to obtain the proxy.
So, I'm guessing that I don't have to do anything special to get the  
right run loop apparatus on the thread - it looks like the call to - 
[NSConnection rootProxy] knows how to create a run loop on the thread  
and wait for a reply from the remote machine... which possibly never  
comes.
Still not sure which piece of string and sealing wax isn't configured  
right though...


On 2009-09-06, at 3:17 PM, Luke Evans wrote:

Somebody may be able to provide clue here and save me a deal of  
time...


I'm intending using DO between a Foundation Tool and what is  
currently a normal Cocoa app.  I have used DO before between 2  
normal Cocoa apps (i.e. where NSApplication starts the run loop  
etc.) - that just worked first time with no problems, but a  
Foundation App probably needs a little more TLC.


Right now, I have some test code in my 'main' function that attempts  
to connect to a remote object.  This seems to be able to produce an  
NSConnection (I provide a sendPort configured with IP and port of  
the remote socket/NSConnection, and receivePort is nil).
However, when I attempt to get the 'distant object' proxy, the call  
never returns.


I'm trying to figure out how to get a handle on what's happening  
here, and there are a bunch of questions to work on:
1. If you manage to get a connection instance, does that mean the  
connection is established correctly?
2. What runloop apparatus do I need to have various pieces of this  
work?


So far, regarding (1), I have tried to connect to arbitrary ports on  
the remote machine, and indeed get different (expected) behaviour:  
an NSPortTimeoutException.  So, I have reason to believe that when  
the NSConnection instance is returned, things should be set up  
correctly.


I'm beginning to think that (2) is where the issue lies.  I've read  
that replies use a special NSConnectionReplyMode, and that might  
also explain why I can't even get the NSDistantObject from - 
[NSConnection rootProxy] at this time (because I run a runloop at  
the bottom of my main function).


Anyway, while I fiddle with trying to find a magic incantation and  
particularly, how I should configure my runloop in a foundation app  
to get DO to work (and then where it will work), someone might  
already have some insight into how to get this going.


Cheers

-- Luke




___

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: NSString drawAtPoint and vertical font alignment

2009-09-06 Thread Quincey Morris

On Sep 6, 2009, at 17:11, Stephen Blinkhorn wrote:

I would have thought that the code below will center text  
horizontally and vertically within a NSRect.  Sometimes it does but  
it depends on the font I am using.  So the below may work for  
Verdana but if I change to Helvetica then the vertical centering is  
off.


Is there a better way to do this?

Thanks,
Stephen


displayString = @"Test"
viewRect = [self bounds];

attributes = [[NSMutableDictionary alloc] init];
[attributes setObject:textFont forKey:NSFontAttributeName];
[attributes setObject:textColor  
forKey:NSForegroundColorAttributeName];


NSSize titleSize = [displayString sizeWithAttributes:attributes];
int x_pos = (viewRect.size.width - titleSize.width) / 2;
int y_pos = (viewRect.size.height - titleSize.height);
NSPoint p = {x_pos, y_pos};
[displayString drawAtPoint:p withAttributes:attributes];


There are several things wrong with this:

-- You're not accounting for the bounds origin, so it only works if  
the origin happens to be (0, 0).


-- Presumably you meant "/ 2" on the y_pos calculation.

-- The documentation for "sizeWithAttributes:" says that it returns  
the size of the "bounding box". That could mean any of several  
different metrics that could result in the string being drawn a few  
pixels off from where you'd expect (especially in the Y direction, but  
also possibly in the X direction).


-- You calculate where you want the vertical *center* of this bounding  
box to be, but 'drawAtPoint:' puts the baseline at the specified  
point. The baseline is actually going to be more like 2/3 of the way  
down the bounding box in general.


I suspect the last one of these is the main reason for your vertical  
centering being off. Try using 'drawInRect:' instead, with a suitably  
calculated destination rect.



___

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: Easy Question re NSWindowController

2009-09-06 Thread Graham Cox


On 05/09/2009, at 10:42 PM, Brad Gibbs wrote:

If I create the NSWindowController programmatically with a custom  
initializer:


	NSWindowController *myWindowController = [[NSWindowController  
alloc] initWithWindowNibName:@"MyWindow"  
moc:self.managedObjectContext];


everything works fine.  I can also pass the managedObejctContext  
separately without breaking anything.


Hi Brad,

So, you've discovered that custom designated initializers don't work.  
That's to be expected, since IB/nibs are not aware of how your code is  
structured a priori, and there's no way to indicate which method is  
the designated initializer.


I usually deal with this kind of issue using informal protocols that  
are known to the window controller plus any delegate that wants to use  
them. For example:


@interface NSObject (MyWindowControllerDelegateInformalProtocol)

- (id)	willReturnManagedObjectContextForWindowController: 
(MyWindowController*) controller;


@end

Then your controller needs a setDelegate method, or a delegate outlet,  
and it will call the delegate with this method when it needs the  
information. This works with nibs and is a good general purpose  
solution. It also keeps the window controller self-contained and very  
likely reusable as well.


--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: Does Mac OS X support interior pointers?

2009-09-06 Thread Quincey Morris

On Sep 6, 2009, at 17:36, John Engelhart wrote:

So, since the Mac OS X documentation uses the term "interior  
pointer" in a totally non-standard way, and I can't find anything  
wrt/ to what I'm looking for, my question is:


Does the Mac OS X garbage collector support interior pointers (as  
defined at http://www.memorymanagement.org/glossary/i.html#interior.pointer 
 )?


Huh?

You know it doesn't. You've beaten up on GC before, with reference to  
*both* senses of "interior pointer".


I certainly hope this isn't the case because this essentially means  
that it is fundamentally impossible to write programs that execute  
in a deterministic fashion when using GC.  It is basically  
impossible to write code that guarantees that the base pointer  
remains visible to the collector, particularly when __weak and/or  
the optimizer is used.  Things work the vast majority of the time  
because there is (usually) a very small window of time where it  
could actually cause a problem and one of two things are true:  1)  
When the compiler generates code that, as a side effect, only uses  
interior pointers (this happens much, much more frequently than you  
would think), there's "something" that covers this fundamental error  
with a base pointer.  This is invariably due to a happy set of  
coincidences and rarely the explicit, intentional result of the  
programmer. 2) The collector is not collecting during the window of  
vulnerability.


You also know that no one else on this list agrees with you on this  
subject, so I don't understand why you're asking about it.


*Of course* every programmer explicitly and intentionally ensures that  
the lifetimes of "base" pointers continue for as long as "derived" or  
"interior" pointers need to be valid. That's the Mac OS X garbage  
collection architecture, for now.


Of course it's possible to forget to maintain the base pointer (or  
fail to realize that it's necessary). Of course there are a few cases  
where it's much easer to forget than is reasonable. Of course  
forgetting to do it opens up a window of vulnerability. Of course that  
sucks.


But it's no more broken now than the last time the list discussed  
this. There's nothing new here. Time to move on.



___

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: NSString drawAtPoint and vertical font alignment

2009-09-06 Thread Stephen Blinkhorn


On 6 Sep 2009, at 18:37, Quincey Morris wrote:


There are several things wrong with this:

-- You're not accounting for the bounds origin, so it only works if  
the origin happens to be (0, 0).


OK, do you mean the origin of [self bounds] isn't always (0, 0)?  That  
could explain a few things..




-- Presumably you meant "/ 2" on the y_pos calculation.


Yes.


-- The documentation for "sizeWithAttributes:" says that it returns  
the size of the "bounding box". That could mean any of several  
different metrics that could result in the string being drawn a few  
pixels off from where you'd expect (especially in the Y direction,  
but also possibly in the X direction).


-- You calculate where you want the vertical *center* of this  
bounding box to be, but 'drawAtPoint:' puts the baseline at the  
specified point. The baseline is actually going to be more like 2/3  
of the way down the bounding box in general.


I suspect the last one of these is the main reason for your vertical  
centering being off. Try using 'drawInRect:' instead, with a  
suitably calculated destination rect.


OK, many thanks for the tips Quincey - should clear up my problems.

Stephen

___

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: Distributed Objects in Foundation Tool [SOLVED]

2009-09-06 Thread Luke Evans
OK, it turns out that my first lemma didn't hold.  My connection  
object was not a good one (having an incorrect remote port).
This (thankfully) had nothing to do with run loops or other flora and  
fauna.



On 2009-09-06, at 5:28 PM, Luke Evans wrote:

Mmm... I can see a run loop running on the stack of the main thread  
of my frozen app when it is trying to obtain the proxy.
So, I'm guessing that I don't have to do anything special to get the  
right run loop apparatus on the thread - it looks like the call to - 
[NSConnection rootProxy] knows how to create a run loop on the  
thread and wait for a reply from the remote machine... which  
possibly never comes.
Still not sure which piece of string and sealing wax isn't  
configured right though...


On 2009-09-06, at 3:17 PM, Luke Evans wrote:

Somebody may be able to provide clue here and save me a deal of  
time...


I'm intending using DO between a Foundation Tool and what is  
currently a normal Cocoa app.  I have used DO before between 2  
normal Cocoa apps (i.e. where NSApplication starts the run loop  
etc.) - that just worked first time with no problems, but a  
Foundation App probably needs a little more TLC.


Right now, I have some test code in my 'main' function that  
attempts to connect to a remote object.  This seems to be able to  
produce an NSConnection (I provide a sendPort configured with IP  
and port of the remote socket/NSConnection, and receivePort is nil).
However, when I attempt to get the 'distant object' proxy, the call  
never returns.


I'm trying to figure out how to get a handle on what's happening  
here, and there are a bunch of questions to work on:
1. If you manage to get a connection instance, does that mean the  
connection is established correctly?
2. What runloop apparatus do I need to have various pieces of this  
work?


So far, regarding (1), I have tried to connect to arbitrary ports  
on the remote machine, and indeed get different (expected)  
behaviour: an NSPortTimeoutException.  So, I have reason to believe  
that when the NSConnection instance is returned, things should be  
set up correctly.


I'm beginning to think that (2) is where the issue lies.  I've read  
that replies use a special NSConnectionReplyMode, and that might  
also explain why I can't even get the NSDistantObject from - 
[NSConnection rootProxy] at this time (because I run a runloop at  
the bottom of my main function).


Anyway, while I fiddle with trying to find a magic incantation and  
particularly, how I should configure my runloop in a foundation app  
to get DO to work (and then where it will work), someone might  
already have some insight into how to get this going.


Cheers

-- Luke






___

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


bookmarkDataWithContentsOfURL crashes

2009-09-06 Thread Gerriet M. Denkmann

This code:

NSString *patx = @"/Volumes/เม่น/Users/gerriet/Downloads/abc  
alias"; <--- this really is an alias, created in Finder.

NSURL *u2a = [ NSURL fileURLWithPath: patx ];
NSLog(@"%s will call bookmarkDataWithContentsOfURL",__FUNCTION__);
//	the next line will create  "malloc: *** error for object 0x1d20500:  
double free" if it is an alias

//  and soon after there will be a random crash
NSData *bookmarkData = [ NSURL bookmarkDataWithContentsOfURL: u2a   
error: outError ];

NSLog(@"%s did call bookmarkDataWithContentsOfURL",__FUNCTION__);
if ( bookmarkData == nil )  //  probably not a bookmark or alias
{
NSLog(@"%s not a bookmark %@",__FUNCTION__, *outError);
}
else
{
NSLog(@"%s is a bookmark \"%...@\"",__FUNCTION__, patx);
};

results in:

... will call bookmarkDataWithContentsOfURL
GmdText(17333,0xa045b500) malloc: *** error for object 0x1e337b0:  
double free

*** set a breakpoint in malloc_error_break to debug
(gdb) bt
#0  0x940ca28a in malloc_error_break ()
#1  0x940cb430 in szone_error ()
#2  0x940cb565 in free_tiny_botch ()
#3  0x90e62cac in _CFRelease ()
#4  0x94fd5e5e in _CFURLCreateBookmarkDataFromFile ()
#5  0x90f870a3 in +[NSURL bookmarkDataWithContentsOfURL:error:] ()
#6  0x765f in -[AppDelegate(AppDelegatePrivate)  
openOneFile:error:] (self=0x1e1b790, _cmd=0x19d90, pat1=0x1c376c0,  
outError=0xbfffe1a0) at /Volumes/เม่น/Users/gerriet/Source/ 
Stuff 10.2.0 RealProjects/GmdText-1.0/AppDelegate.m:2004
#7  0x70a5 in -[AppDelegate openFile:userData:error:]  
(self=0x1e1b790, _cmd=0x19e65, pboard=0x1c36e60, data=0xa011bca8,  
outEroror=0xbfffe2a8) at /Volumes/เม่น/Users/gerriet/Source/ 
Stuff 10.2.0 RealProjects/GmdText-1.0/AppDelegate.m:1556
#8  0x9154aa55 in -[NSServiceListener  
_doInvokeServiceIn:msg:pb:userData:error:unhide:] ()

#9  0x9154a513 in _NSServiceMasterCallBack ()
#10 0x90f521e9 in __CFServiceControllerMessagePortCallBack ()
#11 0x90f27323 in __CFMessagePortPerform ()
#12 0x90e97b8e in __CFRunLoopDoSource1 ()
#13 0x90e939e9 in __CFRunLoopRun ()
#14 0x90e91d34 in CFRunLoopRunSpecific ()
#15 0x90e91b61 in CFRunLoopRunInMode ()
#16 0x90039fec in RunCurrentEventLoopInMode ()
#17 0x90039da3 in ReceiveNextEventCommon ()
#18 0x90039c28 in BlockUntilNextEventMatchingListInMode ()
#19 0x91026b99 in _DPSNextEvent ()
#20 0x9102640e in -[NSApplication  
nextEventMatchingMask:untilDate:inMode:dequeue:] ()

#21 0x90fe85fb in -[NSApplication run] ()
#22 0x90fe0695 in NSApplicationMain ()
#23 0x279a in main (argc=1, argv=0xb594) at /Volumes/ 
เม่น/Users/gerriet/Source/Stuff 10.2.0 RealProjects/ 
GmdText-1.0/main.m:5

(gdb) continue
... did call bookmarkDataWithContentsOfURL
... bookmarkData ok

and when I continue using this code (with different values of  
"patx" (which point to bookmarks or not) I get random error messages  
and crashes, so it seems this "double free" really did corrupt  
something.


What did I do wrong?
Are there any better ways to resolve aliases? Or is the C-API the only  
alternative?


Kind regards,

Gerriet.

___

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: Symbolic Links in Snow Leopard

2009-09-06 Thread Gerriet M. Denkmann


On 7 Sep 2009, at 06:53, Greg Guerin  wrote:


Gerriet M. Denkmann wrote:

This is the directory used (/Volumes/à’•à¸¡à’√à¸˙/ 
Users/gerriet/

Downloads):
-rw-r--r--@ 1 gerriet staff 36 6 Sep 19:30 abc
-rw-r--r--@ 1 gerriet staff 47908 6 Sep 19:37 abc alias
lrwxr-xr-x 1 gerriet staff 3 4 Sep 21:31 abcSymlink -> abc
lrwxr-xr-x 1 gerriet staff 49 6 Sep 19:45 absAbsSymlink -> /
Volumes/à’•à¸¡à’√à¸˙/Users/gerriet/Downloads/abc

Here is my code:
NSLog(@"%s start \"%...@\"",__FUNCTION__, pat1);

NSString *pat2 = [ pat1 stringByTrimmingCharactersInSet:
[ NSCharacterSet whitespaceAndNewlineCharacterSet ] ];
NSLog(@"%s removed white: \"%...@\"",__FUNCTION__, pat2);

NSString *pat3 = [ pat2 stringByStandardizingPath ];
NSLog(@"%s standardized \"%...@\"",__FUNCTION__, pat3);

And this is the result:
start "/Volumes/à’•à¸¡à’√à¸˙/Users/gerriet/Downloads/ 
absAbsSymlink"
removed white: "/Volumes/à’•à¸¡à’√à¸˙/Users/gerriet/ 
Downloads/

absAbsSymlink"
standardized "/Volumes/à’•à¸¡à’√à¸˙/Users/gerriet/ 
Downloads/

absAbsSymlink" <-- BAD



Try using a pathname that contains only Latin alphabet characters
(for reference, the original chars of the volume-name are Thai: \u0e40
\u0e21\u0e48\u0e19).  If necessary, create and mount a disk-image in
order to get only Latin chars.

Did try already - same issue.


Also, please show the code that assigns a value to pat1.  How that
pathname is determined may have a bearing on the problem.
Same problem if I just do: pat1 = @"/Volumes/เม่น/Users/gerriet/ 
Downloads/absAbsSymlink";




Finally, I'm a little puzzled why stringByTrimmingCharactersInSet:
should be needed.
The string comes from the Services Menu and the user might have  
selected more than the pathname (yes, this will break if the last path  
component ends with whitespace, but this is kind of unlikely).


Kind regards,

Gerriet.

___

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 stop NSImage from resizing while calling 'drawInRect' ?

2009-09-06 Thread DairyKnight
Thanks. Sounds like a really weird bug, though.
I also figured out a way to solve this, by calling [NSBitmapImageRep
drawAtPoint:] instead of
the [NSImage drawAtPoint:] one, which has the correct behaviour. So it might
be a good idea to
maintain compatibility of your code between leopard and SL.


On Sun, Sep 6, 2009 at 11:15 PM, Dave Keck  wrote:

> I'm not clear on which method is giving you issues, -drawInRect: or
> -drawAtPoint:? If it's -drawAtPoint: then it sounds like you may be
> hitting a bug in the frameworks on Leopard:
> http://developer.apple.com/mac/library/releasenotes/Cocoa/AppKit.html,
> search for "NSImage: Breaking change to drawAtPoint:"
>
> If the issue you're having is with -drawInRect:, then you need to make
> sure your source and destination rectangles are the same size, to
> prevent scaling.
>
___

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: Symbolic Links in Snow Leopard

2009-09-06 Thread Jens Alfke


On Sep 6, 2009, at 4:51 PM, Greg Guerin wrote:

The OP said stringByResolvingSymlinksInPath does the same thing,  
which seems incorrect to me, if the pathname is initially valid and  
contains symlinks.  However, if the pathname is invalid (doesn't  
exist, as determined by some function like stat()), then the  
behavior for both stringByResolvingSymlinksInPath and  
stringByStandardizingPath seems correct to me.


Huh? I never said the path was invalid. "/Code/Murky" is a perfectly  
cromulent path on my machine, although it goes through a symlink.


—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: Binding table columns that change at runtime

2009-09-06 Thread BareFeet

Thanks Brent for your input:

You will probably want to use KVO to observe changes to the array  
holding the list of column names to show.


I'm not sure how to do that. It's probably enough in my case to  
intercept setContent calls to the NSArrayController, changing the  
table columns during that process.



You can subclass NSArrayController.


I ended up doing that. I only had to intercept setContent and add an  
IBOutlet instance variable linked to the NSTableView, so I could set  
up the needed columns based on the newContent:


//  BFArrayController.h

@interface BFArrayController : NSArrayController
{
IBOutlet NSTableView* myTableView;
}

@property (retain) NSTableView* myTableView;

- (void) setContent: (id) newContent;

@end


//  BFArrayController.m

#import "BFArrayController.h"
#import "BFTableViewCategory.h"

@implementation BFArrayController

@synthesize myTableView;

- (void) setContent: (id) newContent
{
if ([newContent count] > 0)
{
NSArray* columnNameArray = [[newContent objectAtIndex:0] 
allKeys];
[myTableView createColumns:(NSArray*)columnNameArray 
bindTo:self];
}
[super setContent: newContent];
}

@end


And I implemented a new createColumns:bindTo: method as a category for  
NSTableViews:


//  BFTableViewCategory.h

#import 

@interface NSTableView (ExtrasByTom)

- (void) createColumns:(NSArray*)columnNameArray bindTo: 
(NSArrayController*) tableArrayController;


@end


//  BFTableViewCategory.m

#import "BFTableViewCategory.h"

@implementation NSTableView (ExtrasByTom)

- (void) createColumns:(NSArray*)columnNameArray bindTo: 
(NSArrayController*) tableArrayController

{
// Remove old columns:
	NSMutableArray* oldTableColumns = [NSArray arrayWithArray: [self  
tableColumns]];

for(NSTableColumn* oldTableColumn in oldTableColumns)
[self removeTableColumn:oldTableColumn];

// Add new columns:
for (NSString* columnName in columnNameArray)
{
		NSTableColumn* newTableColumn = [[[NSTableColumn alloc]  
initWithIdentifier:columnName] autorelease];

[[newTableColumn headerCell] setStringValue:columnName];
[self addTableColumn:newTableColumn];
		[newTableColumn bind:@"value" toObject:tableArrayController  
withKeyPath:[NSString stringWithFormat: @"arrangedObjects.%@",  
columnName] options:nil];

}
}
@end

You could go all-out and add support for a new binding or the custom  
controller could just add itself as an observer of the arranged  
objects property of the relevant array controller (the one managing  
the list of column names). Then implement the KVO observation method  
(-observeValueForKeyPath:ofObject:change:context:), where you will  
do the right thing depending on whether a column was added or removed.



Hmmm, that's interesting. It would be useful to be able to bind the  
array of NSTableColumns used by an NSTableView to some array in the  
model data. Probably a bit beyond me at the moment.


Thanks,
Tom
BareFeet

___

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: NSString drawAtPoint and vertical font alignment

2009-09-06 Thread Quincey Morris

On Sep 6, 2009, at 18:41, Stephen Blinkhorn wrote:

OK, do you mean the origin of [self bounds] isn't always (0, 0)?   
That could explain a few things..


The origin of the bounds coordinate system is always (0, 0) by  
definition, but what I meant to say was that the bottom left corner of  
the view (i.e. [self bounds].origin) doesn't have to be (0, 0) in  
bounds coordinates, though it usually is.



___

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


Turn on zombies in user environment?

2009-09-06 Thread Graham Cox

Is it possible to enable zombie mode for a shipped app?

I have a user reporting a crash which is clearly messaging a released  
object, but I can't see what. It's not reproducible locally, and  
appears to be affecting this one user only. Can I get him somehow to  
turn on zombie mode and get a meaningful report even though the app  
has no debugging symbols and is an optimized release build? Other  
strategies?


--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: crash question NSString

2009-09-06 Thread Joshua Pennington

Place a breakpoint on objc_exception_throw and eliminate the guesswork.

Cheers,
Joshua

On Sep 5, 2009, at 9:55 AM, "Rick C."  wrote:


hello,

i'm just looking for a confirmation here.  if i'm getting this crash:

*** Terminating app due to uncaught exception  
'NSInvalidArgumentException', reason: '*** -[NSCFString  
appendString:]: nil argument'


is it definitely crashing on my NSMutableString appendString: method  
or is it possible it's also crashing on NSString  
stringByAppendingString:?  as far as i know either one will throw an  
exception that's why i'm asking.


___

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


Change the text color in an NSTableView based on the data in the row

2009-09-06 Thread Bryan Zarnett
I would like to set the text color of the cell in an NSTableView based  
on a particular set of data in the table of in the associated array  
controller. I currently have the basic code for the coloring changing  
working right now in "willDisplayCell". What I am not sure about is  
how to (1) retrieve a column for the same row to check the data for a  
cell, or (2) check the associate array controller being used to  
populate the cell data to see if a different field has related data.


For example, while viewing the "Name" column in "willDisplayCell", I  
also want to see the other data that it is associated to -- perhaps  
not all the data is displayed in the NSTableView.


Thoughts?

Bryan
___

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


Is a serial NSOperationQueue FIFO?

2009-09-06 Thread Eric Hermanson
When working with a serial NSOperationQueue (i.e.  
setMaxConcurrentOperationCount==1), are the operations added to the  
queue guaranteed to run in FIFO order if all operations have the same  
priority and no operation dependencies are involved?  My guess is that  
the NSOperationQueue will run the operations in FIFO order, however, I  
don't believe the NSOperationQueue documentation guarantees this.  The  
documentation says operations will run based on priority, then on  
dependency structure.  Because all operations in this aforementioned  
serial queue have the same priority (i.e normal) and no dependencies,  
then I suppose the NSOperationQueue could sort the operations any way  
it wanted, not necessarily in the order I added them to the queue.


Does anyone have insight into this, or is there documentation anywhere  
that can guarantee to me an NSOperationQueue with a concurrent  
operation count of 1 will indeed process the operations first come  
first serve?



___

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: Change the text color in an NSTableView based on the data in the row

2009-09-06 Thread Graham Cox


On 07/09/2009, at 9:40 AM, Bryan Zarnett wrote:

I would like to set the text color of the cell in an NSTableView  
based on a particular set of data in the table of in the associated  
array controller. I currently have the basic code for the coloring  
changing working right now in "willDisplayCell". What I am not sure  
about is how to (1) retrieve a column for the same row to check the  
data for a cell, or (2) check the associate array controller being  
used to populate the cell data to see if a different field has  
related data.


For example, while viewing the "Name" column in "willDisplayCell", I  
also want to see the other data that it is associated to -- perhaps  
not all the data is displayed in the NSTableView.


Thoughts?


Hi Bryan,

The row index usually represents the array index of the item in the  
data model, and the column is a property for that item. Therefore the  
rowIndex is all you need to retrieve *all* of the data for an object,  
whether the table displays it or not. Both the column and the row  
index are passed to the delegate method you mention.


You ask: "how to (1) retrieve a column for the same row" but that  
doesn't make any sense - the column being drawn is passed to you, and  
there isn't a "column for the same row". Columns and rows are, quite  
literally, orthogonal.


--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: Turn on zombies in user environment?

2009-09-06 Thread Dave Keck
To enable zombies and run your app:

1. Open terminal
2. export NSZombieEnabled=YES
3. /path/to/program.app/Contents/MacOS/program

... and stdout will of course go to the terminal window.

Or, if the user is more technically apt, #3 can be 'gdb ',
'run', and when it crashes, 'bt' to get a backtrace.
___

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


document-based application

2009-09-06 Thread Oftenwrong Soong
Hi All,

In my doc-based app, I need to initially display a startup window instead of a 
new empty document. Its function would be somewhat akin to that of the Template 
Chooser that comes up when you launch Pages.

I've scoured the texts about the document architecture but cannot find pointers 
on how to do this.

So far this is the best idea I could come up with:

Implement NSApplication delegate applicationShouldOpenUntitledFile:, returning 
NO, and implement applicationDidFinishLaunching:, in which the startup window 
is launched. Then I manually call makeUntitledDocumentOfType:error.

It seems an ugly hack and I have a feeling it won't work 100% right. Is there a 
better way to implement an initial window in a doc-based app?

Thanks,
Soong



  

___

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: Turn on zombies in user environment?

2009-09-06 Thread Kyle Sluder

On Sep 6, 2009, at 10:21 PM, Dave Keck  wrote:


Or, if the user is more technically apt, #3 can be 'gdb ',
'run', and when it crashes, 'bt' to get a backtrace.


You'll need to make sure you have the unstripped release binary (not a  
debug version) of the same app version for this backtrace to be  
useful. If you don't, you will have to send the user a new binary.


Also the NSZombie will prevent a crash, so the user will need to set  
the appropriate breakpoint before running the program.


You might have the best results just sending the user an instrumented  
binary. Even something simple like a launcher.


--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: NSString drawAtPoint and vertical font alignment

2009-09-06 Thread Stephen Blinkhorn


On 6 Sep 2009, at 21:30, Quincey Morris wrote:


On Sep 6, 2009, at 18:41, Stephen Blinkhorn wrote:

OK, do you mean the origin of [self bounds] isn't always (0, 0)?   
That could explain a few things..


The origin of the bounds coordinate system is always (0, 0) by  
definition, but what I meant to say was that the bottom left corner  
of the view (i.e. [self bounds].origin) doesn't have to be (0, 0) in  
bounds coordinates, though it usually is.


Right, here's something I don't understand and I think it is still  
relevant:


I make a custom view (really a NSControl subclass) and I use a place  
holder in IB to position it on screen.  I also set it's size to be say  
50 wide by 22 high.


If I draw the view by simply filling the rect returned by [self  
bounds] then it looks fine and in the same place as the IB  
placeholder.  However, the view responds to mouse events outside of  
its visual frame at the top edge and only registers mouse events  
inside the bottom edge once the cursor is about 3-4 pixels inside the  
frame.  Whilst only small the inaccuracy feels very wrong after a while.


I don't understand is the mouse event part.  I am filling the bounds  
rectangle via NSRectFill but mouse events visibly outside the filled  
rectangle are apparently happening inside the bounds rectangle.  I use  
this to get the event position:


NSPoint p = [self convertPoint:[theEvent locationInWindow]  
fromView:nil];


I've read a lot of the Apple docs about frames, bounds and co-ordinate  
spaces but I can't figure this out.  Maye it is time for some sleep.


Thanks,
Stephen



___

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