CALayer scaling issue

2009-01-22 Thread Kishore Gedela

Hi,
	I'm working on a slide show application, in that I have a Custom View  
which has a layer. On top of that layer I've several sub-layers. The  
custom view is enclosed in a scroll view.
	When the user switches to fullscreen, I'm calling  
enterFullScreenMode:withOptions: method on the custom view.


	When I switch back to the window mode (using  
exitFullScreenMode:withOptions:), I'm facing several problems with the  
scrollers. If I drag the scrollers, they are scrolling back to the  
initial position, when I release the mouse.
	Scaling is also not working properly. The layer is going to the  
center of the view.


Am I doing anything wrong here?

	Here is the code. Thanks for any info/directions in resolving these  
issues.


- (IBAction)runSlideShow:(id)sender
{
if ([displayBaseView isInFullScreenMode]) {
[displayBaseView exitFullScreenModeWithOptions:nil];
//Scale view back to the scalevalue.
[self  scaleViewToValue:scaleValue];
[NSCursor unhide];
} else {
[NSCursor hide];
[self  scaleViewToValue:1.0f];
		[displayBaseView enterFullScreenMode:[NSScreen mainScreen]  
withOptions:nil];

}
}

- (void)scaleViewToValue:(float)theValue
{
scaleValue = theValue;

[displayBaseView.layer setTransform:CATransform3DIdentity];
	[displayBaseView.layer setTransform:CATransform3DMakeScale(theValue,  
theValue, 1.0f)];


NSView *clipView = [[displayBaseView enclosingScrollView] contentView];
	NSSize newBoundsSize = NSMakeSize(NSWidth([clipView frame])/theValue,  
NSHeight([clipView frame])/theValue);

[clipView setBoundsSize: newBoundsSize];
}


Thanks
Kishore
___

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

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

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

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


[moderator] Re: Bug with QTCaptureLayer..........?

2009-01-22 Thread Scott Anguish


On 22-Jan-09, at 2:23 PM, Gordon Apple wrote:

As is supposedly the alternating start/stop when you change anything  
in the
layer.  I haven't had a chance to test it yet.  (Waiting on a new HD  
to
arrive to load Snow Leopard.)  BTW, I haven't seen an update since  
around

Dec. 1.  What's with that?



Just a reminder. Discussion Snow Leopard, including when releases  
happen, is prohibited.


The non-disclosure covers this and other issues.

Scott

___

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

Please do not post admin requests or moderator comments to the list.
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 assigning image to button under garbage collection

2009-01-22 Thread Rob Keniger


On 23/01/2009, at 1:53 PM, Bill Bumgarner wrote:

A problem arose when I added an NSButton to my nib file and  
assigned an image to it in Interface Builder (just entering the  
image name NSAddTemplate) in the Inspector.  As soon as I did this,  
I started getting the following kinds of messages in the log:


MyApp (20733,0x100537000) malloc: free_garbage: garbage ptr =  
0x8000be360, has non-zero refcount = 1


I tried different approaches to setting the image, such as doing it  
programatically (keeping a persistent pointer to the image and  
referring to the button via an IBOutlet).


I have googled about such problems, but did not come up with  
anything.  Is there a known issue with images and buttons under GC?


Sounds odd.Please file a bug, attaching the application (binary  
is good enough unless you are comfortable attaching the source).


http://bugreporter.apple.com/



This has come up before and has been acknowledged as a bug in the  
Frameworks. It's apparently harmless (but yes, it's very annoying).


http://www.cocoabuilder.com/archive/message/xcode/2007/11/7/16932

I know you've seen it before:

http://www.cocoabuilder.com/archive/message/cocoa/2007/12/23/195406

To see it all you have to do is launch Xcode (a GC app) and watch the  
massive number of these log entries that it spews out.


It occurs as soon as a template image is loaded.

You can recreate this at will with a blank Xcode project set to use  
Garbage Collection. Just add an NSButton to the main window and set  
its image to be NSAddTemplate or another template image and run the app.


--
Rob Keniger



___

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

Please do not post admin requests or moderator comments to the list.
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: Using the security framework

2009-01-22 Thread Michael Ash
On Thu, Jan 22, 2009 at 10:15 PM, Joe Turner  wrote:
>
> On Jan 22, 2009, at 4:57 PM, Nick Zitzmann wrote:
>
>>
>> On Jan 22, 2009, at 4:09 PM, Joe Turner wrote:
>>
>>> I see. Then, how would you suggest to create a cloner/deleter, if it
>>> needs root privileges, but cannot use the security framework?
>>
>> I didn't say you couldn't use the security framework. I said you ought to
>> consider re-thinking your strategy.
>>
>>> And, since running scripts from root is dangerous, then is there any good
>>> way to be able to delete protected (not your user account) files? Or, should
>>> I just have it copy or delete files the user has access to?
>>
>>
>> There's nothing wrong with running scripts strictly as root, since a lot
>> of system scripts are run this way. But AEWP() doesn't run executables as
>> root; it runs them as the user with root privileges. There's an important
>> difference.
>>
>> Instead of running a shell script, run another non-GUI command line tool
>> of your making with AEWP() that does the required privileged task(s).
>> Running shell code with root privileges as some user is possible, but it's
>> an easy attack vector due to the inheritance of the user's shell
>> environment. Running a command line tool is a bit more difficult to hack
>> (but still possible if someone is determined enough). Plus, then you can use
>> NSFileManager. :)
>>
>> You could even take security to the extreme, as I once did in an
>> application, and check signatures before calling AEWP(), but that's probably
>> too extreme, as it's unlikely someone will rewrite or replace your
>> executable unless the file system gave them permission to do so.
>
> Okay, I guess I should just put scheduling without needing the password to
> the back of my queue.
>
> I have one more question (sorry for all of these questions): If I call
> AuthorizationCopyRights() every 280 (or anything less than 300 secs) during
> the clone, will it keep the authorization alive (no need to enter password
> again)?

Don't do that. The standard way to accomplish a permanent unlock that
you're talking about is (I think) to have a suid root tool. You use
AEWP to run it as root so that it can become suid root, and after that
it simply *stays* suid root, as that's a filesystem property that
won't be disappearing spontaneously. As long as it's suid root you
don't need to touch AEWP again.

Of course you need to securely control access to your suid root tool
in that case, and I don't recall exactly how you do this, but I
believe the authorization APIs allow you to generate tokens that you
can pass to the tool to be checked for validity so that not just
anyone can come in and use the tool. And I'm pretty sure that Apple
has sample code to illustrate this. Definitely look at that sample
code no matter what; these APIs are ridiculously difficult to get
right, and you don't want to be working with them without a concrete
example sitting in front of you that you can crib from.

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: Receiving user events from within an NSTimer callback

2009-01-22 Thread Michael Ash
On Thu, Jan 22, 2009 at 7:34 PM, Quincey Morris
 wrote:
> On Jan 22, 2009, at 14:55, John Mikros wrote:
>
>> I'm working on a Cocoa application which does all of its work within an
>> NSTimer callback that is called regularly.  Events are handled normally
>> within a Cocoa run loop.
>>
>> However, there are times when within the callback, the code enters an
>> inner loop, and will not exit until some user action is performed.
>> I'm trying to force the run loop to pump events within this inner loop,
>> but I can't seem to ever get it to work.
>
> I use, from the timer callback:
>
>>NSEvent *event;
>>while (event = [NSApp nextEventMatchingMask: NSAnyEventMask
>> untilDate: nil inMode: NSEventTrackingRunLoopMode dequeue: YES])
>>[NSApp sendEvent: event];
>
>
> I don't know if this is officially blessed or not, but it certainly seems to
> work just fine.
>
> In the places I've done this, I was only really interested in making the
> mouse and keyboard work, hence NSEventTrackingRunLoopMode. You could use the
> default run loop mode instead, I guess.

Yes, this is fine, and supported. It's a common way of implementing
mouse tracking instead of relying on the stateless mouseDragged:
method.

The reason you have to do this and can't just run the runloop is
because the event loop is actually a separate concept from the
runloop. It's a bit confusing because the event loop is implemented
using the runloop, but if you just run the runloop on the main thread,
events won't get processed. You have to explicitly run this in order
to get them to be processed.

Note that using the default runloop mode with this is generally a bad
idea. By running in the default mode you allow *everything* else to
run, which means that some other code might decide that *it* wants an
inner event loop as well. If you then want to quit before that other
code has finished, tough cookies. Much better to control things more
tightly by using a different runloop mode.

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 does errAuthorizationToolEnvironmentError mean?

2009-01-22 Thread Jim Correia

On Jan 22, 2009, at 6:48 PM, Andy Lee wrote:

I'm using AuthorizationExecuteWithPrivileges() to run /bin/rm within  
some uninstaller code.  I thought I had everything working, but  
today it returned errAuthorizationToolEnvironmentError, which  
according to the docs means "The attempt to execute the tool failed  
to return a success or an error code."  What does this mean?  Under  
what circumstances might rm return nothing?  The arguments I'm  
passing are "-rf" and the fully qualified path name, which contains  
a space but no wildcards or any other special characters.


In case it matters, I call AuthorizationExecuteWithPrivileges() a  
few times with the same AuthorizationRef.


Andy,

I don't know why you are running into this problem. Chances are others  
might not know either. This is not a sanctioned/supported use of AEWP.


In other words, if the answer to the problem is to (repeatedly) call  
rm, cp, mv or chmod via AEWP, the problem is usually misdefined.


Generally, you want to factor out the code that needs elevated  
privileges into your own tool, and execute that using Authorization  
Services. There is sample code on developer.apple.com which does this.


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


Re: Problem assigning image to button under garbage collection

2009-01-22 Thread Bill Bumgarner

On Jan 22, 2009, at 7:49 PM, Rick Hoge wrote:
I have a garbage collected app which has been running fine, with no  
crashing or leaks and passing nicely using the Xray diagnostic tools.


A problem arose when I added an NSButton to my nib file and assigned  
an image to it in Interface Builder (just entering the image name  
NSAddTemplate) in the Inspector.  As soon as I did this, I started  
getting the following kinds of messages in the log:


MyApp (20733,0x100537000) malloc: free_garbage: garbage ptr =  
0x8000be360, has non-zero refcount = 1


I tried different approaches to setting the image, such as doing it  
programatically (keeping a persistent pointer to the image and  
referring to the button via an IBOutlet).


I have googled about such problems, but did not come up with  
anything.  Is there a known issue with images and buttons under GC?


Sounds odd.Please file a bug, attaching the application (binary is  
good enough unless you are comfortable attaching the source).


http://bugreporter.apple.com/

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


Problem assigning image to button under garbage collection

2009-01-22 Thread Rick Hoge


I have a garbage collected app which has been running fine, with no  
crashing or leaks and passing nicely using the Xray diagnostic tools.


A problem arose when I added an NSButton to my nib file and assigned  
an image to it in Interface Builder (just entering the image name  
NSAddTemplate) in the Inspector.  As soon as I did this, I started  
getting the following kinds of messages in the log:


