Re: a bug in iphone SDK's creation of view based xib files.

2009-09-02 Thread Joey Hagedorn

Hi Jon,

On Aug 30, 2009, at 8:01 AM, jon wrote:

a bug in iphone SDK's creation of view based xib files.  (this is  
using 3.1,  but other's probably apply)

steps to reproduce.


Please do not discuss unreleased software on this list. You have  
access to the developer forums which are an appropriate place to  
discuss issues you may have. The issue you're discussing applies to  
iPhone OS 3.0 as well, so I'll continue to answer.



step 1. create a new iPhone View-based Application in Xcode.
step 2. add a new Class..   "Cocoa Touch Class"   of  
UIViewController subclass.
step 3. be sure to include the "option" of "with XIB for user  
interface."
step 4. open the newly created XIB file in interface Builder.
(change the view's back ground color to some color that you can see  
easily if incorrectly placed in the iphone simulator)
step 5. under the view size tab in the inspector of interface  
builder of this newly created "view" in the XIB,  you will find it  
impossible to adjust the "stretch" arrows of the autoSizing.. .


The adjustment of autosizing controls are disabled when there are  
enabled Simulated User Interface attributes. If you disable the the  
Simulated Status Bar on the view, you should be able to adjust the  
springs and struts freely.


so if you compile a working app that can be rotated in the iphone  
simulator.  (you will need a working app that can rotate the view in  
the iphone simulator)


 (and have the app's view  in the simulator rotate automatically),  
you will see that the view is no longer sized correctly (in the  
iphone simulator).  (you will see the background color in the wrong  
places)



the part that is wrong, and can be corrected:

inside the newly created XIB file,  you will find a line "key="NSvFlags">256" (or something similar for the number)


this makes it impossible to change the autoSizing arrows to stretch  
the "view" of the new xib in interface builder...  (notice the first  
xib file in the new project is set correctly,  but this new xib you  
create with tne new class is incorrect)


if you change it instead to ""274"   then  
you regain the function of being able to size your view in the  
"autosize" area,  and be able to rotate your view automatically in  
the running app's iphone simulator.


this "key" should be changed so that you can change the stretching  
ability to the programers preference,  which is some other code that  
i do not know at this time.  the code given hard wires the auto  
stretch permanently...  the incorrect code turns off auto stretch  
permanently   but the correct code should make it the programers  
option to have stretching or no stretching…


You should never edit the contents of a XIB file by hand; always use  
Interface Builder to edit XIB files. The springs and struts are  
disabled on views with simulated user interface attributes, so this is  
expected.


In any case, whenever you believe there is a bug, please file a report  
at http://bugreporter.apple.com


In this case, it sounds like you expect the view provided in the  
UIViewController Subclass with XIB file template to have the  
autosizing parameters set differently.


Thanks,
--Joey___

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: Image Thresholding

2009-09-02 Thread Greg Guerin

fawad shafi wrote:


I want to convert grayscale or RGB image to Binary Image.
Please provide sample code.



"What Have You Tried?":
  http://mattgemmell.com/2008/12/08/what-have-you-tried

"Why Questions Go Unanswered":
  http://perl.plover.com/Questions.html

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


Image Thresholding

2009-09-02 Thread fawad shafi







Hello,
I want to convert grayscale or RGB image to Binary Image.
Please provide sample code.

Thanks in advance.

Regards,
Fawad Shafi
iPhone Application DeveloperAddictive Mobility (ATC).


Hotmail® is up to 70% faster. Now good news travels really fast.  Try it now.
Windows Live: Make it easier for your friends to see what you’re up to on 
Facebook. Find out more.
_
With Windows Live, you can organize, edit, and share your photos.
http://www.windowslive.com/Desktop/PhotoGallery___

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


[Workaround] Re: My NSUndoManager subclass is broken on SL - how to fix?

2009-09-02 Thread Graham Cox
For anyone interested (doesn't seem like anyone is, unfortunately) I  
have worked out a solution which can only be described as an  
inglorious hack. I have submitted a bug report requesting that  
NSUndoManager is made (optionally) backwards compatible with earlier  
subclasses of it. Bug# 7193398.


The workaround is to override NSUndoManager methods as follows:

- (id)  prepareWithInvocationTarget:(id)target
{
_target = target; //_target is an ivar, non retained
return self;
}


- (void) forwardInvocation:(NSInvocation*) invocation
{
[invocation setTarget:_target];
[invocation retainArguments];
	[self registerUndoWithTarget:self selector:@selector 
(unwrapEmbeddedInvocation:) object:invocation];

}


- (NSMethodSignature *) methodSignatureForSelector:(SEL) aSelector
{
NSMethodSignature* sig = [super methodSignatureForSelector:aSelector];

if( sig == nil )
sig = [_target methodSignatureForSelector:aSelector];

return sig;
}


- (BOOL)respondsToSelector:(SEL) aSelector
{
	return [super respondsToSelector:aSelector] || [_target  
respondsToSelector:aSelector];

}


- (void)unwrapEmbeddedInvocation:(NSInvocation*) invocation
{
[invocation invoke];
}

These methods restore 10.5 compatible behaviour, I believe, though I'm  
not quite certain about the set up of the invocation with respect to  
retaining its target. Notes for NSUndoManager say it does not retain  
its targets, but does retain its arguments, whereas notes for  
NSInvocation state that -retainArguments also retains the target. So  
I'm not quite sure how to reconcile that (and whether as a result I  
have a leak through over-retention of the invocation's target).


With the above, you can then override  
registerUndoWithTarget:selector:object: to implement task coalescing  
or whatever you wanted to subclass NSUndoManager to do in the first  
place, and it still works on 10.6 when tasks are submitted via - 
prepareWithInvocationTarget:


--Graham



On 03/09/2009, at 12:31 AM, Graham Cox wrote:

My app subclasses NSUndoManager, so that it can provide a couple of  
extra things to the app, namely, task coalescing and a change count  
that I track to see if certain operations which come from a wide  
variety of places actually submitted an undo task (and hence the  
undo manager itself is the one central place that knows about them).


On 10.6, While Undo is still generally working, the stuff my class  
added are not. In trying to track this down, I was getting some very  
puzzling results, like none of my breakpoints were firing in my  
subclass's override for -forwardInvocation. Then I spot this note in  
the docs:


"On Mac OS X v10.6 and later, this method (- 
prepareWithInvocationTarget:) returns a proxy object for the  
receiver that forwards all messages to the receiver as undo  
operations."


OK, I understand why that was done, but how can I alter my code so  
it works for this non-backwards-compatible situation? It seems this  
mysterious proxy object is forwarding to some private method of  
NSUndoManager that I can't override, so it's bypassing my very  
useful additions. I need to know where I can hook into whatever this  
proxy object delivers the task to the U/M.


Any ideas?


___

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: Getting a StringPtr from Gestalt on 64-bit

2009-09-02 Thread Kyle Sluder

NSHost now does this.

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

2009-09-02 Thread Kyle Sluder
Re-read the docs. Your plist needs to specify an array (possibly  
empty) of valid contexts. Otherwise Snow Leopard assumes you haven't  
updated your service for 10.6.


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


Trouble with NSButtonCell

2009-09-02 Thread Dave DeLong

Hi everyone,

I'm using Brandon's excellent BWToolkit in a project of mine right  
now.  I'm specifically using the BWTransparentTableView and  
BWTransparentCheckBoxCell classes.  I'd like to customize the  
CheckBoxCell to fulfill the following requirements:


1. Only invoke the target's action when the user single-clicks the  
actual checkbox.
2. Invoke the target's action when the user double-clicks anywhere in  
the cell.


I've tried subclassing BWTransparentCheckBoxCell and implementing  
stopTracking:at:inView:mouseIsUp: to invoke the target's action  
appropriately, but this method is never getting executed.  I've tried  
implementing the tableView's delegate method  
(tableView:shouldTrackCell:...), to no effect.  I've toyed with the  
possibility of implementing a custom  
trackMouse:inRect:ofView:untilMouseUp:, but that seems hopelessly  
complex.


Any ideas on why my tracking method isn't getting called, or a better  
approach I could be taking to this?


Thanks!

Dave DeLong
___

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: drawing my image in snow leopard

2009-09-02 Thread Rick C.
yes it does steve thank you very much...still so much to learn!

rick






From: Steve Christensen 
To: Rick C. 
Cc: cocoa dev 
Sent: Thursday, September 3, 2009 12:37:19 AM
Subject: Re: drawing my image in snow leopard

Does this not do what you want?

[myImage drawInRect:NSIntegralRect(myCenteredRect) fromRect:...];

steve


On Sep 2, 2009, at 9:22 AM, Rick C. wrote:

> thank you markus i do see that now.  since my icon centers the numbers will 
> always change.  this should be obvious but what would be the least memory 
> intensive way to constantly round this number...
> 
> center.x = bounds.width *.5
> 
> if center.x is a round number it works as you say.  i'm probably missing the 
> obvious as usual but i'm having a bit of trouble to round/truncate the 
> cgfloat...
> 
> thanks again,
> 
> rick
> 
> 
> From: Markus Spoettl 
> To: cocoa dev 
> Sent: Wednesday, September 2, 2009 8:17:56 PM
> Subject: Re: drawing my image in snow leopard
> 
> On Sep 2, 2009, at 12:33 PM, Rick C. wrote:
>> i've been using NSImage drawInRect:fromRect:operation:fraction: to draw and 
>> center my .icns image in a resizable custom view for some time without 
>> issues.  now in snow leopard the same code works, however when the custom 
>> view is at its minimum size the image is slightly blurry.  when i resize the 
>> custom view to full size the image is fine.  seems to be maybe scaling but 
>> i'm not rescaling the image the size is constant.  of course the view is 
>> being resized.  i just checked again in leopard and this is not an issue.  
>> i'm thinking i need to add something in my code to keep up with changes in 
>> snow leopard but i haven't yet figured out what that might be.  if anyone 
>> needs some code i can post it.  thank you,
> 
> The AppKit release notes state that with 10.6 the image destination 
> coordinates are no longer rounded to integral values. Just round x and y of 
> your destination rect and the image should appear sharp like before.


  
___

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: Getting a StringPtr from Gestalt on 64-bit

2009-09-02 Thread Jim Correia

On Sep 2, 2009, at 9:02 PM, Scott Lahteine wrote:

My preference pane uses Gestalt(gestaltUserVisibleMachineName,  
&mySInt32), coercing the SInt32 into a StringPtr to get the Machine  
Name. On 64-bit I get a warning because StringPtr is a 64-bit  
pointer on that architecture. Does Gestalt() ensure that the  
returned pointer is in the low 4 gigs of RAM, or is there a more  
appropriate way to get the Machine Name that is 64-bit compatible?


extern CFStringRef CSCopyMachineName(void)  
AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;


- Jim


___

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


FW: Image Problem

2009-09-02 Thread fawad shafi




Hello,
I am doing the work on Augmented Reality, I have managed to detect the edges of 
camera captured image as shown in attached file.
Now i want to the check that whether the marker image (Colored image) exists 
anywhere in black and white image or not?

Thanks in advance.

Regards,
Fawad Shafi
iPhone Application DeveloperAddictive Mobility (ATC).


Hotmail® is up to 70% faster. Now good news travels really fast.  Try it now.
_
Windows Live: Make it easier for your friends to see what you’re up to on 
Facebook.
http://windowslive.com/Campaign/SocialNetworking?ocid=PID23285::T:WLMTAGL:ON:WL:en-US:SI_SB_facebook:082009___

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


Getting a StringPtr from Gestalt on 64-bit

2009-09-02 Thread Scott Lahteine
My preference pane uses Gestalt(gestaltUserVisibleMachineName,  
&mySInt32), coercing the SInt32 into a StringPtr to get the Machine  
Name. On 64-bit I get a warning because StringPtr is a 64-bit pointer  
on that architecture. Does Gestalt() ensure that the returned pointer  
is in the low 4 gigs of RAM, or is there a more appropriate way to get  
the Machine Name that is 64-bit compatible?


--
Scott Lahteine
Thinkyhead
http://thinkyhead.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


NSServices

2009-09-02 Thread Colin Deasy

Hi,
I've been trying to get NSServices working for my application recently with no 
success. I have set it up according to the documentation but it does not appear 
in the services menu ( however it does appear in the keyboard shortcuts section 
of the System Preferences as a service menu item)Anyway I set the service in my 
app controller like this:[NSApp setServicesProvider:self];
The method exposed is:
- (void) addDownloadService:(NSPasteboard *)pboard
 userData:(NSString *)userData error:(NSString 
**)error
My Info.plist then looks like this:
 NSServices 
   NSReturnTypes  
   
   NSKeyEquivalent 
   EnglishS 
   Key equivalent (with command and 
shift)S  
  NSSendTypes 
   NSStringPboardType   
 NSURLPboardType   
 NSRTFPboardType   
 NSPortName
MyAppNSMessage  
  addDownloadService
NSMenuItem 
   English
MyNewServicedefault 
MyNewService   
  
I tried running the debug command with textedit like so: 
/Applications/TextEdit.app/Contents/MacOS/TextEdit -NSDebugServices 
com.companyname.MyApp

which outputs the following:MyNewService (com.companyname.MyApp) is disabled in 
the services menu and disabled in the context menu, by the standard Services 
policy.


Anyone any ideas why it might not be working?
ThanksColin

_
What can you do with the new Windows Live? Find out
http://www.microsoft.com/windows/windowslive/default.aspx___

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


iPhone-detecting call event...

2009-09-02 Thread Farooq zaman

Hi All,

Is it possible to detect phone-call event on iPhone? If yes, what are  
the available APIs?


Any help would be highly appreciated,
Farooq-
___

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


Binding custom properties in NSCollectionView?

2009-09-02 Thread Rick Mann
Hi. I'm trying to use NSCollectionView. In my NSCollectionViewItem's  
view, I'd like to have a custom view and bind some of its properties  
to properties in the NSCollectionViewItems's represented object.


Bindings exposed in IB are easy to hook up. I'm not sure where to put  
code to connect create other bindings, and where to get the requisite  
objects to which to bind.


Can anyone enlighten me?

TIA,
Rick

___

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: Larger "round button" in Interface Builder?

2009-09-02 Thread Graham Cox


On 03/09/2009, at 8:51 AM, Gabriel Zachmann wrote:


Thanks a lot for your response and for the hint!

The main reason why I chose the bevel buttons is that I need a row  
of large buttons.



You might consider writing a custom button cell class. Then you can  
make them look however you want. Depending on how much you override,  
you can alter an existing design in a subtle way or make something  
completely new. Go wild! Button cells are fairly straightforward, and  
you are still able to use the underlying button control logic so it's  
not like writing a complete button from scratch.


I did this recently for a button I'm using in a NSMatrix and the  
resulting cell class was only a couple of methods.


--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: NSTask flaky about posting terminate notification, in 10.6

2009-09-02 Thread Adam R. Maxwell


On Sep 2, 2009, at 3:39 PM, Jens Alfke wrote:



On Sep 2, 2009, at 3:25 PM, Dave Keck wrote:

o Recently I've found myself rolling my own solutions to problems  
such

as yours, in order to guarantee its level of robustness.


I've been resisting giving up on NSTask, but it might be necessary.  
Is your code open-source or otherwise available?


I reimplemented NSTask last year to work around a race condition  
(failure to exec under some conditions, possibly only on 10.4).  The  
code is BSD licensed, and available at


http://code.google.com/p/mactlmgr/source/browse/trunk/BDSKTask.m

I also have a subclass for synchronously reading stdout/stderr, and I  
recently had to reimplement -[NSFileHandle  
readToEndOfFileInBackgroundAndNotifyForModes] to work around a problem  
on 10.6.


http://code.google.com/p/mactlmgr/source/browse/trunk/TLMTask.m

Hope that's useful.  Cocotron also has an implementation, but last I  
checked it used Foundation in a signal handler and after fork().





smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: I can't find it in the docs so I know I'm missing it some where

2009-09-02 Thread Michael Ash
On Wed, Sep 2, 2009 at 4:41 PM, Harry Jordan wrote:
> There' s a good reason to enforce the 99 cent rule. Imagine a scenario in
> which a user downloads an app that is advertised as free, only to find that
> it's crippled beyond use without a subscription to a service or an internal
> upgrade. That's no way to build trust in the App Store.
>
> Yes, Apple could add a third category of 'subscription' apps but there are
> so many edge cases that it's just adding unnecessary complexity for the
> users. If your going to subscribe to a service for months or years, then a
> $1 startup fee really isn't a very big hurdle in my opinion.

A completely innocent, non-loaded question: is paying for an app and
then discovering that it's crippled beyond use unless you pay even
more better or worse than doing this same thing with one that was free
to download?

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: What's the purpose of the "fax" received action?

2009-09-02 Thread Tim McGaughy


On Sep 2, 2009, at 2:58 PM, M Pulis wrote:



On Sep 2, 2009, at 9:10 AM, Tim McGaughy wrote:



On Aug 25, 2009, at 8:19 AM, Andy Lee wrote:



On Aug 25, 2009, at 8:29 AM, Graham Cox wrote:



On 24/08/2009, at 5:57 PM, Behrang Saeedzadeh wrote:


Hi all,

What's the purpose of the "fax" received action in NSTableView and 
is it

documented somewhere at all? Did a quick search
and couldn't find its documentation.



Not sure where you're using this as it's not in my headers for 
NSTableView.


I'm guessing Behrang saw it in IB.  If I Control-drag from a button 
to any view I see fax: among the possible received actions.


I think once upon a time "Fax" was a button on the print dialog.


Yes, until 10.3. Seems to have been dropped on 10.4. I'm running both 
on various computers around here and just checked it.


Check the PDF button menu for "Fax PDF" in the lower left?


Ah. There it is. It is on 10.4, just got moved.

___

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: Larger "round button" in Interface Builder?

2009-09-02 Thread Gabriel Zachmann

In my GUI, I am arranging a row of the so-called "bevel buttons" of
Interface Builder at the bottom of the window.


Bevel buttons have fallen out of favor, and the HIG recommends you
consider alternatives:



Thanks a lot for your response and for the hint!

The main reason why I chose the bevel buttons is that I need a row of  
large buttons.


The GUI will be overlayed over a Powerpoint presentation, it should  
feel very simple, and the buttons should be such that the presenter  
can't miss them ;-)



Though this list isn't really for interface design discussions, you
might want to post a screenshot.  Someone might be able to offer a



That would be very kind.

Here is a screenshot: http://zach.in.tu-clausthal.de/tmp/screenshot.png
Note the semi-transparent buttons at the bottom right.

Best regards,
Gabriel.



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: What's actually important to do before exiting?

2009-09-02 Thread Jens Alfke


Erik Buck wrote:

- NFS file locks may tie up a file for several minutes when  
processes terminate incorrectly.


That should only be an issue if there's a kernel panic or network  
partition; the filesystem manages locking and unlocking remote NFS  
files just like local files, and removes the locks when a process exits.


- Socket's left open may tie up a port for several minutes when  
processes terminate incorrectly.


That's what SO_REUSEADDR is for...

—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: NSTask flaky about posting terminate notification, in 10.6

2009-09-02 Thread Jens Alfke


On Sep 2, 2009, at 3:25 PM, Dave Keck wrote:


o Recently I've found myself rolling my own solutions to problems such
as yours, in order to guarantee its level of robustness.


I've been resisting giving up on NSTask, but it might be necessary. Is  
your code open-source or otherwise available?



After a cursory read over your code, I'm wondering why you need to
wait for the process to exit, and couldn't just wait for a
notification to be sent and deal with it when the time comes


MYTask is just a general-purpose utility that can be called  
asynchronously or synchronously. Murky calls it in both ways.  
Asynchronous is better, of course, but it's also harder to write, so  
there are synchronous calls left in the code. If I ever decide to make  
Murky require 10.6, it'd be fun to fix that by using blocks.


—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: What's actually important to do before exiting?

2009-09-02 Thread Jean-Daniel Dupas


Le 2 sept. 2009 à 23:11, Erik Buck a écrit :

- Posix message queues are a finite kernal resource that is not  
freed when processes terminate incorrectly.
- Posix semaphores are a finite kernal resource that is not freed  
when processes terminate incorrectly.
- MACH IPC message queues are a finite kernal resource that is not  
freed when processes terminate incorrectly.


I'm almost sure Mach ports don't have to be properly closed before  
process end.


- Socket's left open may tie up a port for several minutes when  
processes terminate incorrectly.
- NFS file locks may tie up a file for several minutes when  
processes terminate incorrectly.
- The /tmp directory can be littered with junk until the next reboot  
or cron job when processes terminate incorrectly.


Few Cocoa programmers ever deal directly with the above system  
resources, but I am a Cocoa programmer, and I use them every day


Unix is generally good about cleaning up when processes exit, but  
there are holes large enough to drive trucks through.

___

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/devlists%40shadowlab.org

This email sent to devli...@shadowlab.org



-- Jean-Daniel




___

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: NSTask flaky about posting terminate notification, in 10.6

2009-09-02 Thread Dave Keck
In the past I've also had some issues with NSTask, its 'isRunning'
property and NSTaskDidTerminateNotification, albeit on 10.5. Here's
two notes based on what I've experienced:

o Recently I've found myself rolling my own solutions to problems such
as yours, in order to guarantee its level of robustness. To check
whether this is necessary, I'd recommend the usual tactic of whittling
down your code to the smallest example possible that still exhibits
the problem. In doing so you'll likely gain some insight into where
the problem is, and if not, at least you'll have an example project
ready for a bug report.

o Can you use waitpid() instead of polling? Or do you need the run
loop to be running while you're polling, waiting for the process to
exit?

And a general design comment:

After a cursory read over your code, I'm wondering why you need to
wait for the process to exit, and couldn't just wait for a
notification to be sent and deal with it when the time comes (assume
for a second that the notification is always sent.) In cases such as
this, refactoring my own code to be more event-driven has been the
better choice overall. Of course, every case is different...

But that doesn't solve your problem of the notification not being sent
in the first place: if and when you've verified that the bug isn't in
your code, I'd recommend rolling your own using a separate thread with
either waitpid() or a kqueue.
___

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: Larger "round button" in Interface Builder?

2009-09-02 Thread Kyle Sluder
On Wed, Sep 2, 2009 at 2:30 PM, Gabriel Zachmann wrote:
> In my GUI, I am arranging a row of the so-called "bevel buttons" of
> Interface Builder at the bottom of the window.

Bevel buttons have fallen out of favor, and the HIG recommends you
consider alternatives:
http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGControls/XHIGControls.html#//apple_ref/doc/uid/TP3359-TPXREF112

> Does anyone know how I can make the round button as large as the others?

You cannot.

> Or where I can find a large round button, and how I can use it in IB?

Large, round buttons are not part of the Cocoa interface.  You should
consider some other means of distinguishing this UI element.

Though this list isn't really for interface design discussions, you
might want to post a screenshot.  Someone might be able to offer a
suggestion of a different UI control you could use.

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


Larger "round button" in Interface Builder?

2009-09-02 Thread Gabriel Zachmann
In my GUI, I am arranging a row of the so-called "bevel buttons" of  
Interface Builder at the bottom of the window.


Because the right one will be a very special one, I would like to make  
it visually very different; so I would like to use the "round button"  
for it, but this is much smaller than the bevel buttons, which looks  
awkward.


Does anyone know how I can make the round button as large as the others?
Or where I can find a large round button, and how I can use it in IB?

Any hints, insights, and pointers will be highly appreciated.

Thanks a lot in advance.


Best regards,
Gabriel.










smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: What's actually important to do before exiting?

2009-09-02 Thread Erik Buck
- Posix message queues are a finite kernal resource that is not freed when 
processes terminate incorrectly.
- Posix semaphores are a finite kernal resource that is not freed when 
processes terminate incorrectly.
- MACH IPC message queues are a finite kernal resource that is not freed when 
processes terminate incorrectly.
- Socket's left open may tie up a port for several minutes when processes 
terminate incorrectly.
- NFS file locks may tie up a file for several minutes when processes terminate 
incorrectly.
- The /tmp directory can be littered with junk until the next reboot or cron 
job when processes terminate incorrectly.

Few Cocoa programmers ever deal directly with the above system resources, but I 
am a Cocoa programmer, and I use them every day

Unix is generally good about cleaning up when processes exit, but there are 
holes large enough to drive trucks through.
___

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: I can't find it in the docs so I know I'm missing it some where

2009-09-02 Thread Harry Jordan
There' s a good reason to enforce the 99 cent rule. Imagine a scenario  
in which a user downloads an app that is advertised as free, only to  
find that it's crippled beyond use without a subscription to a service  
or an internal upgrade. That's no way to build trust in the App Store.


Yes, Apple could add a third category of 'subscription' apps but there  
are so many edge cases that it's just adding unnecessary complexity  
for the users. If your going to subscribe to a service for months or  
years, then a $1 startup fee really isn't a very big hurdle in my  
opinion.


Harry
http://inquisitivesoftware.com/

On 31 Awst 2009, at 18:05, Development wrote:

Wow. that really needs to change. Subscription services or what not  
cant use the store then since most of those are free downloads. Ah  
well. Back to paypal.


On Aug 31, 2009, at 9:46 AM, Luke the Hiesterman wrote:

Free apps cannot use in-app purchase. You must charge at least 99  
cents.


Luke

On Aug 31, 2009, at 9:44 AM, Development wrote:

Are apps that are offered for free not allowed to use the store  
kit? It seems foolish to have an app the requires a subscription  
that is not a free download.

___

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/luketheh 
%40apple.com


This email sent to luket...@apple.com




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoaharry%40googlemail.com

This email sent to cocoaha...@googlemail.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: What's actually important to do before exiting?

2009-09-02 Thread Bill Bumgarner

On Sep 2, 2009, at 1:26 PM, Sidney San Martín wrote:

It's well-established that some tasks, like deallocating memory, are
totally unnecessary before your application exits, but others, like
calling asl_close() if you've called asl_open() earlier, are less
established.

With the advent of sudden termination, knowing what needs to be done
before exiting or being SIGKILLed, and what constitutes clean or dirty
state, has become even more important.

What should I be concerned about?


Unsaved user state.

That is about it.

The system should otherwise be hardened against spontaneous  
termination of processes.  To not be invites DoS attacks, at the  
least, or opens security holes, at the worst.


What Sudden Termination drives home, though, is that sudden  
termination is something all processes should have always supported;   
many a user is all about force quit or hold down the power off button  
to shut down the machine.  Scary, but true.


There isn't much you can do about document data in a non-autosaving  
environment, but there is more user state that is often not persisted  
until termination to think about.  User defaults, for example.  If you  
have a default that has changed, consider forcing it to be persisted  
more often than just termination.  Certainly, you'll want to do so if  
you want to fully embrace sudden termination.


b.bum


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


What's actually important to do before exiting?

2009-09-02 Thread Sidney San Martín
It's well-established that some tasks, like deallocating memory, are
totally unnecessary before your application exits, but others, like
calling asl_close() if you've called asl_open() earlier, are less
established.

With the advent of sudden termination, knowing what needs to be done
before exiting or being SIGKILLed, and what constitutes clean or dirty
state, has become even more important.

What should I be concerned about?
___

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


NSTask flaky about posting terminate notification, in 10.6

2009-09-02 Thread Jens Alfke
After upgrading to 10.6 I started seeing problems with my app Murky,  
which uses NSTask to run the Mercurial version-control tool. What  
seems to be going on is that an asynchronous NSTask sometimes (maybe  
5% of the time?) fails to post its NSTaskDidTerminateNotification.  
When this happens I see the task's stdout and stderr file descriptors  
being closed, and if I check the task's isRunning property it returns  
NO, but the notification never arrives. Unfortunately this leads to  
infinite loops in situations where I'm spinning the runloop waiting  
for the task to finish.


This seems like a regression in NSTask. I had never seen it before in  
10.5, and I've debugged a bit to check if I was doing anything wrong;  
I found some issues with the way I was polling the runloop, and have  
added a partial workaround for the problem, but something still seems  
wrong in NSTask itself.


You can see my code here:
http://bitbucket.org/snej/myutilities/src/5cab3034d3a1/MYTask.m
Line 195 adds an observer for the notification, line 200 launches the  
task, the notification handler's at 275. The runloop polling is at 331.


—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: What's the purpose of the "fax" received action?

2009-09-02 Thread M Pulis


On Sep 2, 2009, at 9:10 AM, Tim McGaughy wrote:



On Aug 25, 2009, at 8:19 AM, Andy Lee wrote:



On Aug 25, 2009, at 8:29 AM, Graham Cox wrote:



On 24/08/2009, at 5:57 PM, Behrang Saeedzadeh wrote:


Hi all,

What's the purpose of the "fax" received action in NSTableView  
and is it

documented somewhere at all? Did a quick search
and couldn't find its documentation.



Not sure where you're using this as it's not in my headers for  
NSTableView.


I'm guessing Behrang saw it in IB.  If I Control-drag from a button  
to any view I see fax: among the possible received actions.


I think once upon a time "Fax" was a button on the print dialog.


Yes, until 10.3. Seems to have been dropped on 10.4. I'm running  
both on various computers around here and just checked it.


Check the PDF button menu for "Fax PDF" in the lower left?
Gary
___

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


Contextual Menus in Snow Leopard

2009-09-02 Thread Knut Lorenzen

This appears to be the final word on Contextual Menus in Snow Leopard:





Cheers,

Knut



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Problem with NSFileManager

2009-09-02 Thread Ken Thomases

Moving this to Cocoa-Dev where it's appropriate...

On Sep 2, 2009, at 1:50 PM, K. Chen wrote:


I ran into a weird situation with NSFileMnager.

First my code want to see if a file already exists
if (![fileManager fileExistsAtPath:myConfigFile])
the result is NO, so my code goes into the if block

Then my code tries to copy the file over from the bundle; note the  
the destination is under /Documents.
if (![fileManager copyItemAtPath:configFilePath toPath:myConfigDir  
error:&err])
Here I got the error message from [NSError localizedDescription]  
saying: Operation could not be completed. File exists.


Well first FM told me the file doesn't exist and then when I tried  
to copy, it said it already exists???


Well, you're checking myConfigFile but then copying to myConfigDir.   
Based on the docs for the older -copyPath:toPath:handler: method, I  
don't think -copyItemAtPath:toPath:error: implicitly creates a same- 
named file in the destination directory.  The destination is taken  
literally.  Since the directory does exist, that explains the error.   
So, you need to copy to myConfigFile rather than myConfigDir.


You should also just abandon the check for the existence of  
myConfigFile in advance.  It doesn't help, since some other process  
can create the file between when you check for it and when you try to  
create it with the copy.  Just attempt the copy and cope with a  
failure due to a file existing at the destination.


Regards,
Ken

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Core Data migration from xml to sqlite

2009-09-02 Thread Adam Swift


On Sep 2, 2009, at 4:51 AM, Ian Kennedy wrote:


Hi all,

How would I go about doing a one-time migration of application data  
from an xml persistent store to a sqlite persistent store? i.e. the  
model stays the same, the data is migrated, and the app uses the  
sqlite store from there on out.


I've been unsuccessfully trying to do it inside of the  
persistentStoreCoordinator method by working with the example from  
here: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CoreData/Articles/cdUsingPersistentStores.html


Here is what I've tried, which doesn't migrate any data, just  
provides me with an empty sqlite store:


http://pastie.textmate.org/602152



NSPersistentStore *xmlStore = [persistentStoreCoordinator  
persistentStoreForURL:xmlUrl];
NSPersistentStore *sqliteStore = [persistentStoreCoordinator  
migratePersistentStore:xmlStore toURL:sqliteUrl options:nil  
withType:NSSQLiteStoreType error:&error];


persistentStoreCoordinator = [[NSPersistentStoreCoordinator  
alloc] initWithManagedObjectModel: [self managedObjectModel]];


persistentStoreCoordinator is nil when you attempt the migration.

Code defensively!  You should be checking that he xmlStore is non-nil  
before attempting migration, that the sqliteStore is non nil after  
migration and presenting the error if one occurs.



Thanks for any help,
Ian
___

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/aswift%40apple.com

This email sent to asw...@apple.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Macros

2009-09-02 Thread Kyle Sluder
It's more of a language issue than an Xcode issue.  (That is, you need
to understand the language part before you can set up the Xcode part.)