MyApp (20733,0x100537000) malloc: free_garbage: garbage ptr =  
0x8000be360, has non-zero refcount = 1


I tried different approaches to setting the image, such as doing it  
programatically (keeping a persistent pointer to the image and  
referring to the button via an IBOutlet).


I have googled about such problems, but did not come up with  
anything.  Is there a known issue with images and buttons under GC?


Thanks in advance for any info,

Rick
(43092.6825)

___

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

Please do not post admin requests or moderator comments to the list.
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: Using the security framework

2009-01-22 Thread Joe Turner


On Jan 22, 2009, at 4:57 PM, Nick Zitzmann wrote:



On Jan 22, 2009, at 4:09 PM, Joe Turner wrote:

I see. Then, how would you suggest to create a cloner/deleter, if  
it needs root privileges, but cannot use the security framework?


I didn't say you couldn't use the security framework. I said you  
ought to consider re-thinking your strategy.


And, since running scripts from root is dangerous, then is there  
any good way to be able to delete protected (not your user account)  
files? Or, should I just have it copy or delete files the user has  
access to?



There's nothing wrong with running scripts strictly as root, since a  
lot of system scripts are run this way. But AEWP() doesn't run  
executables as root; it runs them as the user with root privileges.  
There's an important difference.


Instead of running a shell script, run another non-GUI command line  
tool of your making with AEWP() that does the required privileged  
task(s). Running shell code with root privileges as some user is  
possible, but it's an easy attack vector due to the inheritance of  
the user's shell environment. Running a command line tool is a bit  
more difficult to hack (but still possible if someone is determined  
enough). Plus, then you can use NSFileManager. :)


You could even take security to the extreme, as I once did in an  
application, and check signatures before calling AEWP(), but that's  
probably too extreme, as it's unlikely someone will rewrite or  
replace your executable unless the file system gave them permission  
to do so.


Okay, I guess I should just put scheduling without needing the  
password to the back of my queue.


I have one more question (sorry for all of these questions): If I call  
AuthorizationCopyRights() every 280 (or anything less than 300 secs)  
during the clone, will it keep the authorization alive (no need to  
enter password again)?


Thanks for all your help–You have no idea how much it means to me :)

Cheers,

Joe Turner



Nick Zitzmann






___

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

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

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

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


Re: puzzled about speech synthesis [SOLVED]

2009-01-22 Thread Daniel Richman

I think this is it. Thank you so much.

Daniel



Roland King wrote:

Daniel Richman wrote:


Hi all,

I am trying to write an app that has a hard-coded NSString, formatted 
like this:


@"Alex: This is a test.\nBruce: One two.\nFred: This is another test."

The idea is that the lines in the text are spoken using the indicated 
voice. In the example above, line one is Alex, line two is Bruce, and 
line three is Fred.


I'm puzzled, however, because what ends up happening is that only the 
last line ("This is another test") is spoken. Furthermore, the voice 
used is the first one in the list (Alex). I've tested this with 
multiple last lines and voices.


So, I set breakpoints in my code:

(IBAction)speakPlay:(id)sender
{
   NSLog(@"Starting to speak play");
  [isSpeakingField setStringValue:@"Speaking"];
  for (NSString *line in separatedPlay) {
  // set the speaker for this line
   NSUInteger locationOfFirstColonInLine = [line 
rangeOfString:@":"].location;
  NSString *characterForLine = [line 
substringToIndex:locationOfFirstColonInLine];

   [speechSynthesizer setVoice:
[NSString 
stringWithFormat:@"com.apple.speech.synthesis.voice.%@", 
characterForLine]];
  NSString *partOfLineToSpeak = [line 
substringFromIndex:(locationOfFirstColonInLine + 2)];

  // speak the part of the line after the character
   [speechSynthesizer startSpeakingString:partOfLineToSpeak];
   }
}


does the speech synthesizer 'queue up' requests like that? Seems more 
likely that you're ripping through your for loop setting the voice and 
the line to speak 3 times, each one just overriding the one before so 
you just get the last line. I would think you need to wait for a 
delegate callback telling you one line is finished before enqueing the 
next

___

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

Please do not post admin requests or moderator comments to the list.
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


puzzled about speech synthesis

2009-01-22 Thread Daniel Richman

Hi all,

I am trying to write an app that has a hard-coded NSString, formatted 
like this:


@"Alex: This is a test.\nBruce: One two.\nFred: This is another test."

The idea is that the lines in the text are spoken using the indicated 
voice. In the example above, line one is Alex, line two is Bruce, and 
line three is Fred.


I'm puzzled, however, because what ends up happening is that only the 
last line ("This is another test") is spoken. Furthermore, the voice 
used is the first one in the list (Alex). I've tested this with multiple 
last lines and voices.


So, I set breakpoints in my code:

(IBAction)speakPlay:(id)sender
{
   NSLog(@"Starting to speak play");
   
   [isSpeakingField setStringValue:@"Speaking"];
   
   for (NSString *line in separatedPlay) {
   
   // set the speaker for this line
   NSUInteger locationOfFirstColonInLine = [line 
rangeOfString:@":"].location;
   
   NSString *characterForLine = [line 
substringToIndex:locationOfFirstColonInLine];

   [speechSynthesizer setVoice:
[NSString 
stringWithFormat:@"com.apple.speech.synthesis.voice.%@", characterForLine]];
   
   NSString *partOfLineToSpeak = [line 
substringFromIndex:(locationOfFirstColonInLine + 2)];
   
   // speak the part of the line after the character

   [speechSynthesizer startSpeakingString:partOfLineToSpeak];
   }
}


When I use the debugger:

- The voice (Alex, in this case) is correctly recognized from the text.
- The speech synthesizer is set to the correct voice.
- "partOfLineToSpeak" is set correctly (to "This is a test.")
- When I get to the "start speaking" command, I get two long (wrapped to 
several lines each) lines of blather about what I think is the audio 
driver, but no voice. (Although I tested this on another app I wrote to 
synthesize a line the user types in, and the same thing happens: 
blather, but no voice when using gdb.)


So I'm stumped. Why is the wrong line spoken (w/o the debugger), but, 
with the debugger, the correct line is used?


Thanks,
Daniel

P.S. my init code is below in case you want to refer to that.

- (id)init {
   [super init];
   
   play = @"Alex: This is a test.\nBruce: One two.\nFred: This is 
another test.";
   separatedPlay = (NSMutableArray *) [play 
componentsSeparatedByString:@"\n"];
   
   speechSynthesizer = [[NSSpeechSynthesizer alloc] initWithVoice:nil];

   [speechSynthesizer setDelegate:self];
   
   return self;

}
   


-
___

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

Please do not post admin requests or moderator comments to the list.
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: Receiving user events from within an NSTimer callback

2009-01-22 Thread Quincey Morris

On Jan 22, 2009, at 14:55, John Mikros wrote:

I'm working on a Cocoa application which does all of its work within  
an NSTimer callback that is called regularly.  Events are handled  
normally within a Cocoa run loop.


However, there are times when within the callback, the code enters  
an inner loop, and will not exit until some user action is performed.
I'm trying to force the run loop to pump events within this inner  
loop, but I can't seem to ever get it to work.


I use, from the timer callback:


NSEvent *event;
	while (event = [NSApp nextEventMatchingMask: NSAnyEventMask  
untilDate: nil inMode: NSEventTrackingRunLoopMode dequeue: YES])

[NSApp sendEvent: event];



I don't know if this is officially blessed or not, but it certainly  
seems to work just fine.


In the places I've done this, I was only really interested in making  
the mouse and keyboard work, hence NSEventTrackingRunLoopMode. You  
could use the default run loop mode instead, I guess.



___

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

Please do not post admin requests or moderator comments to the list.
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 does errAuthorizationToolEnvironmentError mean?

2009-01-22 Thread Andy Lee
I'm using AuthorizationExecuteWithPrivileges() to run /bin/rm within  
some uninstaller code.  I thought I had everything working, but today  
it returned errAuthorizationToolEnvironmentError, which according to  
the docs means "The attempt to execute the tool failed to return a  
success or an error code."  What does this mean?  Under what  
circumstances might rm return nothing?  The arguments I'm passing are  
"-rf" and the fully qualified path name, which contains a space but no  
wildcards or any other special characters.


In case it matters, I call AuthorizationExecuteWithPrivileges() a few  
times with the same AuthorizationRef.


--Andy

___

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

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

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

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


Re: NSCaledarDate's deprecation

2009-01-22 Thread Benjamin Dobson


On 22 Jan 2009, at 22:52:56, kvic...@pobox.com wrote:

in anticipation of the deprecation of NSCaledarDate, i am in the  
process of converting my app to use NSDate and friends. and while  
the process is mostly straightforward and not all that difficult, it  
is tedious.


when i think i'm done, i'd like to be able to do a fresh build and  
if possible have the compiler tell me any places i might have  
missed... these would be places where i used a method of  
NSCalendarDate that i missed with all my text searches.


is there anyway to get the compiler to do this for me?


If you delete all occurrences of NSCalendarDate and what relevant code  
you can see, the compiler will pick up on undefined variables.

___

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

Please do not post admin requests or moderator comments to the list.
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


[SOLVED] Zombies: "Not a Type release"

2009-01-22 Thread Alexander Heinz


On Jan 22, 2009, at 2:51 PM, David Duncan wrote:


On Jan 22, 2009, at 2:40 PM, Alexander Heinz wrote:


Now, to figure out why I'm sending a - release to a CGImage...



If you'd set the contents property of a CALayer to a CGImage at any  
point? Since you set the view's layer to nil, it could be that at  
that point, some number of CALayers are being torn down and this is  
a result. If your not properly managing memory in this instance,  
then that could be your failure.


Yep, that was it. I was performing an extra CGImageRelease() in  
certain circumstances.


Thanks to everyone for the help!

(I really gotta read up on Instruments more...)
___

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

Please do not post admin requests or moderator comments to the list.
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:My objectcontroller is loosing its moc, but only with certain timing

2009-01-22 Thread Ben Trumbull

This happens when I close a window in my app, but only if I close it
_very_ soon after it is opened.  If I leave the window open for a few
100 ms then there is no problem.  My app is garbage collected.  The
exception is happening after windowWillClose.

The culprit seems to be an NSObjectController in the nib.  At this
point, nothing in my nib nor code even uses this objectController.  I
can stop the exception by doing one of two things:

a) remove it's binding to my document's moc.  Instead, I call
[myController setManagedObjectContext:...] in awakeFromNib.

b) change the 'prepares content' checkbox from on to off and instead
call [myController fetchWithRequest:nil merge:NO error:&error] in
windowDidLoad.

Anyone understand what's happening?  Does it sound like a Cocoa bug?


That's pretty weird, and yes it sounds like a bug in NSObjectController.

If you can make a sample Xcode project that reproduces the problem and  
attach it to a bugreport.apple.com bug that would be very helpful.


- Ben



___

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

Please do not post admin requests or moderator comments to the list.
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: Saving Permanent IDs in Document-Based App

2009-01-22 Thread Quincey Morris

On Jan 21, 2009, at 13:15, Derek Kuhl wrote:

	I created a document-based core data application and want it to be  
able to add external files from a support folder.  I can  
successfully set the permanent URIs for the transient relationships  
working in memory, but for some reason saving to file never works  
properly.  If I tell each object to save the context using save: in  
the didSave: method, it will save a duplicate in the file.  If I try  
to save the context in the document's document:didSave:contextInfo:  
method mentioned in the documentation, it works again but doesn't  
save.  Thank you in advance for any information someone has on what  
I'm doing wrong.


Did you get any responses to this and/or are you still having a problem?

If you're still looking for assistance, you're going to have to spell  
things out a bit more clearly. Are the external files persistent  
stores you add to the persistent store controller, or are they just  
additional files you keep references to as property values? If you  
have information in transient properties, why are you expecting those  
values to be saved at all? What kind of context are you talking about?  
If you mean managed object context, why are you telling objects to  
"save" it? 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: Using the security framework

2009-01-22 Thread Nick Zitzmann


On Jan 22, 2009, at 4:09 PM, Joe Turner wrote:

I see. Then, how would you suggest to create a cloner/deleter, if it  
needs root privileges, but cannot use the security framework?


I didn't say you couldn't use the security framework. I said you ought  
to consider re-thinking your strategy.


And, since running scripts from root is dangerous, then is there any  
good way to be able to delete protected (not your user account)  
files? Or, should I just have it copy or delete files the user has  
access to?



There's nothing wrong with running scripts strictly as root, since a  
lot of system scripts are run this way. But AEWP() doesn't run  
executables as root; it runs them as the user with root privileges.  
There's an important difference.


Instead of running a shell script, run another non-GUI command line  
tool of your making with AEWP() that does the required privileged task 
(s). Running shell code with root privileges as some user is possible,  
but it's an easy attack vector due to the inheritance of the user's  
shell environment. Running a command line tool is a bit more difficult  
to hack (but still possible if someone is determined enough). Plus,  
then you can use NSFileManager. :)


You could even take security to the extreme, as I once did in an  
application, and check signatures before calling AEWP(), but that's  
probably too extreme, as it's unlikely someone will rewrite or replace  
your executable unless the file system gave them permission to do so.


Nick Zitzmann




___

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

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

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

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


Receiving user events from within an NSTimer callback

2009-01-22 Thread John Mikros

Hello all,

I'm working on a Cocoa application which does all of its work within  
an NSTimer callback that is called regularly.  Events are handled  
normally within a Cocoa run loop.


However, there are times when within the callback, the code enters an  
inner loop, and will not exit until some user action is performed.
I'm trying to force the run loop to pump events within this inner  
loop, but I can't seem to ever get it to work.


I've tried calling the following within the inner loop:
- calling [[NSRunLoop currentRunLoop] runUntilDate:[NSDate  
dateWithTimeIntervalSinceNow:0.1]];
- calling [[NSRunLoop mainRunLoop] runUntilDate:[NSDate  
dateWithTimeIntervalSinceNow:0.1]];

- calling CFRunLoopRunInMode()
- calling ReceiveNextEvent

None of these let me get any events from within my callback.  Is there  
any way for me to do what I need?



Thanks for any help!
-john
___

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

Please do not post admin requests or moderator comments to the list.
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


NSCaledarDate's deprecation

2009-01-22 Thread kvic...@pobox.com
in anticipation of the deprecation of NSCaledarDate, i am in the 
process of converting my app to use NSDate and friends. and while the 
process is mostly straightforward and not all that difficult, it is 
tedious.


when i think i'm done, i'd like to be able to do a fresh build and if 
possible have the compiler tell me any places i might have missed... 
these would be places where i used a method of NSCalendarDate that i 
missed with all my text searches.


is there anyway to get the compiler to do this for me?

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


Looking for the "Use Family and Typeface" option in font panel in IB 3

2009-01-22 Thread Laurent Daudelin
H Am I missing something? Where did this option go under the new  
Interface Builder? I feel dumb but how am I suppose to change the font  
and font size of table columns in a table view without using a  
specific font and a specific size?


Thanks for any info.
-Laurent.
--
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://nemesys.dyndns.org
Logiciels Nemesys Software  
laurent.daude...@verizon.net
Photo Gallery Store: http://laurentdaudelin.shutterbugstorefront.com/g/galleries



___

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

Please do not post admin requests or moderator comments to the list.
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: Zombies: "Not a Type release"

2009-01-22 Thread David Duncan

On Jan 22, 2009, at 2:40 PM, Alexander Heinz wrote:


Now, to figure out why I'm sending a - release to a CGImage...



If you'd set the contents property of a CALayer to a CGImage at any  
point? Since you set the view's layer to nil, it could be that at that  
point, some number of CALayers are being torn down and this is a  
result. If your not properly managing memory in this instance, then  
that could be your failure.

--
David Duncan
Apple DTS Animation and Printing

___

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

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

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

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


Re: Zombies: "Not a Type release"

2009-01-22 Thread Greg Parker

On Jan 22, 2009, at 2:15 PM, Sean McBride wrote:

On 1/22/09 2:11 PM, Alexander Heinz said:

*** -[Not A Type release]: message sent to deallocated instance
0xe412b30

This doesn't tell me what kind of object is sent the message, so I'm
having a very hard time debugging the problem.

My questions are:

What is a "Type release" (and, by extension, what does it mean to not
be one)?


I think you're reading that wrong.  Think:

-["Not A Type" release]

The message 'release' was sent to something... can you 'po
0xe412b30' in gdb?  Or check the history of that address with  
Instruments?


"Not A Type" is the type name for the Core Foundation type with  
CFTypeID zero. That type isn't supposed to show up anywhere.


If the object used to be an instance of a CF type, then you might get  
better information from CFZombie instead of NSZombie.



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


___

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

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

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

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


Re: Zombies: "Not a Type release"

2009-01-22 Thread Alexander Heinz


On Jan 22, 2009, at 2:34 PM, Corbin Dunn wrote:



On Jan 22, 2009, at 2:29 PM, Alexander Heinz wrote:


Thanks for the quick reply.

You're right, I read that wrong, but, unfortunately, I can't "po"  
the object in gdb (just gives me a similar log message) and  
Instruments doesn't have a record for the object.


Are you sure you are using instruments right?

check out:

http://www.corbinstreehouse.com/blog/index.php/2007/10/instruments-on-leopard-how-to-debug-those-random-crashes-in-your-cocoa-app/

.corbin


Well, I did roughly what that recommended, but it worked better when I  
did it that way. Thank you.


Now, to figure out why I'm sending a - release to a CGImage...
___

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

Please do not post admin requests or moderator comments to the list.
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


firewall api

2009-01-22 Thread Chris Benedict

Hello,

First, I'm pretty new to Mac OS X programming so please bear with my  
ignorance.


I was hoping to get a bit of quick advice.  I'm wanting to write a  
little application that will kind of put my MacBook in a lock down  
mode of sorts.  It would need to block/ignore all network traffic  
except for an app or two when you hit a button and then deactivate  
when you hit another button to return to the original settings.


My question is whether or not there is a public API to interact with  
the built-in firewall on Mac OS X 10.5 or if I would need to interface  
with system preferences somehow and just setup the firewall to block  
all connections except for the one app that I want to allow through or  
if there is a completely different way to go about doing this.  I  
found a program called Little Snitch which seems similar but way  
overkill for what I want to do and at first glance it looks like they  
do things with the drivers or something like that which honestly is  
above my head.


Thanks,
Chris Benedict
___

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

Please do not post admin requests or moderator comments to the list.
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: Zombies: "Not a Type release"

2009-01-22 Thread Alexander Heinz


On Jan 22, 2009, at 2:36 PM, Sean McBride wrote:


On 1/22/09 2:29 PM, Alexander Heinz said:


You're right, I read that wrong, but, unfortunately, I can't "po" the
object in gdb (just gives me a similar log message)


Figures.


and Instruments
doesn't have a record for the object.

I'd appreciate any other ideas...


In addition to Corbin's advice, have you read through TN2124?


Will do to both. Thanks for the help so far.
___

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

Please do not post admin requests or moderator comments to the list.
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: Zombies: "Not a Type release"

2009-01-22 Thread Sean McBride
On 1/22/09 2:29 PM, Alexander Heinz said:

>You're right, I read that wrong, but, unfortunately, I can't "po" the
>object in gdb (just gives me a similar log message)

Figures.

> and Instruments
>doesn't have a record for the object.
>
>I'd appreciate any other ideas...

In addition to Corbin's advice, have you read through TN2124?

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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

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

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

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


Re: Zombies: "Not a Type release"

2009-01-22 Thread Corbin Dunn


On Jan 22, 2009, at 2:29 PM, Alexander Heinz wrote:


Thanks for the quick reply.

You're right, I read that wrong, but, unfortunately, I can't "po"  
the object in gdb (just gives me a similar log message) and  
Instruments doesn't have a record for the object.


Are you sure you are using instruments right?

check out:

http://www.corbinstreehouse.com/blog/index.php/2007/10/instruments-on-leopard-how-to-debug-those-random-crashes-in-your-cocoa-app/

.corbin




I'd appreciate any other 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: Zombies: "Not a Type release"

2009-01-22 Thread Alexander Heinz

Thanks for the quick reply.

You're right, I read that wrong, but, unfortunately, I can't "po" the  
object in gdb (just gives me a similar log message) and Instruments  
doesn't have a record for the object.


I'd appreciate any other ideas...

Alex

On Jan 22, 2009, at 2:15 PM, Sean McBride wrote:


On 1/22/09 2:11 PM, Alexander Heinz said:


*** -[Not A Type release]: message sent to deallocated instance
0xe412b30

This doesn't tell me what kind of object is sent the message, so I'm
having a very hard time debugging the problem.

My questions are:

What is a "Type release" (and, by extension, what does it mean to not
be one)?


I think you're reading that wrong.  Think:

-["Not A Type" release]

The message 'release' was sent to something... can you 'po
0xe412b30' in gdb?  Or check the history of that address with  
Instruments?


--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada



___

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

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

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

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


Re: Zombies: "Not a Type release"

2009-01-22 Thread Sean McBride
On 1/22/09 2:11 PM, Alexander Heinz said:

>*** -[Not A Type release]: message sent to deallocated instance
>0xe412b30
>
>This doesn't tell me what kind of object is sent the message, so I'm
>having a very hard time debugging the problem.
>
>My questions are:
>
>What is a "Type release" (and, by extension, what does it mean to not
>be one)?

I think you're reading that wrong.  Think:

-["Not A Type" release]

The message 'release' was sent to something... can you 'po
0xe412b30' in gdb?  Or check the history of that address with Instruments?

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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

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

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

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


Zombies: "Not a Type release"

2009-01-22 Thread Alexander Heinz

Hello all,

I'm trying to debug what I think is a memory-management problem in my  
Core Animation-based custom view. I'm getting EXEC_BAD_ACCESS at some  
point after I release a bunch of ivars and set the view's "layer"  
property to nil, so I've turned on NSZombieEnabled in the environment  
to figure out what I'm sending messages to. When I run the app,  
though, the message I get on the console is:


*** -[Not A Type release]: message sent to deallocated instance  
0xe412b30


This doesn't tell me what kind of object is sent the message, so I'm  
having a very hard time debugging the problem.


My questions are:

What is a "Type release" (and, by extension, what does it mean to not  
be one)?


How can I get more information about the object in question here?

Thank you in advance,
Alex Heinz
___

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

Please do not post admin requests or moderator comments to the list.
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: Using the security framework

2009-01-22 Thread Joe Turner

Thanks again for the speedy responses!

On Jan 20, 2009, at 1:47 AM, Nick Zitzmann wrote:



On Jan 19, 2009, at 7:56 PM, Joe Turner wrote:

That makes sense, but then how does an app like SuperDuper! do it.  
You click the lock, enter your password, and then you don't need to  
enter your password again until you lock it again. And, it is the  
regular security framework password window, so the developer must  
be doing some sort of authorization that lasts forever. And I  
checked, it does authorize system.privilege.admin.



There is no authorization that lasts forever. Either it's polling to  
keep the authorization alive (which may theoretically work, though  
I've never tried it), or it forgot to set the authorization view to  
auto-refresh the authorization status (which I think has to be done  
in code).


I see. Then, how would you suggest to create a cloner/deleter, if it  
needs root privileges, but cannot use the security framework?


What I did a bit ago was, from the command line (NSTask) call a sudu  
and then run ditto or rsync, and used a pipe to give it the password.  
I had a custom password view where the user entered their password.  
The only thing is, I am trying to make external shell scripts  
unneeded, which is why I originally just wanted to use NSFileManager.


And, since running scripts from root is dangerous, then is there any  
good way to be able to delete protected (not your user account) files?  
Or, should I just have it copy or delete files the user has access to?  
Or is there a way other than the security framework to delete  files  
the user does not have access to.


Thank you again for all your help!

Cheers,

Joe Turner




Makes sense. So, if I create a separate target for the unix script,


I wouldn't really recommend running shell code with root privileges  
as a user other than root. That can be a security hole waiting to  
happen, since changes to the user's environment will affect the  
script. AEWP() executes things with root privileges, but not _as_  
root (so it'll be executed as the user). There are workarounds to  
this, but the best workaround is to just avoid this if at all  
possible.


do I need to add something to it that takes the authorization? Or  
will anything it does that uses admin files be allowed?


Once you run something with AEWP(), it has root privileges.

Nick Zitzmann






___

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

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

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

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


Re: Reverse-engineering Apple's two-tinted gradient NSViews

2009-01-22 Thread Corbin Dunn


- (void)drawRect:(NSRect)rect {
   // Drawing code here.
   NSArray *_colorArray = [NSArray arrayWithObjects:
   [NSColor colorWithDeviceRed:0.9843 green: 
0.9843 blue:0.9843 alpha:1.0],
   [NSColor colorWithDeviceRed:0.9608 green: 
0.9608 blue:0.9608 alpha:1.0],
   [NSColor colorWithDeviceRed:0.8824 green: 
0.8824 blue:0.8824 alpha:1.0],

   nil];

   NSGradient *_gradient = [[NSGradient alloc]  
initWithColors:_colorArray];

   [_gradient drawInRect:rect angle:90];
   [_gradient release];
}


No one else pointed it out, and it is good practice to understand what  
is wrong with your code.


'rect' in drawRect: is the dirty rect, which may or may the entire  
bounds. For a gradient, you can't refill just the dirty rect.  
Therefore, you must use self.bounds. Brandon's example shows this.


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


My objectcontroller is loosing its moc, but only with certain timing

2009-01-22 Thread Sean McBride
Hi all,

I'm getting a weird exception, "Cannot perform operation without a
managed object context", with this backtrace:

#0  0x93d66e17 in objc_exception_throw ()
#1  0x9485beeb in +[NSException raise:format:arguments:] ()
#2  0x9485bf2a in +[NSException raise:format:] ()
#3  0x94de2ff5 in -[_NSManagedProxy _managedObjectContext] ()
#4  0x94de3026 in -[_NSManagedProxy _persistentStoreCoordinator] ()
#5  0x94de30b4 in -[_NSManagedProxy _entity] ()
#6  0x94de3379 in -[_NSManagedProxy fetchRequestWithSortDescriptors:limit:] ()
#7  0x94de26ee in -[NSObjectController(NSManagedController)
defaultFetchRequest] ()
#8  0x94de2a74 in -[NSObjectController(NSManagedController)
_executeFetch:didCommitSuccessfully:actionSender:] ()
#9  0x94f1203e in _NSSendCommitEditingSelector ()
#10 0x94cf8d54 in -[NSController _controllerEditor:didCommit:contextInfo:] ()
#11 0x94861a3d in __invoking___ ()
#12 0x94861428 in -[NSInvocation invoke] ()
#13 0x948614f8 in -[NSInvocation invokeWithTarget:] ()
#14 0x9006222e in __NSFireDelayedPerform ()
#15 0x947e2b25 in CFRunLoopRunSpecific ()
...

This happens when I close a window in my app, but only if I close it
_very_ soon after it is opened.  If I leave the window open for a few
100 ms then there is no problem.  My app is garbage collected.  The
exception is happening after windowWillClose.

The culprit seems to be an NSObjectController in the nib.  At this
point, nothing in my nib nor code even uses this objectController.  I
can stop the exception by doing one of two things:

a) remove it's binding to my document's moc.  Instead, I call
[myController setManagedObjectContext:...] in awakeFromNib.

b) change the 'prepares content' checkbox from on to off and instead
call [myController fetchWithRequest:nil merge:NO error:&error] in
windowDidLoad.

Anyone understand what's happening?  Does it sound like a Cocoa bug?

Cheers,

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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

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

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

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


Re: IBOutlet objects not responding to any messages passed

2009-01-22 Thread Kyle Sluder
On Thu, Jan 22, 2009 at 1:11 PM, Cormac Daly  wrote:
> I had created a custom class for the window controller in Interface Builder,
> but I got rid of it and hooked up all the outlets via File's Owner instead.
> I'm not sure exactly how this worked but it did!

You don't create classes in IB, you instantiate objects.  This is a
very important thing to get straight; very often people post to this
list claiming that their objects are not receiving messages they know
are being sent, and the problem is that they have created instances of
those classes inside the NIB but are expecting the messages to be sent
to other objects entirely.

By the default, when an NSWindowController loads a NIB, it makes
itself the File's Owner.  You should change the Class of File's Owner
(on the Identity pane of the Inspector) to match.

--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: Custom Cocoa Component/Control

2009-01-22 Thread Paul Franz

Thanks. I will read that.

Paul Franz

Shawn Erickson wrote:

On Wed, Jan 21, 2009 at 6:33 PM, Paul Franz  wrote:


Can a custom NSControl/NSCell combo be used in a normal NSView?


Yes. This type of question implies you may want to dig a little more
deeply in the view documentation.

http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/CocoaViewsGuide/index.html

-Shawn


___

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

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

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

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


Re: Telling the Help menu Spotlight search to ignore certain items

2009-01-22 Thread Keith Blount
Okay, thanks again anyway. I've filed an enhancement request, and for now I'll 
just try to optimise the menu building as best as I can, being sure only to 
update them when they have actually changed.
Thanks again and all the best,
Keith


--- On Thu, 1/22/09, Eric Schlegel  wrote:

> From: Eric Schlegel 
> Subject: Re: Telling the Help menu Spotlight search to ignore certain items
> To: keithblo...@yahoo.com
> Cc: cocoa-dev@lists.apple.com
> Date: Thursday, January 22, 2009, 6:54 PM
> On Jan 22, 2009, at 6:23 AM, Keith Blount wrote:
> 
> > Many thanks for your reply. I'll file an
> enhancement request, but still looking for a solution to the
> problem, is there any way to be notified of when the Help
> menu is about to start doing this indexing? If there were, I
> could tell my dynamic menus not to rebuild themselves in
> that situation. I thought looking for -menuWillOpen: for the
> Help menu would work for this, but, somewhat uselessly, that
> delegate method only gets called *after* the Help menu has
> finished its indexing, immediately before it opens.
> 
> There are some Carbon event-based approaches to be
> notified, but I'm not sure they'll be that suitable
> for you in Leopard, due to other weaknesses in that
> approach. I don't think there's any Cocoa-based way
> to be notified.
> 
> -eric


  
___

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

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

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

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


Re: NSProgressIndicator not accepting updates

2009-01-22 Thread Andy Lee
What are the min and max values?  The defaults in IB are 20 and 100,  
so maybe you aren't seeing anything because the initial value of 0.5  
is too small.


--Andy

On Jan 22, 2009, at 2:17 PM, Aaron Wallis wrote:

Yeah, I realised that "%d" should be "%f" shorly after I send the  
email - however, even after I changed it the progress indicator  
still didn't update itself, and the value echo'ed was 20.5!?


I tried tinkering with the intdeterminate setting but, although it  
stopped the barber shop animation, it didn't display the progress.


Any other ideas?

On 23/01/2009, at 2:35 AM, Randall Meadows wrote:


On Jan 22, 2009, at 3:31 AM, Aaron Wallis wrote:

As an example, i've got a controller which has a  
NSProgressIndicator bound to it through IB, and on the  
awakeFromNib method I've got a little bit of code:


double tD = 0.5;
[progressBar setDoubleValue:tD];
NSLog(@"%d", [progressBar doubleValue]);


%d print integers, not doubles.

now when I run the application the progress bar is just doing it's  
barber shop thing and no progress is indicated.


Have you called -setIndeterminate:NO on the progress bar, or  
otherwise unchecked the Indeterminate checkbox in IB?




___

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

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

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

This email sent to ag...@mac.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: Bug with QTCaptureLayer..........?

2009-01-22 Thread Gordon Apple
As is supposedly the alternating start/stop when you change anything in the
layer.  I haven't had a chance to test it yet.  (Waiting on a new HD to
arrive to load Snow Leopard.)  BTW, I haven't seen an update since around
Dec. 1.  What's with that?


On 1/22/09 7:04 AM, "cocoa-dev-requ...@lists.apple.com"
 wrote:

> 
> 
> On 22 jan 2009, at 07:26, Anshul jain wrote:
> 
>> I am trying to capture live video. For displaying live video i am
>> using  QTCaptureLayer. It works fine with a USB Camera but as soon
>> as Firewire camera is use flickering starts happening. When i use
>> the QTCaptureView it works fine. Any suggestion where i am going
>> wrong or its a bug with QTCaptureLayer.?
> 
> It's a bug, and it is fixed in Snow Leopard.
> 
> Freddie Tilley



___

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

Please do not post admin requests or moderator comments to the list.
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: NSProgressIndicator not accepting updates

2009-01-22 Thread Aaron Wallis
Yeah, I realised that "%d" should be "%f" shorly after I send the  
email - however, even after I changed it the progress indicator still  
didn't update itself, and the value echo'ed was 20.5!?