Start here: 
http://www2.its.strath.ac.uk/courses/c/subsection3_13_4.html#SECTION00013400

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

2009-09-02 Thread Steve Christensen
Wouldn't this be better asked on the xcode-users mailing list  
(assuming you're talking about Xcode debug/release builds)? It  
doesn't have anything to do with Cocoa.



On Sep 2, 2009, at 8:54 AM, Development wrote:

Ok I cannot find an example of how to do this online so I'nm asking  
here.
I was never any good at writing macros but I have a bool that needs  
to be yes if the current build is debug and no if it is release and  
I'm not sure how to write the macro for that. Could some one point  
me at a macro example that might show that?

___

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: NSOutlineView Source List not looking like expected

2009-09-02 Thread Corbin Dunn


On Sep 2, 2009, at 8:45 AM, Florian Soenens wrote:


Hi Corbin,

i actually followed the example and if you look closely, it doesn't  
exactly match mail.app SourceList either.
That's why i thought some custom implementation was going on in the  
other Apple apps.


If i find the time i will post some screenshots to show the  
difference.


It looks identical to me. Mail.app uses a standard NSTableView in  
Leopard+.


http://developer.apple.com/mac/library/samplecode/SourceView/index.html

corbin

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: drawing my image in snow leopard

2009-09-02 Thread Steve Christensen

Does this not do what you want?

[myImage drawInRect:NSIntegralRect(myCenteredRect) fromRect:...];

steve


On Sep 2, 2009, at 9:22 AM, Rick C. wrote:

thank you markus i do see that now.  since my icon centers the  
numbers will always change.  this should be obvious but what would  
be the least memory intensive way to constantly round this number...


center.x = bounds.width *.5

if center.x is a round number it works as you say.  i'm probably  
missing the obvious as usual but i'm having a bit of trouble to  
round/truncate the cgfloat...


thanks again,

rick


From: Markus Spoettl 
To: cocoa dev 
Sent: Wednesday, September 2, 2009 8:17:56 PM
Subject: Re: drawing my image in snow leopard

On Sep 2, 2009, at 12:33 PM, Rick C. wrote:
i've been using NSImage drawInRect:fromRect:operation:fraction: to  
draw and center my .icns image in a resizable custom view for some  
time without issues.  now in snow leopard the same code works,  
however when the custom view is at its minimum size the image is  
slightly blurry.  when i resize the custom view to full size the  
image is fine.  seems to be maybe scaling but i'm not rescaling  
the image the size is constant.  of course the view is being  
resized.  i just checked again in leopard and this is not an  
issue.  i'm thinking i need to add something in my code to keep up  
with changes in snow leopard but i haven't yet figured out what  
that might be.  if anyone needs some code i can post it.  thank you,


The AppKit release notes state that with 10.6 the image destination  
coordinates are no longer rounded to integral values. Just round x  
and y of your destination rect and the image should appear sharp  
like before.


___

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: drawing my image in snow leopard

2009-09-02 Thread Rick C.
thank you markus i do see that now.  since my icon centers the numbers will 
always change.  this should be obvious but what would be the least memory 
intensive way to constantly round this number...

center.x = bounds.width *.5

if center.x is a round number it works as you say.  i'm probably missing the 
obvious as usual but i'm having a bit of trouble to round/truncate the 
cgfloat...

thanks again,

rick






From: Markus Spoettl 
To: cocoa dev 
Sent: Wednesday, September 2, 2009 8:17:56 PM
Subject: Re: drawing my image in snow leopard

On Sep 2, 2009, at 12:33 PM, Rick C. wrote:
> i've been using NSImage drawInRect:fromRect:operation:fraction: to draw and 
> center my .icns image in a resizable custom view for some time without 
> issues.  now in snow leopard the same code works, however when the custom 
> view is at its minimum size the image is slightly blurry.  when i resize the 
> custom view to full size the image is fine.  seems to be maybe scaling but 
> i'm not rescaling the image the size is constant.  of course the view is 
> being resized.  i just checked again in leopard and this is not an issue.  
> i'm thinking i need to add something in my code to keep up with changes in 
> snow leopard but i haven't yet figured out what that might be.  if anyone 
> needs some code i can post it.  thank you,


The AppKit release notes state that with 10.6 the image destination coordinates 
are no longer rounded to integral values. Just round x and y of your 
destination rect and the image should appear sharp like before.

Regards
Markus
--
__
Markus Spoettl


  
___

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: Finder-style sorting and the SQL Core Data store, best practice?

2009-09-02 Thread Dave Fernandes

Here's what I came up with (subclass NSArrayController).

// Override to strip off the sort descriptor and sort in memory.
- (BOOL)fetchWithRequest:(NSFetchRequest*)fetchRequest merge:(BOOL)merge
error:(NSError**)error
{
// Copy fetch request without sort descriptor.
	NSFetchRequest* strippedRequest = [[fetchRequest copyWithZone:NULL]  
autorelease];

[strippedRequest setSortDescriptors:nil];

// Fetch without sort descriptor.
BOOL success = [super fetchWithRequest:strippedRequest merge:merge
error:error];

// Sort in memory.
// *** Not needed when bound to NSTableColumn in a table view. (?)
//[super setSortDescriptors:[fetchRequest sortDescriptors]];
//[super rearrangeObjects];

return success;
}

Note that I did not even need the commented out code to sort in  
memory. The table column seems to do this for you, if that is what  
your array controller is bound to. However, I have only tested on  
Tiger and Leopard.


Cheers,
Dave

On 1-Sep-09, at 5:51 PM, Sean McBride wrote:


Melissa,

Thanks for your speedy reply.

That's great news that SnowLeopard supports those!  Could you  
elaborate

on performance implications?  Does the SQL layer now support fancy
sorting?  Or is fancy sorting done after results are retrieved from  
the

database?

Alas, I must support ppc so I'd still be interested to know how to
subclass NSArray/TreeController... anyone? :)

Cheers,

Sean


On 9/1/09 2:43 PM, Melissa J. Turner said:


As of SnowLeopard, Core Data supports the following selectors for
sorting in the SQLite store:

compare: (since Tiger(I think))
caseInsensitiveCompare: (since Leopard)
localizedCompare: (new in SL)
localizedCaseInsensitiveCompare: (new in SL)
localizedStandardCompare: (new in SL)

The last comparison type is new to the OS in SL, and will get you the
system standard sort as done by Finder.

As to subclassing NSArrayController, I'll leave that to people with
more UI-fu.

+Melissa


On Sep 1, 2009, at 13:10, Sean McBride wrote:


Hi all,

The "Troubleshooting Core Data" document discusses the FAQ "SQLite
store
does not work with sorting".  It suggests: "you may need to subclass
NSArrayController so you can have it not pass the sort descriptors  
to

the database and instead do the sorting after your data has been
fetched". [1]

I imagine this must have been done many times over by many people.
Try
as I may, I cannot find any example code, or even a more detailed
discussion of what to override.  I fear there may be edge cases
overriding such an important class, so want to be careful.

My ultimate goal is for all table and outline views in my app to  
sort

"correctly" (ie like the Finder[2]).

What is the correct way to achieve this?

[1] 
[2] 



___

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/dave.fernandes%40utoronto.ca