I tried tinkering with the intdeterminate setting but, although it  
stopped the barber shop animation, it didn't display the progress.


Any other ideas?

On 23/01/2009, at 2:35 AM, Randall Meadows wrote:


On Jan 22, 2009, at 3:31 AM, Aaron Wallis wrote:

As an example, i've got a controller which has a  
NSProgressIndicator bound to it through IB, and on the awakeFromNib  
method I've got a little bit of code:


double tD = 0.5;
[progressBar setDoubleValue:tD];
NSLog(@"%d", [progressBar doubleValue]);


%d print integers, not doubles.

now when I run the application the progress bar is just doing it's  
barber shop thing and no progress is indicated.


Have you called -setIndeterminate:NO on the progress bar, or  
otherwise unchecked the Indeterminate checkbox in IB?




___

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

Please do not post admin requests or moderator comments to the list.
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: Switching NSDocument based application to tabbed views interface

2009-01-22 Thread Klaus Backert


On 22. Jan 2009, at 17:02, Ross Carter wrote:



On Jan 21, 2009, at 1:38 PM, Fritz Anderson wrote:


On 21 Jan 2009, at 9:42 AM, Ross Carter wrote:

Can someone give me a hint how can I switch one window per  
document model (that currently works as expected thanks to  
NSDocument) to one tab per document, same window?


This is answered in the archives. Search cocoabuilder.com for  
document window tabs


I'm sure it's answered in the archives _somewhere_, but searching  
cocoabuilder for "document window tabs" produces tens of thousands  
of results, and none in the first few pages is relevant.


That's odd. When I went to www.cocoabuilder.com, and typed "document  
window tabs" in the search field, I got 78 hits. The second one was  
a thread titled "Document based apps and tabbed windows."


If you really did get tens of thousands of results from the query I  
suggested, then I understand your frustration.


It's the difference between "Search for: All of the words" and "Search  
for: Any of the words". You can choose this in the "Advanced search".  
The default is _Any_, because of which more than 40.000 results are  
found in this case.


Klaus

___

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

Please do not post admin requests or moderator comments to the list.
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: Telling the Help menu Spotlight search to ignore certain items

2009-01-22 Thread Eric Schlegel


On Jan 22, 2009, at 6:23 AM, Keith Blount wrote:

Many thanks for your reply. I'll file an enhancement request, but  
still looking for a solution to the problem, is there any way to be  
notified of when the Help menu is about to start doing this  
indexing? If there were, I could tell my dynamic menus not to  
rebuild themselves in that situation. I thought looking for - 
menuWillOpen: for the Help menu would work for this, but, somewhat  
uselessly, that delegate method only gets called *after* the Help  
menu has finished its indexing, immediately before it opens.


There are some Carbon event-based approaches to be notified, but I'm  
not sure they'll be that suitable for you in Leopard, due to other  
weaknesses in that approach. I don't think there's any Cocoa-based way  
to be notified.


-eric

___

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

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

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

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


Re: Log4Cocoa

2009-01-22 Thread Kyle Sluder
On Thu, Jan 22, 2009 at 11:53 AM, Timothy Reaves
 wrote:
>There are a number of reasons to use Log4Cocoa over something like
> ASL.  The fact that it already supports Obj-C is the least of them.
> * It supports various logging levels,

As does ASL.

> * supports logging to other than the default system file,

ASL does this too.

> * different logging levels for different classes.  This is a biggie, as
> often when you are debugging, you want to see very detailed log messages,
> but only for the class or subsystem of interest.

I think it's important to remember that ASL is a key-value store, not
your traditional dump to a tab-delimited logfile.  You can log any set
of key-value pairs you want and filter it later.

--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: NSUserDefaultsController not updating defaults via binding

2009-01-22 Thread Matt Neuburg
On Fri, 16 Jan 2009 15:24:45 -0800, Luke Evans  said:
>I tried a set up where some UI (slider) bound to a property on a
>class, and separately this class' init programmatically set up a
>binding to NSUserDefaultsController sharedUserDefaultsController to
>initialise both the property and indirectly the slider control to
>which it was also bound.
>
>This worked great for initialisation.  The property and slider were
>indeed initialised to the value in the user defaults, and I could
>change this externally and see the initial properly/slider value
>change.  However, I was expecting that this code (being a binding)
>would also result in the user defaults being updated as the property
>value changed (as a result of moving the slider or writing to the
>property in another way).  Unfortunately, this doesn't happen.
>
>I've used NSUserDefaultsController many times in direct binding with
>UI controls (like everyone else), and it works perfectly
>bidirectionally with the simple binding.   I have also used
>programmatic binding to and observing of NSUserDefaultsController
>sharedUserDefaultsController many times to listen to properties
>changing in a one-way sense.  This is the first time I have tried this
>kind of configuration.
>
>There's an easy work around - just use NSUserDefaults to read the
>initial value, and to manually update the default when the property
>changes - but the attraction of a binding was hard to resist.  The
>docs also seem to keep hinting "use NSUserDefaults as the primary
>access - don't use NSUserDefaultsController for everything" (my
>paraphrase), but the reasons behind this recommendation aren't spelled
>out.
>
>Has anyone had similar experiences?  Is it unreasonable to expect this
>kind of binding configuration to work?

This is a very old source of confusion, so next time before posting a
question like this, check the archives, where the matter has been beaten to
death. Basically the short answer to your question is that there is no such
thing as a bidirectional binding; but some classes (i.e. NSControls) know
how to set up a binding in conjunction with KVO in such a way that changes
at either end are reflected back to the other end. Your programmatic binding
is between a class property and the user defaults, neither of which knows
how to do that, so you didn't get bidirectionality. A simple solution is to
add a second binding between the class property and the user defaults
running the other way. m.

-- 
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: 
AppleScript: the Definitive Guide - Second Edition!




___

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

Please do not post admin requests or moderator comments to the list.
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: NSTextView and front/middle/back ellipses

2009-01-22 Thread Randall Meadows

On Jan 22, 2009, at 11:03 AM, Harry Plate wrote:

I have a simple text view that will display its text information  
with an
ellipses on the right (end) if the string is too long for the view.  
Nice,

but...

How can I tell NSTextView to use a "front" or "middle" ellipses for  
viewing

purposes?


You'll have to set a (mutable) paragraph style, and specify  
NSLineBreakByTruncatingHead or NSLineBreakByTruncatingMiddle for the  
NSLineBreakMode using -setLineBreakMode:.

___

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

Please do not post admin requests or moderator comments to the list.
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: IBOutlet objects not responding to any messages passed

2009-01-22 Thread Cormac Daly
Thank you to everyone who replied to this query: it is now resolved.

I had created a custom class for the window controller in Interface Builder,
but I got rid of it and hooked up all the outlets via File's Owner instead.
I'm not sure exactly how this worked but it did!

Thanks again,
Cormac

On Thu, Jan 22, 2009 at 6:04 PM, Shawn Erickson  wrote:

> On Thu, Jan 22, 2009 at 2:44 AM, Cormac Daly  wrote:
>
> > Any ideas? Is there a problem in the ordering somewhere? Its probably
> > something very basic but I'm stumped!
>
> You are subclassing NSWindowController and NSWindowController will
> call windowDidLoad after the nib it loads is fully instantiated and
> wired up (outlets, etc. are set). In windowDidLoad (and after) it is
> safe to message outlets but before this point in time it is not. So
> what you tried in your init method isn't expected to work unless you
> send [self window]; after doing [super initWithWindowNibName:..].
>
> - (void) init
> {
>   if ((self = [super initWithWindowNibName: @"LicensingWindow"]) != nil)
>   {
>[self window]; force load of our window, windowWillLoad /
> windowDidLoad will fire
>   // no safe to message outlets but likely best to UI object
> configuration in windowDidLoad instead of here
>   }
> }
>
> If you aren't getting the what you expect in windowDidLoad then
> somehow your outlets are not hooked up correctly (at least not fully,
> sounds like your action connections are correct). I would compare the
> pointers you see in your outlets in windowDidLoad with the pointers
> you get via the "sender" parameter to your action methods to see if
> they are referencing the same objects (or NSLog(@"%@",
> theObjectPointer);) .
>
> As a guess... I bet you have an instance of your
> LicensingWindowController class instantiated in the nib that you are
> loading. You then connected the outlets from this in nib instance to
> your UI objects instead of connecting from File's Owner to your UI
> elements. You should not have an instance of LicensingWindowController
> inside of you nib since LicensingWindowController is meant to load and
> take ownership of a nib (aka become the File's Owner). Just make sure
> to change the class of File's Owner to be that of
> LicensingWindowController so you can see all of the actions and
> outlets you expect on File's Owner.
>
> Other possibilities are you simple didn't connect your outlets or
> possibly (long shot given the names you picked) you have setter
> methods masking your ivars that aren't setting instance vars
> correctly?
>
> -Shawn
>



-- 
Cormac
___

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

Please do not post admin requests or moderator comments to the list.
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: IBOutlet objects not responding to any messages passed

2009-01-22 Thread Shawn Erickson
On Thu, Jan 22, 2009 at 2:44 AM, Cormac Daly  wrote:

> Any ideas? Is there a problem in the ordering somewhere? Its probably
> something very basic but I'm stumped!

You are subclassing NSWindowController and NSWindowController will
call windowDidLoad after the nib it loads is fully instantiated and
wired up (outlets, etc. are set). In windowDidLoad (and after) it is
safe to message outlets but before this point in time it is not. So
what you tried in your init method isn't expected to work unless you
send [self window]; after doing [super initWithWindowNibName:..].

- (void) init
{
   if ((self = [super initWithWindowNibName: @"LicensingWindow"]) != nil)
   {
   [self window]; force load of our window, windowWillLoad /
windowDidLoad will fire
   // no safe to message outlets but likely best to UI object
configuration in windowDidLoad instead of here
   }
}

If you aren't getting the what you expect in windowDidLoad then
somehow your outlets are not hooked up correctly (at least not fully,
sounds like your action connections are correct). I would compare the
pointers you see in your outlets in windowDidLoad with the pointers
you get via the "sender" parameter to your action methods to see if
they are referencing the same objects (or NSLog(@"%@",
theObjectPointer);) .

As a guess... I bet you have an instance of your
LicensingWindowController class instantiated in the nib that you are
loading. You then connected the outlets from this in nib instance to
your UI objects instead of connecting from File's Owner to your UI
elements. You should not have an instance of LicensingWindowController
inside of you nib since LicensingWindowController is meant to load and
take ownership of a nib (aka become the File's Owner). Just make sure
to change the class of File's Owner to be that of
LicensingWindowController so you can see all of the actions and
outlets you expect on File's Owner.

Other possibilities are you simple didn't connect your outlets or
possibly (long shot given the names you picked) you have setter
methods masking your ivars that aren't setting instance vars
correctly?

-Shawn
___

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

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

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

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


NSTextView and front/middle/back ellipses

2009-01-22 Thread Harry Plate
I have a simple text view that will display its text information with an
ellipses on the right (end) if the string is too long for the view. Nice,
but...

How can I tell NSTextView to use a "front" or "middle" ellipses for viewing
purposes?

-h


___

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

Please do not post admin requests or moderator comments to the list.
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: Log4Cocoa

2009-01-22 Thread Karl Moskowski


On Jan 21, 2009, at 4:56 PM, Barry Wark wrote:


+1
ASL supports logging level filtering and redirection to one or more
URLs. It's a C library, but it's quite trivial to write an ObjC
wrapper on top (email me offline, if you'd like to take a look a my
code; I'm not quite ready to release it publically).



I tried ASL on my current project for a while, and it was great.

However, the default settings for syslogd on Leopard (Client, at  
least) caused its log DB to be pruned every Monday, and I needed at  
least a month's worth to hang around. If that's not a show-stopper for  
you, start by giving Peter Hosey's excellent series of articles from  
last year a read:




Karl Moskowski 
Voodoo Ergonomics Inc. 



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: IBOutlet objects not responding to any messages passed

2009-01-22 Thread Joseph Crawford

Did you make the connections in IB?
You need to do that on top of adding the outlets in code.

Joseph Crawford

On Jan 22, 2009, at 5:44 AM, Cormac Daly wrote:


Hi list,

I've added a new window to my application and have written a window
controller class. Everything is going fine, except for the fact that
when initialising the window, none of my IBOutlets are responding to
methods called on them. This is the case in both the init and
windowDidLoad methods - NSButtons are not responding to setEnabled
methods, NSTextFields are not responding to setStringValue methods,
etc. All relevant UI elements are visible but are not responding. No
warnings and nothing appearing in the console.

After the window has been initialised and loaded and after I begin to
interact with it (IBAction methods work fine) then my outlets respond
just fine. Very strange.

Here is how I'm creating the object:

m_LicensingWindow = [[[LicensingWindowController alloc] init] retain];

Part of the Declaration. I've snipped out many irrelevant parts of the
code for the sake of readability:

#import 

@interface LicensingWindowController : NSWindowController
{
   IBOutlet NSWindow * m_MainWindow;
   IBOutlet NSWindow * m_licensingPanel;

   IBOutlet NSButton * m_EditLicenseButton;
   IBOutlet NSTextField * m_EmailConfirmTextbox;
   IBOutlet NSTextField * m_EmailTextbox;
   IBOutlet NSButton * m_GetNewLicenseButton;
   IBOutlet NSTextField * m_HardwareKeyText;
   IBOutlet NSButton * m_HideProductsCheckbox;
   IBOutlet NSTextField * m_LicenseInfoLabel;

// snip
}

- (IBAction)showLicensingWindow:(id)sender;
- (bool)populateProductsPopupList;
- (IBAction)changeEmailAddressAction:(id)sender;
- (IBAction)changeEmailConfirmAddressAction:(id)sender;

// snip
@end

And part of the definition:

#import "LicensingWindowController.h"
#include 

// snip

@implementation LicensingWindowController

- (void) init
{
	if ((self = [super initWithWindowNibName: @"LicensingWindow"]) !=  
nil)

   {
// IBOutlets not responding here
}
}

- (void) windowDidLoad
{
// not responding here
[m_GetNewLicenseButton setEnabled: NO];
[m_HardwareKeyText setStringValue: @"Test"]];
}

- (IBAction)showLicensingWindow:(id)sender
{
[super showWindow:self];
}

- (IBAction)clickGetNewLicenseAction:(id)sender {
// responding fine here!
}

// snip
@end


Any ideas? Is there a problem in the ordering somewhere? Its probably
something very basic but I'm stumped!

Many thanks,
Cormac
___

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

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

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

This email sent to codeb...@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


IBOutlet objects not responding to any messages passed

2009-01-22 Thread Cormac Daly
Hi list,

I've added a new window to my application and have written a window
controller class. Everything is going fine, except for the fact that
when initialising the window, none of my IBOutlets are responding to
methods called on them. This is the case in both the init and
windowDidLoad methods - NSButtons are not responding to setEnabled
methods, NSTextFields are not responding to setStringValue methods,
etc. All relevant UI elements are visible but are not responding. No
warnings and nothing appearing in the console.

After the window has been initialised and loaded and after I begin to
interact with it (IBAction methods work fine) then my outlets respond
just fine. Very strange.

Here is how I'm creating the object:

m_LicensingWindow = [[[LicensingWindowController alloc] init] retain];

Part of the Declaration. I've snipped out many irrelevant parts of the
code for the sake of readability:

#import 

@interface LicensingWindowController : NSWindowController
{
IBOutlet NSWindow * m_MainWindow;
IBOutlet NSWindow * m_licensingPanel;

IBOutlet NSButton * m_EditLicenseButton;
IBOutlet NSTextField * m_EmailConfirmTextbox;
IBOutlet NSTextField * m_EmailTextbox;
IBOutlet NSButton * m_GetNewLicenseButton;
IBOutlet NSTextField * m_HardwareKeyText;
IBOutlet NSButton * m_HideProductsCheckbox;
IBOutlet NSTextField * m_LicenseInfoLabel;

// snip
}

- (IBAction)showLicensingWindow:(id)sender;
- (bool)populateProductsPopupList;
- (IBAction)changeEmailAddressAction:(id)sender;
- (IBAction)changeEmailConfirmAddressAction:(id)sender;

// snip
@end

And part of the definition:

#import "LicensingWindowController.h"
#include 

// snip

@implementation LicensingWindowController

- (void) init
{
if ((self = [super initWithWindowNibName: @"LicensingWindow"]) != nil)
{
// IBOutlets not responding here
}
}

- (void) windowDidLoad
{
// not responding here
[m_GetNewLicenseButton setEnabled: NO];
[m_HardwareKeyText setStringValue: @"Test"]];
}

- (IBAction)showLicensingWindow:(id)sender
{
[super showWindow:self];
}

- (IBAction)clickGetNewLicenseAction:(id)sender {
// responding fine here!
}

// snip
@end


Any ideas? Is there a problem in the ordering somewhere? Its probably
something very basic but I'm stumped!

Many thanks,
Cormac
___

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

Please do not post admin requests or moderator comments to the list.
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: OCUnit test failure - assert formatted text not presented [solved]

2009-01-22 Thread jonat...@mugginsoft.com

A bit of self inflicted stupidity here.
I had dragged in some logging code from another app which sneakily  
redirected stderr.

OCUnit test failures are now reported in the build transcript window.

On 22 Jan 2009, at 16:46, Timothy Reaves wrote:



On Jan 22, 2009, at 8:27 AM, jonat...@mugginsoft.com wrote:



On 22 Jan 2009, at 14:14, Jeremy Pereira wrote:



On 22 Jan 2009, at 13:27, jonat...@mugginsoft.com wrote:

I do not seem to be seeing the formatted about of my OCUnit STxxx  
macros.


My OCUnit test failures produce only the following output:

Error:Failed test for achitecture 'i386' (GC ON)


Last time I used the unit test framework (admittedly some time  
ago), it didn't support garbage collection.  Could that be the  
issue?


I think it does now support GC (corrections welcome) as the run  
test script contains such entries as :


RPUTINote ${LINENO} "Passed tests for architecture '$ 
{TEST_ARCH}' (GC ${TEST_GC_STATE})"


Also the tests themselves seem to be working okay, its just the  
output result in the build result window does not inform me which  
test has failed.






Yes, GC is supported.

There are a couple of things that can cause output to not display.   
The most common on is that the tests can't be executed for some  
reason.  Second, make sure you have clicked that little icon that  
shows the build transcript (and that the window is sized accordingly  
to not hide it); it's not the default.

___

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

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

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

This email sent to jonat...@mugginsoft.com


Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.com




___

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

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

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

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


Re: Custom Cocoa Component/Control

2009-01-22 Thread Shawn Erickson
On Wed, Jan 21, 2009 at 6:33 PM, Paul Franz  wrote:

> Can a custom NSControl/NSCell combo be used in a normal NSView?

Yes. This type of question implies you may want to dig a little more
deeply in the view documentation.

http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/CocoaViewsGuide/index.html

-Shawn
___

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

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

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

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


[SOLVED] NSScrollView Tiger v Leopard

2009-01-22 Thread David Blanton
My thanks to Kyle for shaming me into RTFM!  Upon changing my code to  
setDocumentView I get the same result on Tiger and Leopard, i.e when  
switching to a table view in the scroll view the thumb behaves properly.


Thanks!

David Blanton





___

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

Please do not post admin requests or moderator comments to the list.
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 buttons not scrolling?

2009-01-22 Thread Nick Zitzmann


On Jan 21, 2009, at 9:07 PM, Erik Buck wrote:

One possibility that answers the following question which is similar  
to yours:


Sigh. I actually did search for "NSScroller not scrolling", and got a  
bunch of results that had nothing to do with my problem, and it turns  
out that there was one result, under a different (and incorrect) name.  
Thanks; -verticalLineScroll was being zeroed out for some reason, and  
changing that fixed it.


Nick Zitzmann




___

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

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

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

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


Re: Reverse-engineering Apple's two-tinted gradient NSViews

2009-01-22 Thread Brandon Walkin
The view in question has a 4-stop gradient, with each stop positioned  
at a particular point, rather than spaced evenly. The view also draws  
a grey line at the top, so you'll want to reduce the height of the  
gradient rect by a pixel to leave space for it so you can draw it at  
some other point in drawRect:.


Here's the relevant code from BWToolkit (http://brandonwalkin.com/bwtoolkit 
):


static NSColor *topColor, *middleTopColor, *middleBottomColor,  
*bottomColor;

static NSGradient *gradient;

+ (void)initialize;
{
topColor = [[NSColor colorWithCalibratedWhite:(253.0f / 255.0f)  
alpha:1] retain];
middleTopColor = [[NSColor colorWithCalibratedWhite:(242.0f /  
255.0f) alpha:1] retain];
middleBottomColor = [[NSColor colorWithCalibratedWhite:(230.0f /  
255.0f) alpha:1] retain];
bottomColor	= [[NSColor colorWithCalibratedWhite:(230.0f /  
255.0f) alpha:1] retain];


gradient = [[NSGradient alloc] initWithColorsAndLocations:
   topColor, (CGFloat)0.0,
   middleTopColor, (CGFloat)0.45454,
   middleBottomColor, (CGFloat)0.45454,
   bottomColor, (CGFloat)1.0,
   nil];
}

- (void)drawRect:(NSRect)rect
{   
rect = self.bounds;

NSRect gradientRect =  
NSMakeRect 
(rect.origin.x,rect.origin.y,rect.size.width,rect.size.height - 1);

[gradient drawInRect:gradientRect angle:270];
}

On 22-Jan-09, at 7:57 AM, Sam Krishna wrote:


I think my understanding of NSGradient's use may be off here