This email sent to dave.fernan...@utoronto.ca


___

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: Finder contextual menu plugin 10.6

2009-09-02 Thread Jean-Daniel Dupas


Le 2 sept. 2009 à 14:10, Marco Cassinerio a écrit :


Hi,

so far i've build finder plugin using Carbon and SampleCMPlugin code  
example.
Now, with 10.6, Carbon support has been dropped. So, how can i  
create a finder plugin that works only on 10.6?



Use System Services:

http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/SysServices/introduction.html


___

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's the purpose of the "fax" received action?

2009-09-02 Thread Tim McGaughy


On Aug 25, 2009, at 8:19 AM, Andy Lee wrote:



On Aug 25, 2009, at 8:29 AM, Graham Cox wrote:



On 24/08/2009, at 5:57 PM, Behrang Saeedzadeh wrote:


Hi all,

What's the purpose of the "fax" received action in NSTableView and 
is it

documented somewhere at all? Did a quick search
and couldn't find its documentation.



Not sure where you're using this as it's not in my headers for 
NSTableView.


I'm guessing Behrang saw it in IB.  If I Control-drag from a button to 
any view I see fax: among the possible received actions.


I think once upon a time "Fax" was a button on the print dialog.


Yes, until 10.3. Seems to have been dropped on 10.4. I'm running both 
on various computers around here and just checked 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


Macros

2009-09-02 Thread Development
Ok I cannot find an example of how to do this online so I'nm asking  
here.
I was never any good at writing macros but I have a bool that needs to  
be yes if the current build is debug and no if it is release and I'm  
not sure how to write the macro for that. Could some one point me at a  
macro example that might show that?

___

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: NSOutlineView Source List not looking like expected

2009-09-02 Thread Florian Soenens

Hi Corbin,

i actually followed the example and if you look closely, it doesn't  
exactly match mail.app SourceList either.
That's why i thought some custom implementation was going on in the  
other Apple apps.


If i find the time i will post some screenshots to show the difference.

Thanks,
Florian.

On 02 Sep 2009, at 17:34, Corbin Dunn wrote:


You should see the source list example on the dev site.

are you implementing the isGroupRow method and returning YES? You  
need to do that for the group/title rows.


corbin

On Sep 2, 2009, at 2:41 AM, Florian Soenens wrote:


Hi list,

in our app i implemented an NSOutlineView set to SourceList in IB.
I implemented the datasource method to set the group items etc but  
my group items (the ones in uppercase like mail.app, iTunes etc...)  
don't look exactly like the ones seen in the other Apple apps.
What i mean is, the font looks bigger, a little darker and the  
hilight around (or under) the text is not as bright like the Apple  
apps.