I'm trying to create a custom NSView that uses NSGradient to shade  
the view in such a way that it mimics Apple's two-tints NSView. You  
can see the color scheme at the bottom left hand corner of Mail and  
the NSView at the bottom of Automator (I'm sure there are other  
apps, but I can't figure out which ones they are).


Here's the code I'm using for -drawRect:

- (void)drawRect:(NSRect)rect {
   // Drawing code here.
   NSArray *_colorArray = [NSArray arrayWithObjects:
   [NSColor colorWithDeviceRed:0.9843 green: 
0.9843 blue:0.9843 alpha:1.0],
   [NSColor colorWithDeviceRed:0.9608 green: 
0.9608 blue:0.9608 alpha:1.0],
   [NSColor colorWithDeviceRed:0.8824 green: 
0.8824 blue:0.8824 alpha:1.0],

   nil];

   NSGradient *_gradient = [[NSGradient alloc]  
initWithColors:_colorArray];

   [_gradient drawInRect:rect angle:90];
   [_gradient release];
}

Am I using the right NSGradient method? Is it the right angle?

I tried using -drawFromPoint:toPoint:options:, but that didn't work,  
either. Any ideas?


Live Playfully,

Sam
-
If he listens in faith,
finding no fault, a man is free
and will attain the cherished words
of those who act in virtue.

___

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

Please do not post admin requests or moderator comments to the list.
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/archive%40mail-archive.com

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


Re: Log4Cocoa

2009-01-22 Thread Timothy Reaves


On Jan 21, 2009, at 4:56 PM, Barry Wark wrote:

On Wed, Jan 21, 2009 at 1:15 PM, Kyle Sluder   
wrote:
On Wed, Jan 21, 2009 at 2:58 PM, Robert Kukuchka  
 wrote:

  I'm looking into logging frameworks and see references to this
project. Does anyone know if this project is still running? I was  
hoping to
find some examples of how to get things setup. Anyone here use it  
within a
commercial application? Our Mac team is small, so if I don't have  
to "roll

my own", I'd rather not.


Why not use ASL, since it's built into the OS?
http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/asl.3.html


+1
ASL supports logging level filtering and redirection to one or more
URLs. It's a C library, but it's quite trivial to write an ObjC
wrapper on top (email me offline, if you'd like to take a look a my
code; I'm not quite ready to release it publically).



	There are a number of reasons to use Log4Cocoa over something like  
ASL.  The fact that it already supports Obj-C is the least of them.

* It supports various logging levels,
* supports logging to other than the default system file,
* different logging levels for different classes.  This is a biggie,  
as often when you are debugging, you want to see very detailed log  
messages, but only for the class or subsystem of interest.
* the ability to configure logging from a config file or  
programatically,

* the ability to change logging level without restarting the app,
* custom formatting of output,
* automatic log rotation,
* and others.
___

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

Please do not post admin requests or moderator comments to the list.
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


Memory Management - Best practices

2009-01-22 Thread Yvan BARTHÉLEMY

Hello,

I am implementing mouse support in Core Animation. For this I have a  
CAButton : CALayer and adds button-related behavior : highlighting on  
mouseDown, stopping highlighting on mouseExit, etc. and actions.


The actions are associated using:
 -[CAButton setAction:(SEL) withTarget:(SEL)]

These are performed on mouseUp if the mouse is still within the  
button's rect.


The problem that occurred is that the action might cause the button to  
be removed by a side-effect of performSelector (ex. a view switch) and  
I might still need to perform additional actions that needs button's  
ivars after performSelector has been called (which might cause  
unexpected behavior).


When I encounter the problem, I changed mouseUp so it does not need to  
perform any action after the performSelector. But I am wondering if  
there are special practices to prevent this problem : should we assume  
that the button will not be released by the performAction, retain it  
before the performSelector and release it after, or do not use self  
after performSelector ?


Thanks for your advice,
Yvan
___

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

Please do not post admin requests or moderator comments to the list.
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: OCUnit test failure - assert formatted text not presented

2009-01-22 Thread Timothy Reaves


On Jan 22, 2009, at 8:27 AM, jonat...@mugginsoft.com wrote:



On 22 Jan 2009, at 14:14, Jeremy Pereira wrote:



On 22 Jan 2009, at 13:27, jonat...@mugginsoft.com wrote:

I do not seem to be seeing the formatted about of my OCUnit STxxx  
macros.


My OCUnit test failures produce only the following output:

Error:Failed test for achitecture 'i386' (GC ON)


Last time I used the unit test framework (admittedly some time  
ago), it didn't support garbage collection.  Could that be the issue?


I think it does now support GC (corrections welcome) as the run test  
script contains such entries as :


RPUTINote ${LINENO} "Passed tests for architecture '$ 
{TEST_ARCH}' (GC ${TEST_GC_STATE})"


Also the tests themselves seem to be working okay, its just the  
output result in the build result window does not inform me which  
test has failed.






Yes, GC is supported.

There are a couple of things that can cause output to not display.   
The most common on is that the tests can't be executed for some  
reason.  Second, make sure you have clicked that little icon that  
shows the build transcript (and that the window is sized accordingly  
to not hide it); it's not the default.

___

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

Please do not post admin requests or moderator comments to the list.
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: Switching NSDocument based application to tabbed views interface

2009-01-22 Thread Ross Carter


On Jan 21, 2009, at 1:38 PM, Fritz Anderson wrote:


On 21 Jan 2009, at 9:42 AM, Ross Carter wrote:

Can someone give me a hint how can I switch one window per  
document model (that currently works as expected thanks to  
NSDocument) to one tab per document, same window?


This is answered in the archives. Search cocoabuilder.com for  
document window tabs


I'm sure it's answered in the archives _somewhere_, but searching  
cocoabuilder for "document window tabs" produces tens of thousands  
of results, and none in the first few pages is relevant.


That's odd. When I went to www.cocoabuilder.com, and typed "document  
window tabs" in the search field, I got 78 hits. The second one was a  
thread titled "Document based apps and tabbed windows."


If you really did get tens of thousands of results from the query I  
suggested, then I understand your frustration.

___

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

Please do not post admin requests or moderator comments to the list.
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: NSProgressIndicator not accepting updates

2009-01-22 Thread Randall Meadows

On Jan 22, 2009, at 3:31 AM, Aaron Wallis wrote:

As an example, i've got a controller which has a NSProgressIndicator  
bound to it through IB, and on the awakeFromNib method I've got a  
little bit of code:


double tD = 0.5;
[progressBar setDoubleValue:tD];
NSLog(@"%d", [progressBar doubleValue]);


%d print integers, not doubles.

now when I run the application the progress bar is just doing it's  
barber shop thing and no progress is indicated.


Have you called -setIndeterminate:NO on the progress bar, or otherwise  
unchecked the Indeterminate checkbox in IB?


___

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

Please do not post admin requests or moderator comments to the list.
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


Writing to an iFrame with Javascript

2009-01-22 Thread Alex Mills
Hey,

I have built a Javascript WYSIWYG editor here : 
http://www.alexmillsdesign.com/Developer/FernEngine/Default.htm

I want to send the contents of a NSTextView to the iFrame in the editor.

I have tried using some of the methods in the CallJS sample app but while I'm 
able to open and close the iFrame, I cannot write to it.

Any help would be very much appreciated.

Cheers
Alex Mills

___

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

Please do not post admin requests or moderator comments to the list.
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: OCUnit test failure - assert formatted text not presented

2009-01-22 Thread jonat...@mugginsoft.com


On 22 Jan 2009, at 14:14, Jeremy Pereira wrote:



On 22 Jan 2009, at 13:27, jonat...@mugginsoft.com wrote:

I do not seem to be seeing the formatted about of my OCUnit STxxx  
macros.


My OCUnit test failures produce only the following output:

Error:Failed test for achitecture 'i386' (GC ON)


Last time I used the unit test framework (admittedly some time ago),  
it didn't support garbage collection.  Could that be the issue?


I think it does now support GC (corrections welcome) as the run test  
script contains such entries as :


RPUTINote ${LINENO} "Passed tests for architecture '${TEST_ARCH}' (GC $ 
{TEST_GC_STATE})"


Also the tests themselves seem to be working okay, its just the output  
result in the build result window does not inform me which test has  
failed.






Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.com




___
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list  (xcode-us...@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/adc%40jeremyp.net

This email sent to a...@jeremyp.net




Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.com




___

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

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

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

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


Re: Telling the Help menu Spotlight search to ignore certain items

2009-01-22 Thread Keith Blount
Many thanks for your reply. I'll file an enhancement request, but still looking 
for a solution to the problem, is there any way to be notified of when the Help 
menu is about to start doing this indexing? If there were, I could tell my 
dynamic menus not to rebuild themselves in that situation. I thought looking 
for -menuWillOpen: for the Help menu would work for this, but, somewhat 
uselessly, that delegate method only gets called *after* the Help menu has 
finished its indexing, immediately before it opens.

Thanks again and all the best,
Keith


--- On Thu, 1/22/09, Eric Schlegel  wrote:

> From: Eric Schlegel 
> Subject: Re: Telling the Help menu Spotlight search to ignore certain items
> To: keithblo...@yahoo.com
> Cc: cocoa-dev@lists.apple.com
> Date: Thursday, January 22, 2009, 4:53 AM
> On Jan 21, 2009, at 1:59 PM, Keith Blount wrote:
> 
> > So, my question is: is there a way of telling the Help
> menu to ignore certain menus when it does this search each
> time it is clicked on?
> 
> No, there's no way to avoid indexing of your menus,
> sorry. Please file a feature request describing what
> you'd like to do in this case.
> 
> -eric


  
___

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

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

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

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


Re: Reverse-engineering Apple's two-tinted gradient NSViews

2009-01-22 Thread jonat...@mugginsoft.com


On 22 Jan 2009, at 12:57, Sam Krishna wrote:


I think my understanding of NSGradient's use may be off here

I'm trying to create a custom NSView that uses NSGradient to shade  
the view in such a way that it mimics Apple's two-tints NSView. You  
can see the color scheme at the bottom left hand corner of Mail and  
the NSView at the bottom of Automator (I'm sure there are other  
apps, but I can't figure out which ones they are).


Here's the code I'm using for -drawRect:

- (void)drawRect:(NSRect)rect {
   // Drawing code here.
   NSArray *_colorArray = [NSArray arrayWithObjects:
   [NSColor colorWithDeviceRed:0.9843 green: 
0.9843 blue:0.9843 alpha:1.0],
   [NSColor colorWithDeviceRed:0.9608 green: 
0.9608 blue:0.9608 alpha:1.0],
   [NSColor colorWithDeviceRed:0.8824 green: 
0.8824 blue:0.8824 alpha:1.0],

   nil];

   NSGradient *_gradient = [[NSGradient alloc]  
initWithColors:_colorArray];

   [_gradient drawInRect:rect angle:90];
   [_gradient release];
}


What is the result of running this code presently?

I use the following code to draw a two tone gradient.
I always draw the entire bounds rather than the rect parameter (which  
is only telling you the part of the view that has been invalidated).
There is also an IB framework that implements this view rendering -  
perhaps someone else on the list recalls the name.


- (void)drawRect:(NSRect)rect {

rect = [self bounds];

NSGraphicsContext* gc = [NSGraphicsContext currentContext];

[gc setShouldAntialias:NO];

// gradient
NSBezierPath *bgPath = [NSBezierPath bezierPathWithRect:rect];
NSColor *endColor = self.endColor;
NSColor *startColor = self.startColor;

	NSGradient *gradient = [[NSGradient alloc]  
initWithStartingColor:startColor endingColor:endColor];

[gradient drawInBezierPath:bgPath angle:90.0];
}


Am I using the right NSGradient method? Is it the right angle?

I tried using -drawFromPoint:toPoint:options:, but that didn't work,  
either. Any ideas?


Live Playfully,

Sam
-
If he listens in faith,
finding no fault, a man is free
and will attain the cherished words
of those who act in virtue.

___

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

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

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

This email sent to jonat...@mugginsoft.com


Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.com




___

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

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

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

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


Re: Reverse-engineering Apple's two-tinted gradient NSViews

2009-01-22 Thread Sam Krishna

Two points:

1. "Reverse-engineer" may be a little strong. "Mimicking" is what I'm  
going after.


2. I meant to say "right" (nee correct) angle, not right angle. Please  
don't respond with a pithy "all 90 degree angles are the right angle"


Live Playfully,

Sam
-
If he listens in faith,
finding no fault, a man is free
and will attain the cherished words
of those who act in virtue.

On Jan 22, 2009, at 7:57 AM, Sam Krishna wrote:


I think my understanding of NSGradient's use may be off here

I'm trying to create a custom NSView that uses NSGradient to shade  
the view in such a way that it mimics Apple's two-tints NSView. You  
can see the color scheme at the bottom left hand corner of Mail and  
the NSView at the bottom of Automator (I'm sure there are other  
apps, but I can't figure out which ones they are).


Here's the code I'm using for -drawRect:

- (void)drawRect:(NSRect)rect {
   // Drawing code here.
   NSArray *_colorArray = [NSArray arrayWithObjects:
   [NSColor colorWithDeviceRed:0.9843 green: 
0.9843 blue:0.9843 alpha:1.0],
   [NSColor colorWithDeviceRed:0.9608 green: 
0.9608 blue:0.9608 alpha:1.0],
   [NSColor colorWithDeviceRed:0.8824 green: 
0.8824 blue:0.8824 alpha:1.0],

   nil];

   NSGradient *_gradient = [[NSGradient alloc]  
initWithColors:_colorArray];

   [_gradient drawInRect:rect angle:90];
   [_gradient release];
}

Am I using the right NSGradient method? Is it the right angle?

I tried using -drawFromPoint:toPoint:options:, but that didn't work,  
either. Any ideas?


Live Playfully,

Sam
-
If he listens in faith,
finding no fault, a man is free
and will attain the cherished words
of those who act in virtue.

___

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

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

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

This email sent to infin...@mac.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


Reverse-engineering Apple's two-tinted gradient NSViews

2009-01-22 Thread Sam Krishna

I think my understanding of NSGradient's use may be off here

I'm trying to create a custom NSView that uses NSGradient to shade the  
view in such a way that it mimics Apple's two-tints NSView. You can  
see the color scheme at the bottom left hand corner of Mail and the  
NSView at the bottom of Automator (I'm sure there are other apps, but  
I can't figure out which ones they are).


Here's the code I'm using for -drawRect:

- (void)drawRect:(NSRect)rect {
// Drawing code here.
NSArray *_colorArray = [NSArray arrayWithObjects:
[NSColor colorWithDeviceRed:0.9843 green: 
0.9843 blue:0.9843 alpha:1.0],
[NSColor colorWithDeviceRed:0.9608 green: 
0.9608 blue:0.9608 alpha:1.0],
[NSColor colorWithDeviceRed:0.8824 green: 
0.8824 blue:0.8824 alpha:1.0],

nil];

NSGradient *_gradient = [[NSGradient alloc]  
initWithColors:_colorArray];

[_gradient drawInRect:rect angle:90];
[_gradient release];
}

Am I using the right NSGradient method? Is it the right angle?

I tried using -drawFromPoint:toPoint:options:, but that didn't work,  
either. Any ideas?


Live Playfully,

Sam
-
If he listens in faith,
finding no fault, a man is free
and will attain the cherished words
of those who act in virtue.

___

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

Please do not post admin requests or moderator comments to the list.
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


Playing quartz composition using manual opengl rendering creates extreme flicker

2009-01-22 Thread Jonathan Selander

Hi,

I use the method from the QCTV example to play a quartz composition  
with the difference that i use a qcview and then the opengl context of  
it to render the qc instead of creating the opengl context myself.  
This works like a charm with my iSight on a power mac G5, but when i  
try it on an intel imac, the second time i start the program, the  
image starts to flicker extremely. If i enlarge the screen the flicker  
dissappears, but when i start the recording process, the flicker comes  
back. What can be a possible cause for this? How can i get rid of 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: Distributed Objects

2009-01-22 Thread I. Savant

On Jan 21, 2009, at 11:21 PM, Michael Ash wrote:

I'm sure we're all dying to know, are there actually two people with  
that exact same name and e-mail address, or what?


  Well ... sort of.

  http://en.wikipedia.org/wiki/Two-Face

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


Re: Bug with QTCaptureLayer..........?

2009-01-22 Thread Anshul jain
Is there any alternative for it. because when i use the QTCaptureView  
my application performance really degrades . Is CAOpenGLLayer will be  
a good idea ?


On 22-Jan-09, at 1:51 PM, Freddie Tilley wrote:



On 22 jan 2009, at 07:26, Anshul jain wrote:

I am trying to capture live video. For displaying live video i am  
using  QTCaptureLayer. It works fine with a USB Camera but as soon  
as Firewire camera is use flickering starts happening. When i use  
the QTCaptureView it works fine. Any suggestion where i am going  
wrong or its a bug with QTCaptureLayer.?


It's a bug, and it is fixed in Snow Leopard.

Freddie Tilley
___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/anshul.jain%40prithvisolutions.com

This email sent to anshul.j...@prithvisolutions.com



Thanks & Regards

Anshul jain
anshul.j...@prithvisolutions.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: NSProgressIndicator not accepting updates

2009-01-22 Thread Robert Martin

If I remember correctly, %d requires an integer

On Jan 22, 2009, at 11:31 AM, Aaron Wallis wrote:


double tD = 0.5;
[progressBar setDoubleValue:tD];
NSLog(@"%d", [progressBar doubleValue]);

___

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

Please do not post admin requests or moderator comments to the list.
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


NSProgressIndicator not accepting updates

2009-01-22 Thread Aaron Wallis

Hi there,

This is probably a really obvious bug, but I can't seem to get my  
NSProgressIndicator to show progress when using incrementBy: or  
setDoubleValue:.


As an example, i've got a controller which has a NSProgressIndicator  
bound to it through IB, and on the awakeFromNib method I've got a  
little bit of code:


double tD = 0.5;
[progressBar setDoubleValue:tD];
NSLog(@"%d", [progressBar doubleValue]);

now when I run the application the progress bar is just doing it's  
barber shop thing and no progress is indicated.
When I check the logs out I simply get a result of "0" instead of the  
0.5 i set.
Even when I try to set the min and max values and use larger numbers  
(say a range from 0 to 100, and increment to 50) it still doesn't  
update.


I can't seem to work it out and I (sadly) have wasted so much time on  
a seemingly simple task.


Does anyone have any pointers on where I could be going wrong?

Cheers
___

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

Please do not post admin requests or moderator comments to the list.
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: Is there any mirroring in the Cocoa UI ?

2009-01-22 Thread eric.bachard

[CC m...@porting.openoffice.org , as answer to the initial question]

Hi,

Gary L. Wade a écrit :

Not in the sense you get from the Windows platform whereby setting a flag on
the parent window causes everything to automatically jump to the opposite
side of the window and lay itself out right-to-left. 


Indeed, that's what I had in mind.


Such alignment
requires a different layout (NIB/code/etc.), although with controls like
check boxes and radio buttons, you can affect such a result by changing the
icon placement to be on the right rather than the left.


Ok, thanks a lot for your answer :)

Regards,
Eric Bachard


On 01/21/2009 8:24 AM, "eric b"  wrote:



Hello the list,
The idea is to use an application who needs RTL ( e.g. arabic or hebrew) and 
the question is : is there any mirroring in the UI ?
After searching a while, we found no mention of that in the Aqua Human 
Interface Guideline.
Thanks in advance for any hint  :-)

Eric Bachard
_

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



--
Education Project: 
http://wiki.services.openoffice.org/wiki/Education_Project

L'association EducOOo : http://www.educoo.org
Blog : http://eric.bachard.free.fr/news

___

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

Please do not post admin requests or moderator comments to the list.
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: Format float value to display with commas

2009-01-22 Thread Tharindu Madushanka
Great, thanks


On Wed, Jan 21, 2009 at 8:43 PM, Rob Boellaard  wrote:

>
>  In addition to Kenneth Bruno's suggestion, there is also the Data
> Formatting guide:
>
>
> http://developer.apple.com/documentation/Cocoa/Conceptual/DataFormatting/DataFormatting.html
>
>  hth,
>
>  Rob
>
>
>
>
> On Jan 21, 2009, at 12:59 PM, Tharindu Madushanka wrote:
>
>  Hi
>> I have float variables that stores my currency values, I want to display
>> these values in a string with commas at each 3 digits, can I do it with
>> Objective C. I am new to the language. Please help me to solve this.
>> For example, float ft = 12333.8905;
>> NSString *strFloat = [NSString stringWithFormat:@"%.2f",ft];
>>
>> this will show my float value with 2 decimal places 12333.89 , But I want
>> it
>> to be displayed as 12,333.89
>> Can I do it with objective-C. I want to create a string like above from my
>> float value.
>>
>> Thanks
>> Tharindu
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/rboell%40tuparev.com
>>
>> This email sent to rbo...@tuparev.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/tharindufit%40gmail.com
>
> This email sent to tharindu...@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: Bug with QTCaptureLayer..........?

2009-01-22 Thread Freddie Tilley


On 22 jan 2009, at 07:26, Anshul jain wrote:

I am trying to capture live video. For displaying live video i am  
using  QTCaptureLayer. It works fine with a USB Camera but as soon  
as Firewire camera is use flickering starts happening. When i use  
the QTCaptureView it works fine. Any suggestion where i am going  
wrong or its a bug with QTCaptureLayer.?


It's a bug, and it is fixed in Snow Leopard.

Freddie Tilley
___

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

Please do not post admin requests or moderator comments to the list.
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: Saving Permanent IDs in Document-Based App

2009-01-22 Thread Derek Kuhl
	I created a document-based core data application and want it to be  
able to add external files from a support folder.  I can successfully  
set the permanent URIs for the transient relationships working in  
memory, but for some reason saving to file never works properly.  If I  
tell each object to save the context using save: in the didSave:  
method, it will save a duplicate in the file.  If I try to save the  
context in the document's document:didSave:contextInfo: method  
mentioned in the documentation, it works again but doesn't save.   
Thank you in advance for any information someone has on what I'm doing  
wrong.


-Derek
___

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

Please do not post admin requests or moderator comments to the list.
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