Is anyone experiencing the same? Does Apple and other developers  
implement something custom?
I have set the fontsize of my cell to 11 in IB and the controlSize  
to NSSmallControlSize but to no avail.


Thanks in advance for the help.
Florian.


Looking for Web-to-Print Solutions?
Visit our website :   http://www.vit2print.com


This e-mail, and any attachments thereto, is intended only for use  
by the addressee(s) named herein and may contain legally privileged  
and/or confidential information and/or information protected by  
intellectual property rights.
If you are not the intended recipient, please note that any review,  
dissemination, disclosure, alteration, printing, copying or  
transmission of this e-mail and/or any file transmitted with it, is  
strictly prohibited and may be unlawful.
If you have received this e-mail by mistake, please immediately  
notify the sender and permanently delete the original as well as  
any copy of any e-mail and any printout




Looking for Web-to-Print Solutions?
Visit our website :   http://www.vit2print.com


This e-mail, and any attachments thereto, is intended only for use by the 
addressee(s) named herein and may contain legally privileged and/or 
confidential information and/or information protected by intellectual property 
rights.
If you are not the intended recipient, please note that any review, 
dissemination, disclosure, alteration, printing, copying or transmission of 
this e-mail and/or any file transmitted with it, is strictly prohibited and may 
be unlawful.
If you have received this e-mail by mistake, please immediately notify the 
sender and permanently delete the original as well as any copy of any e-mail 
and any printout thereof.
We may monitor e-mail to and from our network.

NSS nv Tieltstraat 167 8740 Pittem Belgium 
___


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: Need a launch/loading screen to be displayed while app is starting/initializing?

2009-09-02 Thread Graham Cox


On 03/09/2009, at 1:28 AM, Michael A. Crawford wrote:

Anyway, I thought of changing the structure of my app so that the  
main nib displays the startup and then loads what used to be my main  
nib with my primary view, menu, etc.  I'm not experienced enough  
with AppKit to know whether or not that is a good approach.



Just add a startup panel and, if there is one, a controller for it to  
your main nib. You'd probably want to hook it into your app delegate  
so it can be taken down when launching finishes. There's nothing to  
stop you having multiple windows in a single nib, and in this case  
that would definitely be the simplest thing.


--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: NSOutlineView Source List not looking like expected

2009-09-02 Thread Corbin Dunn

You should see the source list example on the dev site.

are you implementing the isGroupRow method and returning YES? You need  
to do that for the group/title rows.


corbin

On Sep 2, 2009, at 2:41 AM, Florian Soenens wrote:


Hi list,

in our app i implemented an NSOutlineView set to SourceList in IB.
I implemented the datasource method to set the group items etc but  
my group items (the ones in uppercase like mail.app, iTunes etc...)  
don't look exactly like the ones seen in the other Apple apps.
What i mean is, the font looks bigger, a little darker and the  
hilight around (or under) the text is not as bright like the Apple  
apps.


Is anyone experiencing the same? Does Apple and other developers  
implement something custom?
I have set the fontsize of my cell to 11 in IB and the controlSize  
to NSSmallControlSize but to no avail.


Thanks in advance for the help.
Florian.


Looking for Web-to-Print Solutions?
Visit our website :   http://www.vit2print.com


This e-mail, and any attachments thereto, is intended only for use  
by the addressee(s) named herein and may contain legally privileged  
and/or confidential information and/or information protected by  
intellectual property rights.
If you are not the intended recipient, please note that any review,  
dissemination, disclosure, alteration, printing, copying or  
transmission of this e-mail and/or any file transmitted with it, is  
strictly prohibited and may be unlawful.
If you have received this e-mail by mistake, please immediately  
notify the sender and permanently delete the original as well as any  
copy of any e-mail and any printout

___

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


Need a launch/loading screen to be displayed while app is starting/initializing?

2009-09-02 Thread Michael A. Crawford
I'm looking for techniques on how to display a startup or loading  
panel for my app.  There is some initial processing that needs to be  
done and it can sometimes be moderately lengthy in terms of making the  
user wait.


What I'd like to do is display a startup graphic with licensing and  
copyright information as well as perhaps some updating text fields.   
Well, maybe I'll add the updating text fields later.


Anyway, I thought of changing the structure of my app so that the main  
nib displays the startup and then loads what used to be my main nib  
with my primary view, menu, etc.  I'm not experienced enough with  
AppKit to know whether or not that is a good approach.


Any suggestions?  It looks like there are plenty of applications that  
do this sort of thing on startup.  How do you guys implement this type  
of behavior?


-Michael




___

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 get a managedObjectContext in a nib file

2009-09-02 Thread Michael Thon


On Sep 2, 2009, at 4:16 PM, Sean Kline wrote:

To what entity is your Array Controller bound? (just checking to see  
if you did this...forgive the question if it is too basic)


I finally got it working.  Instead of having the window controller set  
its own managedObjectContext in awakeFromNib, I passed it one right  
after I call init, but before awakeFromNib is called:


	TNSManageCollectionsWindowController *m =  
[[TNSManageCollectionsWindowController alloc] init];
	NSManagedObjectContext *moc = [[[NSApplication sharedApplication]  
delegate] managedObjectContext];

[m setManagedObjectContext:moc];
if (![NSBundle loadNibNamed:@"ManageCollectionsWindow" owner:m]) {
NSLog(@"error loading the ManageCollectionsWindow nib");
}
___

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


My NSUndoManager subclass is broken on SL - how to fix?

2009-09-02 Thread Graham Cox
My app subclasses NSUndoManager, so that it can provide a couple of  
extra things to the app, namely, task coalescing and a change count  
that I track to see if certain operations which come from a wide  
variety of places actually submitted an undo task (and hence the undo  
manager itself is the one central place that knows about them).


On 10.6, While Undo is still generally working, the stuff my class  
added are not. In trying to track this down, I was getting some very  
puzzling results, like none of my breakpoints were firing in my  
subclass's override for -forwardInvocation. Then I spot this note in  
the docs:


"On Mac OS X v10.6 and later, this method (- 
prepareWithInvocationTarget:) returns a proxy object for the receiver  
that forwards all messages to the receiver as undo operations."


OK, I understand why that was done, but how can I alter my code so it  
works for this non-backwards-compatible situation? It seems this  
mysterious proxy object is forwarding to some private method of  
NSUndoManager that I can't override, so it's bypassing my very useful  
additions. I need to know where I can hook into whatever this proxy  
object delivers the task to the U/M.


Any ideas?

--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: how to get a managedObjectContext in a nib file

2009-09-02 Thread Sean Kline
To what entity is your Array Controller bound? (just checking to see if you
did this...forgive the question if it is too basic)

On Wed, Sep 2, 2009 at 7:53 AM, Michael Thon  wrote:

> I created a new nib file in my project and in that nib file I need an array
> controller bound to my app's managed object context.   I made an instance of
> AppDelegate in the nib file and bound to that.  The array controller works
> except that entities added to the array are not being permanently saved to
> the store.  Maybe making a new instance of AppDelegate is not the thing to
> do.
> Next, I made File's Owner in the nib file my subclass of
> NSWindowController.  Then I made a managedObjectContext property and in
> awakeFromNib I set that value with :
>
> managedObjectContext = [[[NSApplication sharedApplication] delegate]
> managedObjectContext];
>
> I thought that would work but when I instantiate the nib I get this error:
>
>Cannot perform operation without a managed object context
>
> Maybe the NSArrayController is trying to do its thing before awakeFromNib
> is called?  In any case, that obviously isn't the right way to do it either.
>  Can anyone tell me how to get a reference to my managed object context in
> my nib file?
> Thanks
> Mike
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/skline1967%40gmail.com
>
> This email sent to skline1...@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: contextual menu plugin example in cocoa

2009-09-02 Thread Stephane Madrau

On 01.09.2009 21:02, cocoa-dev-requ...@lists.apple.com wrote:


Jean-Daniel Dupas wrote:



Yes. CM are deprecated (means do not work at all in Snow Leopard) and
should be rewrote as Services. (see Services Programming Guide)


That is exactly the kind of little, but spot on comment I find so sorely
missing during the NDA period. Thanks!


It was known since a long time, not under NDA, even for SnowLeopard.

See
http://lists.apple.com/archives/carbon-dev/2009/Apr//msg00075.html
and the ongoing thread about this subject

(Reading the "other" (meaning "Carbon") list is (still) sometimes useful 
:-) )


--
Stephane
___

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: Changes in KVO behavior on SL?

2009-09-02 Thread Derek Chesterfield


On 2 Sep 2009, at 13:47, Kevin Brock wrote:

Likewise, there's never been any guarantee that invoking - 
observeValueForKeyPath:ofObject:change:context: will provoke the  
receiver to call -valueForKeyPath: on the object whose property has  
changed.  If the observer wants, it can rely totally on the  
information in the change dictionary.  If you were using will/ 
didChange..., then KVO can be expected to invoke valueForKey: on  
the object whose property is changing, but that's not what (you  
say) you're doing.


Thanks.  That was helpful.  On 10.5 the receiver *does* apparently  
always call valueForKeyPath, at least with the receivers we're  
talking to.  Maybe they weren't checking the dictionary on 10.5, or  
were calling the fn if the data on the new values wasn't found in  
the dictionary, but are being stricter on 10.6.


Ken didn't contradict the behaviour you have observed. But you are  
[were] relying on a mechanism that is undocumented and quite possibly  
accidental on the part of Apple's engineers, and so could have changed  
at any time, or might have been erratic/fragile even on 10.5.


In other words, it is merely fortunate that your app ever worked on  
10.5, and not by design  ;-)
The documented pattern that Ken described should work on both 10.5 and  
10.6, and will always work... until deprecated anyway!

___

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: Changes in KVO behavior on SL?

2009-09-02 Thread Kevin Brock


On Sep 1, 2009, at 6:11 PM, Ken Thomases wrote:


On Sep 1, 2009, at 7:14 PM, Kevin Brock wrote:

We've got an app that is using keyValueForPath: and  
observeValueForKeyPath:ofObject:change:context: to keep a status  
window up-to-date.


On 10.5 it works fine.  On 10.6 keyValueForPath: is called exactly  
once per property.  When we later create a change dictionary and  
send observeValueForKeyPath:ofObject:change:context: to the  
observer for a property, valueForKeyPath: isn't called again.


Huh?  You have never been supposed to call - 
observeValueForKeyPath:ofObject:change:context: yourself, nor  
construct change dictionaries.  When a property changes in a way  
that KVO can't automatically track, you are supposed to call -will/ 
didChangeValueForKey: (or the corresponding will/didChange...  
methods for set or array mutation) and KVO will generate the change  
notification itself.


Good to know.   I'll give that a try.  Lot of legacy code in that part  
of the app--I doubt that this is the last thing I'll run into.


Likewise, there's never been any guarantee that invoking - 
observeValueForKeyPath:ofObject:change:context: will provoke the  
receiver to call -valueForKeyPath: on the object whose property has  
changed.  If the observer wants, it can rely totally on the  
information in the change dictionary.  If you were using will/ 
didChange..., then KVO can be expected to invoke valueForKey: on the  
object whose property is changing, but that's not what (you say)  
you're doing.


Thanks.  That was helpful.  On 10.5 the receiver *does* apparently  
always call valueForKeyPath, at least with the receivers we're talking  
to.  Maybe they weren't checking the dictionary on 10.5, or were  
calling the fn if the data on the new values wasn't found in the  
dictionary, but are being stricter on 10.6.


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

2009-09-02 Thread Massimiliano Gargani

I'm still stuck with this problem.

Anyone can drive me in the right direction?

Thanks,
Max

Il giorno 31/ago/09, alle ore 10:34, Massimiliano Gargani ha scritto:


Thanks a lot,

I had to subclass also the scroll view but it partially works.

Now my code is:

@implementation MyScroller

+ (CGFloat)scrollerWidth {
return 40.0f;
}

+ (CGFloat)scrollerWidthForControlSize:(NSControlSize)controlSize
{
return 40.0f;
}

- (void)drawRect:(NSRect)rect
{
[self drawKnobSlot];
[self drawKnob];
}

- (void)drawKnob
{
NSRect rect = [self rectForPart:NSScrollerKnob];
rect.origin.x =0;
rect.size.width = 40;

[[NSColor darkGrayColor] set];
[NSBezierPath fillRect:rect];
}

- (void)drawKnobSlot
{
NSRect rect = [self rectForPart:NSScrollerKnobSlot];
rect.origin.x = 0;
rect.size.width = 40;
[[NSColor grayColor] set];
[NSBezierPath fillRect:rect];
}

@end


The knob's width is still 15.0f

As you can see from image here:

http://img30.imageshack.us/img30/3586/immagine1jvf.png

the knob's rect is splitted in 2 rects:

the right rect works fine and scroll my table, the left rect doesn't  
scroll and if i try to click on it or drag it it moves the windo to  
its origin.x and y


I found no documentation about a knobwidth or something.

Thanks for any help or hints.

Max



Il giorno 30/ago/09, alle ore 21:20, Brandon Walkin ha scritto:

Use +scrollerWidth and +scrollerWidthForControlSize. Here's a  
custom scroller subclass from BWToolkit which might help you out: http://bitbucket.org/bwalkin/bwtoolkit/src/tip/BWTransparentScroller.m


Brandon

On 2009-08-30, at 5:25 AM, Massimiliano Gargani wrote:


Hi there,

I've googled a lot before post this question but I'm stucked.

I'm trying to subclassing NSScroller to change the aqua look and,  
most important, to change the width of the vertical scroll bar.


My subclass is:

- (void)drawRect:(NSRect)rect
{
[self drawKnobSlot];
[self drawKnob];
}

- (void)drawKnob
{
NSRect rect = [self rectForPart:NSScrollerKnob];
[[NSColor darkGrayColor] set];
[NSBezierPath fillRect:rect];
}

- (void)drawKnobSlot
{
NSRect rect = [self rectForPart:NSScrollerKnobSlot];
[[NSColor grayColor] set];
[NSBezierPath strokeRect:rect];
}

It works and change the look as I want but not the width. I tried  
to set rect width but is not the right way because the rect goes  
beyond the scrollview.


Any help is appreciated.

Thanks,
Max

___

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/bwalkin%40gmail.com

This email sent to bwal...@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/max%40ircd.it

This email sent to m...@ircd.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: Finder contextual menu plugin 10.6

2009-09-02 Thread Dave Keck
http://www.cocoabuilder.com/archive/message/cocoa/2009/8/20/243101
http://lists.apple.com/archives/cocoa-dev/2009/Sep/msg00055.html
...etc
___

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: drawing my image in snow leopard

2009-09-02 Thread Markus Spoettl

On Sep 2, 2009, at 12:33 PM, Rick C. wrote:
i've been using NSImage drawInRect:fromRect:operation:fraction: to  
draw and center my .icns image in a resizable custom view for some  
time without issues.  now in snow leopard the same code works,  
however when the custom view is at its minimum size the image is  
slightly blurry.  when i resize the custom view to full size the  
image is fine.  seems to be maybe scaling but i'm not rescaling the  
image the size is constant.  of course the view is being resized.  i  
just checked again in leopard and this is not an issue.  i'm  
thinking i need to add something in my code to keep up with changes  
in snow leopard but i haven't yet figured out what that might be.   
if anyone needs some code i can post it.  thank you,



The AppKit release notes state that with 10.6 the image destination  
coordinates are no longer rounded to integral values. Just round x and  
y of your destination rect and the image should appear sharp like  
before.


Regards
Markus
--
__
Markus Spoettl



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Finder contextual menu plugin 10.6

2009-09-02 Thread Marco Cassinerio

Hi,

so far i've build finder plugin using Carbon and SampleCMPlugin code  
example.
Now, with 10.6, Carbon support has been dropped. So, how can i create  
a finder plugin that works only on 10.6?


Thanks
Marco
___

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 get a managedObjectContext in a nib file

2009-09-02 Thread Michael Thon
I created a new nib file in my project and in that nib file I need an  
array controller bound to my app's managed object context.   I made an  
instance of AppDelegate in the nib file and bound to that.  The array  
controller works except that entities added to the array are not being  
permanently saved to the store.  Maybe making a new instance of  
AppDelegate is not the thing to do.
Next, I made File's Owner in the nib file my subclass of  
NSWindowController.  Then I made a managedObjectContext property and  
in awakeFromNib I set that value with :


 managedObjectContext = [[[NSApplication sharedApplication]  
delegate] managedObjectContext];


I thought that would work but when I instantiate the nib I get this  
error:


Cannot perform operation without a managed object context

Maybe the NSArrayController is trying to do its thing before  
awakeFromNib is called?  In any case, that obviously isn't the right  
way to do it either.  Can anyone tell me how to get a reference to my  
managed object context in my nib file?

Thanks
Mike

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Core Data migration from xml to sqlite

2009-09-02 Thread Ian Kennedy

Hi all,

How would I go about doing a one-time migration of application data  
from an xml persistent store to a sqlite persistent store? i.e. the  
model stays the same, the data is migrated, and the app uses the  
sqlite store from there on out.


I've been unsuccessfully trying to do it inside of the  
persistentStoreCoordinator method by working with the example from  
here: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CoreData/Articles/cdUsingPersistentStores.html


Here is what I've tried, which doesn't migrate any data, just provides  
me with an empty sqlite store:


http://pastie.textmate.org/602152

Thanks for any help,
Ian
___

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: After changing to MacOS 10.6 XCode no longer compiles

2009-09-02 Thread I. Savant

On Sep 2, 2009, at 6:20 AM, Horst Jäger wrote:


after changing to MacOS 10.6 my XCode no longer compiles.

No error message and XCode doesn't freeze. It just says  
"CompileXIB ..." and that's it.


Any idea what I could do?


  Nothing to do with Cocoa: xcode-users list, please.

--
I.S.




___

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


drawing my image in snow leopard

2009-09-02 Thread Rick C.
hello,

i've been using NSImage drawInRect:fromRect:operation:fraction: to draw and 
center my .icns image in a resizable custom view for some time without issues.  
now in snow leopard the same code works, however when the custom view is at its 
minimum size the image is slightly blurry.  when i resize the custom view to 
full size the image is fine.  seems to be maybe scaling but i'm not rescaling 
the image the size is constant.  of course the view is being resized.  i just 
checked again in leopard and this is not an issue.  i'm thinking i need to add 
something in my code to keep up with changes in snow leopard but i haven't yet 
figured out what that might be.  if anyone needs some code i can post it.  
thank you,

rick


  
___

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: After changing to MacOS 10.6 XCode no longer compiles

2009-09-02 Thread Jean-Daniel Dupas


Le 2 sept. 2009 à 12:20, Horst Jäger a écrit :


Hi,

after changing to MacOS 10.6 my XCode no longer compiles.

No error message and XCode doesn't freeze. It just says  
"CompileXIB ..." and that's it.


Any idea what I could do?


Which Xcode version ?

___

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


After changing to MacOS 10.6 XCode no longer compiles

2009-09-02 Thread Horst Jäger

Hi,

after changing to MacOS 10.6 my XCode no longer compiles.

No error message and XCode doesn't freeze. It just says  
"CompileXIB ..." and that's it.


Any idea what I could do?

Thanks
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Have sheet delay until done?

2009-09-02 Thread Carl Harris

Chase Meadors wrote:

The problem is, the -runNewItemSheet method is
returning right after starting the sheet. What I want is for it to
wait until the didEnd selector is called to return from the -
runNewItemSheet method. That way, "readyNewItem" will be properly
assigned and not nil.

Is there any way I can accomplish this while still allowing the panel
to work (IBActions etc.) but not return from the original calling
method? I'm drawing a blank here.


This can be accomplished, by running the panel as an application-modal  
dialog.


http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Sheets/Tasks/UsingAppModalDialogs.html

Using a modal dialog means that the user can't do anything else with  
your application until the dialog is dismissed, so you want to avoid  
this approach, particularly in a application with multiple independent  
windows.


Often, when I find myself wanting to do this sort of thing, it's  
because I'm thinking about what the code needs to do sequentially.   
Take a step back and think of the UI as providing events that allow  
your objects to attain some state, and then decide what actions need  
to occur when that state is attained.  Take the part that happens in  
"someMethod" when the "readyNewItem" property changes state, and  
arrange to have that code invoked when the didEndSelector: is  
invoked.  This will avoid the need for a modal dialog (and its  
associated negatives) and will make your code more consistent with the  
intended use of the sheet API in Cocoa.



___

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


NSOutlineView Source List not looking like expected

2009-09-02 Thread Florian Soenens

Hi list,

in our app i implemented an NSOutlineView set to SourceList in IB.
I implemented the datasource method to set the group items etc but my  
group items (the ones in uppercase like mail.app, iTunes etc...) don't  
look exactly like the ones seen in the other Apple apps.
What i mean is, the font looks bigger, a little darker and the hilight  
around (or under) the text is not as bright like the Apple apps.


Is anyone experiencing the same? Does Apple and other developers  
implement something custom?
I have set the fontsize of my cell to 11 in IB and the controlSize to  
NSSmallControlSize but to no avail.


Thanks in advance for the help.
Florian.


Looking for Web-to-Print Solutions?
Visit our website :   http://www.vit2print.com


This e-mail, and any attachments thereto, is intended only for use by the 
addressee(s) named herein and may contain legally privileged and/or 
confidential information and/or information protected by intellectual property 
rights.
If you are not the intended recipient, please note that any review, 
dissemination, disclosure, alteration, printing, copying or transmission of 
this e-mail and/or any file transmitted with it, is strictly prohibited and may 
be unlawful.
If you have received this e-mail by mistake, please immediately notify the 
sender and permanently delete the original as well as any copy of any e-mail 
and any printout thereof.
We may monitor e-mail to and from our network.

NSS nv Tieltstraat 167 8740 Pittem Belgium 
___


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