Re: Writing a notifier app

2008-06-05 Thread Michael Gardner
Have you looked at Growl?

-Michael

Abhiram Dwivedi wrote:
> Hi,
> 
> I need to build a functionality similar to gmail notifier.
> 
> Any pointers if Cocoa would be the right approach or if some other technology 
> (python?) can be used to create such an app? Also, if you know of a similar 
> open source project, it would be great.
> 
> Can you please suggest where to begin with / what to use.
> 
> Thanks,
> Abhiram
> 
> 
> Send instant messages to your online friends http://uk.messenger.yahoo.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/gardnermj%40gmail.com
> 
> This email sent to [EMAIL PROTECTED]
___

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

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

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

This email sent to [EMAIL PROTECTED]


How to enable crash log generation in 10.5?

2008-06-05 Thread parag vibhute
Hi all,

I have implemented Cocoa application where I am handling exceptions through
signal handling.

I went through the Apple TechNote TN2123 (
http://developer.apple.com/technotes/tn2004/tn2123.html). It states
following statement:

*Prior to Mac OS X 10.5, if you wrote a program that cause an exception but
handled that exception via a signal handler ,
CrashReporter would erroneously generate a crash log for your program (r.
2941263) .


*Now my requirement is that OS should generate crash log for my application
in Mac OS 10.5 also (which will not happen by default as per above
statement). So how to achieve this?

Thanks,
Palav


-- 

There are many things in your life that will catch your eye but only a few
will catch your heartpursue those'.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Where to start looking to fix hang?

2008-06-05 Thread Vijay Malhan
On Thu, Jun 5, 2008 at 9:47 AM, Graham Cox <[EMAIL PROTECTED]> wrote:

> In my app I'm getting a hang when my main document window is asked to
> close. This occurs only if there are unsaved changes, but it hangs before
> the "unsaved changes" sheet is presented.
>
> If I link against the 10.4u SDK (but still run on 10.5), this does not
> occur, but if I link against the 10.5 SDK, I get the problem. Obviously
> something changed between the two implementations.
>
> Where should I start to look to debug/fix this? I just can't see where I
> need to set a breakpoint to begin with.
>

Use SpinControl and ThreadViewer applications in Development tools. It will
give you the exact call on which the thread is waiting.
- Vijay


>
>
>
> tia,
>
>
> Graham
>
>
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/vijay.malhan%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: How to enable crash log generation in 10.5?

2008-06-05 Thread Vijay Malhan
On Thu, Jun 5, 2008 at 12:51 PM, parag vibhute <[EMAIL PROTECTED]>
wrote:

> Hi all,
>
> I have implemented Cocoa application where I am handling exceptions through
> signal handling.
>
> I went through the Apple TechNote TN2123 (
> http://developer.apple.com/technotes/tn2004/tn2123.html). It states
> following statement:
>
> *Prior to Mac OS X 10.5, if you wrote a program that cause an exception but
> handled that exception via a signal handler ,
> CrashReporter would erroneously generate a crash log for your program (r.
> 2941263) .
>
>
> *Now my requirement is that OS should generate crash log for my application
> in Mac OS 10.5 also (which will not happen by default as per above
> statement). So how to achieve this?


If you need a StackTrace on some exception, you can do that by registering
for delegate calls to NSExceptionHandler.

// Tells you for what kind of Exception you want to register for..

[[NSExceptionHandler defaultExceptionHandler] setExceptionHandlingMask:

exceptionHandlingMask];

[[NSExceptionHandler defaultExceptionHandler] setDelegate: self];

// Delegate method to implement. Gets call when there is an exception.
- (BOOL)exceptionHandler:(NSExceptionHandler *)sender
shouldHandleException:(NSException *)exception mask:(unsigned int)aMask

{

// Log the stack here...

[exception printStackTrace];

return YES;

}



- Vijay

>
>
> Thanks,
> Palav
>
>
> --
>
> There are many things in your life that will catch your eye but only a few
> will catch your heartpursue those'.
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/vijay.malhan%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Linking dependancies

2008-06-05 Thread Damien Cooke

Hi,
Here is a dumb question for you :)  It is actually more of an XCode  
question so feel free to let me know if this is the wrong place.  I  
have built a project it has 2 targets one an executable and one a  
dylib.  They both compile fine.  I need to link the executable against  
the dylib but I can not add my dylib to the list of frameworks and  
libraries.  Is there some special trick here because they are part of  
the same project as I am able to add other libraries that way?


Regards
Damien



"We act as though comfort and luxury were the chief requirements of  
life, when all that we need to make us happy is something to be  
enthusiastic about."


-- Albert Einstein



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Linking dependancies

2008-06-05 Thread Karsten
you could try the "other linker flags" in the build settings, i think  
you can somehow specify the dylib there.


Kind Regards
Karsten




Am 05.06.2008 um 13:03 schrieb Damien Cooke:


Hi,
Here is a dumb question for you :)  It is actually more of an XCode  
question so feel free to let me know if this is the wrong place.  I  
have built a project it has 2 targets one an executable and one a  
dylib.  They both compile fine.  I need to link the executable  
against the dylib but I can not add my dylib to the list of  
frameworks and libraries.  Is there some special trick here because  
they are part of the same project as I am able to add other  
libraries that way?


Regards
Damien



"We act as though comfort and luxury were the chief requirements of  
life, when all that we need to make us happy is something to be  
enthusiastic about."


-- Albert Einstein



___

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

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

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

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Linking dependancies

2008-06-05 Thread Vijay Malhan
In XCode, Drag your dylib to the "Link with libraries" group under  
your app target. You may also want to add your dylib target as a  
dependency to your app.

- Vijay
Sent from my iPhone

On 05-Jun-08, at 4:33 PM, Damien Cooke <[EMAIL PROTECTED]>  
wrote:



Hi,
Here is a dumb question for you :)  It is actually more of an XCode  
question so feel free to let me know if this is the wrong place.  I  
have built a project it has 2 targets one an executable and one a  
dylib.  They both compile fine.  I need to link the executable  
against the dylib but I can not add my dylib to the list of  
frameworks and libraries.  Is there some special trick here because  
they are part of the same project as I am able to add other  
libraries that way?


Regards
Damien



"We act as though comfort and luxury were the chief requirements of  
life, when all that we need to make us happy is something to be  
enthusiastic about."


-- Albert Einstein



___

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

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

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

This email sent to [EMAIL PROTECTED]

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Drawing over a QTCaptureView

2008-06-05 Thread douglas a. welton

Ben,

one more suggestion - subclass the QTCaptureView  and add a CALayer.  
Then, do your drawing on the CALayer, as opposed to the the  
QTCaptureView's Layer.


I haven't tried this myself, so it may not work...  but if it does, it  
provides a way for you to do your drawing without having to  
transmogrify the CIImage in the delegate method.


later,

douglas


On Jun 5, 2008, at 1:40 AM, Ben Lachman wrote:


Gordon:

	I think view:willDisplayImage: is the way to do it, although it is  
a bit kludgey in my opinion since you have to convert to something  
drawable and then back.  Attached is the code I worked up.  It  
should work on 10.4 and 10.5.  All it does is draw a centered  
rounded square over the QTCaptureView's preview image.


- (CIImage *)view:(QTCaptureView *)view willDisplayImage:(CIImage  
*)image {

NSImage *capturedImage = [[NSImage alloc] init];
	[capturedImage addRepresentation:[NSCIImageRep  
imageRepWithCIImage:image]];


[capturedImage lockFocus];

NSSize imageSize = [capturedImage size];
NSRect overlayRect = NSZeroRect;
overlayRect.size = imageSize;   
overlayRect.size.width = NSHeight(overlayRect);

overlayRect.origin.x = (imageSize.width - NSWidth(overlayRect))/2;

overlayRect = NSInsetRect(overlayRect, 6, 6);

CGFloat oldLineWidth = [NSBezierPath defaultLineWidth];
[NSBezierPath setDefaultLineWidth:4];
[[[NSColor grayColor] colorWithAlphaComponent:.75] set];

[NSBezierPath strokeRoundRectInRect:overlayRect radius:10];
[NSBezierPath setDefaultLineWidth:oldLineWidth];

[capturedImage unlockFocus];

// create CIImage from data
	CIImage * ciImage = [[CIImage alloc] initWithData:[capturedImage  
TIFFRepresentation]];


[capturedImage release];

return [ciImage autorelease];
}

Hope this helps,

->Ben

--
Ben Lachman
Acacia Tree Software

http://acaciatreesoftware.com

email: [EMAIL PROTECTED]
twitter: @benlachman
mobile: 740.590.0009



On Jun 4, 2008, at 8:40 PM, Gordon Apple wrote:

   And then what can you do with it?  Although I've been able to  
rotate the
image with a transform, I still haven't figured out how to clip the  
image to
a Bezier.  You can't focus and draw into a CIImage like you can a  
NSImage.
If it were the latter, I could just use NSBezier setClip.  After  
drowning in

filter documentation, I gave up for now.

   Apparently, from what I can tell, the whole purpose of CIImage  
is to get
it done in the GPU instead of the CPU.  Unfortunately, I haven't  
found any

useful documentation on how to do simple functions with these things.
Posting on the QT forum got no response.


Ben,

check out the documentation for QTCaptureView delegate:

- (CIImage *)view:(QTCaptureView *)view willDisplayImage :(CIImage
*)image

this will give you access to the display pipeline.

later,

douglas

On Jun 4, 2008, at 4:01 PM, Ben Lachman wrote:


I'm wonder what's the easiest way to draw a simple box over a
QTCaptureView.  Overriding drawRect doesn't work and putting  
another

view over the QTCV doesn't work.  Any Thoughts?

Thanks,
->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/blachman%40mac.com

This email sent to [EMAIL PROTECTED]


___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/douglas_welton%40earthlink.net

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: App hangs when displaying any sheet in 10.5 [was Re: Where to start looking to fix hang?]

2008-06-05 Thread Graham Cox

OK, this is really weird, and frustratingly difficult to get a grip on.

By preventing certain things initialising in my app, I can get sheets  
to work. So I'm quite prepared to agree that it's something I'm doing  
that is causing some subtle corruption somewhere that just happens to  
throw a spanner in the works at this one point.


The trouble is I seem to be chasing phantoms, since in one case I can  
prevent the problem simply by commenting out a simple assignment to an  
ivar in one of my classes - but there's really nothing wrong with it -  
I've n-tuple checked it. (And I know writing that I'm getting a  
sinking feeling that no-one will believe me, and want to see the code,  
etc, etc). I've moved the ivars around, added some guard values around  
it, but nothing makes a difference. But it's almost certainly a red- 
herring, because I can find many other ways to get sheets to work by  
completely different routes that don't touch this code. The point is,  
it's *touchy*. It's hard to pin down because my app is fairly complex  
and almost anything I do to try and flush the problem out stops it  
initialising in quite major ways, meaning that the culprit could  
literally be anywhere. But if it is corruption, it's not major because  
the app otherwise is functioning normally - I see no other evidence of  
a problem.


Back to basics: seems as if the thread is deadlocked when animating  
the sheet (yes? no? is mach_msg_trap anything to do with thread locks,  
or am I guessing wrong?). Without looking at the Appkit source I have  
no way to tell what lock that's waiting on, so there's no clue there.  
However since I'm not using threads or locks in my own code, it  
doesn't seem likely to be a real lock state anyway - again I expect  
something dodgy in my code has blown away the lock or the code that is  
using it. I have no idea how to look for that sort of problem, or what  
kind of code might do this (if I were using C arrays, overrunning the  
end is pretty common, but I'm only using NSArray and other container  
classes). It's like looking for a needle in a haystack.


Can anyone suggest any techniques I might try to help flush this out?  
I ran ThreadViewer but I get the same stack trace as shown below.  
SpinControl isn't any help because it only lists addresses, not  
symbols. But as I'm convinced the problem isn't really here, this  
stack trace is no help anyway. Any tools to pick up writing off the  
end of an object or other mem allocation?


Graham

On 5 Jun 2008, at 3:07 pm, Graham Cox wrote:

Another example for one of my own sheets, but the hang is in the  
same place:


#0  0x94fc54a6 in mach_msg_trap
#1  0x94fccc9c in mach_msg
#2  0x9234f0be in CFRunLoopRunSpecific
#3  0x9234fcf8 in CFRunLoopRunInMode
#4  0x905c7c3f in -[NSMoveHelper _doAnimation]
#5  0x905c6756 in -[NSMoveHelper(NSSheets) _moveParent:andOpenSheet:]
#6  0x905c5f7c in -[NSWindow(NSSheets) _orderFrontRelativeToWindow:]
#7	0x90422465 in -[NSWindow  
_reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:]
#8	0x904642e7 in -[NSApplication  
_orderFrontModalWindow:relativeToWindow:]
#9	0x90463d4f in -[NSApplication  
_commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo 
:]
#10	0x0001040b in -[GCPolarDuplicateController  
beginPolarDuplicationDialog:polarDelegate:] at  
GCPolarDuplicateController.m:69
#11	0x24ee in -[GCOrteliusDocument polarDuplicate:] at  
GCOrteliusDocument.m:99

#12 0x90435c23 in -[NSApplication sendAction:to:from:]
[...]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Problem with cblas_sgemm in 64 bit build

2008-06-05 Thread Rick Hoge


Thanks for the suggestions -

I had already scoured the 64-bit transition guide, and didn't think I  
needed to use NSInteger and CGFloat since integers and floats appear  
to be the same size for both 32 and 64 bit builds.


Just to be sure though, I tried replacing any int and float  
declarations touching this code with NSInteger and CGFloat, but I  
still got the problem.


As usual I'm sure it will turn out to be some silly small thing (and  
not a mysterious alignment issue with CBLAS).  The strange thing is  
that the problem only arises when the matrices involved exceed a  
certain size.


Rick

On 4-Jun-08, at 2:08 PM, Kyle Sluder wrote:


Take a look at NSInteger and CGFloat, and the 64-Bit Transition Guide
for Cocoa: 
http://developer.apple.com/documentation/Cocoa/Conceptual/Cocoa64BitGuide/ConvertingExistingApp/chapter_4_section_3.html

--Kyle Sluder


___

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

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

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

This email sent to [EMAIL PROTECTED]


CATextLayer question

2008-06-05 Thread Davide Scheriani

I was playing with my NSView and CATextLayer.
I placed this code:

-(void)mouseDown:(NSEvent *)theEvent
{

NSPoint p = [theEvent locationInWindow];

CATextLayer *textLayer=[CATextLayer layer];
textLayer.string=[arr objectAtIndex: (random() % [arr count])];
textLayer.font=@"Georgia";
textLayer.fontSize = 72.0;

int hue = random() % 100;
float hueAfter=hue;
	textLayer.foregroundColor=[NSColor colorWithCalibratedHue:hueAfter/ 
100 saturation:1 brightness:0.9 alpha:1];



	[textLayer addConstraint:[CAConstraint	 
constraintWithAttribute:kCAConstraintMinX

relativeTo:@"superlayer"
attribute:kCAConstraintMinX
offset:p.x-15]];
	[textLayer addConstraint:[CAConstraint	 
constraintWithAttribute:kCAConstraintMinY

relativeTo:@"superlayer"
attribute:kCAConstraintMinY
offset:p.y-35]];

[rootLayer addSublayer:textLayer];
}

what ive noticed is when I click,the text appear with a fadein.
Any reason of this behaviour?

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: App hangs when displaying any sheet in 10.5 [was Re: Where to start looking to fix hang?]

2008-06-05 Thread Andy Lee
If there were a Dr. House for debugging, this is the kind of  
diagnostic challenge he'd like.


Stab in the dark: you mentioned that you're on 10.5.3.  Do you have a  
10.5.2 machine you can use to see if the hang still occurs?  Maybe  
it's not a Tiger/Leopard thing but a 10.5.2/10.5.3 thing.


--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 [EMAIL PROTECTED]


Cocoa n00b frustrations

2008-06-05 Thread Charles Jenkins
Hi! Despite the fact that you have heard from me before on this list, I 
am still an newbie trying to struggle through writing my first Cocoa app.


I have experienced a couple of frustrations that I would like to share 
to see if anyone knows tools or practices that will help avoid them in 
the future.


NAUGHTY NIBS

I had a Nib file that went bad. Suddenly, my outlets doubled up: IB 
indicated that a class had two outlets named 'textField1' and 'textField2'.


When it came time to make connections, I had no way to tell the real 
ones from the ghost ones, so I changed the outlets' names in my code 
files and resynchronized. From that point, IB insisted that both the old 
and new connections existed. Worried that this might be the source of 
another problem I was having, I did everything I could think of to get 
rid of the non-existent outlets: I deleted the .h/.m and recreated them; 
I deleted and recreated the NSObject instance in IB; I deleted both the 
.h/.m pair AND the NSObject instance and recreated it all using a 
different class name (MyController instead of WindowController); and 
finally closed down IB and Xcode and edited the XIB file with 
TextWrangler to delete the non-existent outlet names.


Nothing worked--the new NSObject instance always magically retained the 
memory of  textField1 and textField2--until I gave up on the Nib file by 
renaming my project directory and creating a new project so that I would 
start with a fresh Nib file. Then I moved my .h/.m files over and 
connected them with no problem to the new Nib.


Is there any kind of Nib repair utility that will clean up a Nib file to 
remove outlets, actions, and classes that do not connect up to anything 
in code? Having such an important file just suddenly "go bad" and have 
to be recreated from scratch is a real bummer.


DELEGATE DISILLUSIONMENT

You create an object (.h, .m, and object instance in IB) that a control 
(like a table view) will use as a delegate. Using the documentation, you 
cut and paste the delegate's signature to eliminate any chance that a 
typo will prevent it from working. In IB, you make sure that the 
control's 'delegate:' is connected to the object.


At runtime, the delegate never gets called.

If checking and rechecking the connection and the method's declaration 
and implementation doesn't help, how do you solve the problem?


Objective-C's delegation paradigm is like magic when it works, but 
mysterious and frustrating when there is a problem. Besides a malformed 
method signature and a missing IB connection, what else could be wrong?


FINALLY

Anyone know of a Cocoa user group in the Knoxville, Tennessee area?

Thanks!
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: How to enable crash log generation in 10.5?

2008-06-05 Thread parag vibhute
This only works if exception occurs in main thread. I have created a thread
using pthread APIs, but if exception occurs in that thread then it does not
get caught. So what to do?

Parag

On Thu, Jun 5, 2008 at 1:14 PM, Vijay Malhan <[EMAIL PROTECTED]> wrote:

>
>
> On Thu, Jun 5, 2008 at 12:51 PM, parag vibhute <[EMAIL PROTECTED]>
> wrote:
>
>> Hi all,
>>
>> I have implemented Cocoa application where I am handling exceptions
>> through
>> signal handling.
>>
>> I went through the Apple TechNote TN2123 (
>> http://developer.apple.com/technotes/tn2004/tn2123.html). It states
>> following statement:
>>
>> *Prior to Mac OS X 10.5, if you wrote a program that cause an exception
>> but
>> handled that exception via a signal handler ,
>> CrashReporter would erroneously generate a crash log for your program (r.
>> 2941263) .
>>
>>
>> *Now my requirement is that OS should generate crash log for my
>> application
>> in Mac OS 10.5 also (which will not happen by default as per above
>> statement). So how to achieve this?
>>
>
> If you need a StackTrace on some exception, you can do that by registering
> for delegate calls to NSExceptionHandler.
>
> // Tells you for what kind of Exception you want to register for..
>
> [[NSExceptionHandler defaultExceptionHandler] setExceptionHandlingMask:
>
> exceptionHandlingMask];
>
> [[NSExceptionHandler defaultExceptionHandler] setDelegate: self];
>
> // Delegate method to implement. Gets call when there is an exception.
> - (BOOL)exceptionHandler:(NSExceptionHandler *)sender
> shouldHandleException:(NSException *)exception mask:(unsigned int)aMask
>
> {
>
> // Log the stack here...
>
> [exception printStackTrace];
>
> return YES;
>
> }
>
>
>
> - Vijay
>
>>
>>
>> Thanks,
>> Palav
>>
>>
>> --
>>
>> There are many things in your life that will catch your eye but only a few
>> will catch your heartpursue those'.
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/vijay.malhan%40gmail.com
>>
>> This email sent to [EMAIL PROTECTED]
>>
>
>


-- 

There are many things in your life that will catch your eye but only a few
will catch your heartpursue those'.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Newbie question:IB, NSView, NSViewController

2008-06-05 Thread Johnny Andersson

Hi,

I'm a newcomer and I've been learning Cocoa for about a month now.  
I've successfully created simple GUI apps to get acquainted with the  
environment, but now I've hit a little wall trying to grasp the  
concepts.


It's about NSView and NSViewController. Bear in mind that I come from C 
++/Qt (if you're familiar with that); I'm probably still applying the  
Qt way of thinking to Cocoa, and I'm trying my best to shift mindset.  
Please bear with me. ;-)


I've created a View (let's call it DrawView) where the user can draw  
lines. It is created directly in code, DrawView.{m,h}. It has two  
IBActions: undo and clear.   It doesn't do anything else, because I  
may want to reuse this code for another purpose.


To make it more specific for this application, I want to embed that  
view in a larger view, created in Interface Builder,  that contains  
two buttons (Undo / Clear), connected to the actions in the DrawView.  
No problem, I just drag an NSView on this parent view and  set the  
type to DrawView.


Finally, I want to use a NSViewController as the glue between my view  
and a handwriting recognition engine.  This is where I don't know how  
to continue.


To understand what I have problems with, let's suppose that I want to  
put a "module" consisting of an NSViewController, controlling the view  
with two buttons, which in turn contains a DrawView, on my main  
window. Do I put my DrawViewController in  the root of the MainWindow  
NIB, and if so, how do I specify where the view will end up? Or, do I  
instantiate a a DrawViewController in my DrawView NIB, and put a  
DrawView directly into the main window?


I know I'm not explaining this very well; I don't understand the  
concepts well enough to do that yet. If it helps, here's what I would  
have done if I was using Qt:

1) Create DrawWidget
2) Create FancyDrawWidget (containing the buttons, a DrawWidget and  
connections)
3) Create HandwritingWidget, which contains all the logic + a  
FancyDrawWidget.

4) Plop a HandwritingWidget somewhere on my main window.

I'd be grateful for any help - including help on "how to ask the right  
question".


Kind regards,
Johnny


___

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

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

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

This email sent to [EMAIL PROTECTED]


RESTful Web Services & PUT

2008-06-05 Thread Jeff LaMarche
I noticed that there's been some discussion  of RESTful web services.  
I've been having problem with PUT requests using NSMutableURLRequest,  
one that has been asked about on the list before, but I never saw an  
answer or workaround posted. After some digging  I found a workaround  
to my problem that I thought I'd share so that anyone searching the  
archives would find it.


The problem I've been experiencing is that when making an HTTP 1.1 PUT  
request, my form parameters passed in the request body are not being  
recognized by the web service. A little digging with wireshark showed  
that the reason for that is that NSMutableURLRequest is not setting  
the Content-Type parameter for PUT requests, though it is for POST  
requests. This missing header causes most web services to ignore the  
request body. The solution is to simply add the following line of code  
before sending it to the server (req is the NSMutableURLRequest):


[req setValue:@"application/x-www-form-urlencoded"  
forHTTPHeaderField:@"Content-Type"];


This issue has been submitted to Apple as problem ID 5988016, but I  
thought I'd put the workaround here for anyone who's experiencing the  
problem:



___

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

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

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

This email sent to [EMAIL PROTECTED]


IB label (textfield) as URL / mail-address how?

2008-06-05 Thread Mike

Hello,

Is there a simple way to make a label (NSTextField) on form to be a  
hyperlink in IB ?
Like for example e-mail address on aboutbox. Once clicked it opens  
mail etc...


I know with little code it is possible but is there some shortcut in  
Leopard and "new" IB ?


Thanks.

-Mike
___

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

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

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

This email sent to [EMAIL PROTECTED]


Subject: Re: Keyboard Layout Services

2008-06-05 Thread Charles Jenkins

Jean-Daniel, merci!

I am happy to learn about the Text Input Source Services.

Because Cocoa is the preferred way to write OS X programs, that's what I'm 
trying to learn. I don't understand why Apple would push Cocoa and then provide 
some API's only in the Carbon library, but I can accept the answer that using 
Carbon API's is the right way to go for now. :-)


Jean-Daniel Dupas wrote:


Why the replacement should be Cocoa ?
Actualy, the successor of "KL Services" are "Text Input Source  
Services".


http://developer.apple.com/documentation/TextFonts/Reference/TextInputSourcesReference/Reference/reference.html



Le 3 juin 08 à 05:49, Charles Jenkins a écrit :


Hi! I'm looking to learn about modern, Cocoa equivalents for the  
deprecated functions described in the "Keyboard Layout Services  
Reference."


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Cocoa n00b frustrations

2008-06-05 Thread Andreas Mayer


Am 05.06.2008 um 15:32 Uhr schrieb Charles Jenkins:


I had a Nib file that went bad.


Never had that problem, so I can't help much. But, as you found out,  
the best way to fix it is probably to create a completely new nib.


You create an object (.h, .m, and object instance in IB) that a  
control (like a table view) will use as a delegate.


You typically do not instantiate delegate objects in IB.
Usually you will create your delegates in code and connect them to  
your view objects through outlets.


If checking and rechecking the connection and the method's  
declaration and implementation doesn't help, how do you solve the  
problem?


You need to make sure that you are *really* working/testing with the  
object instance that you did connect to in IB.


Objective-C's delegation paradigm is like magic when it works, but  
mysterious and frustrating when there is a problem.


There's nothing magic or mysterious in regard to delegates. A delegate  
is just an object that another object will send messages to.


Besides a malformed method signature and a missing IB connection,  
what else could be wrong?


You got the wrong object instance? It is a rather common mistake by  
new developers to instantiate an object in IB *and* create an instance  
in code. You end up with two distinct objects and are likely to  
confuse the two - or rather you might not even realise that there is  
more than one object.



Andreas
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: App hangs when displaying any sheet in 10.5 [SOLVED]

2008-06-05 Thread Graham Cox

OK, I found the culprit. As suspected, it has nothing to do with sheets.

I'm using a sorting function with NSMutableArray:

static int cmpColorStops (DKColorStop* lh, DKColorStop* rh, void  
*context)

{
#pragma unused(context)

float lp = [lh position];
float rp = [rh position];

if (lp < rp)
return NSOrderedAscending;
else if (lp > rp)
return NSOrderedDescending;
else
return NSOrderedSame;
}

- (void)sortColorStops
{   
[m_colorStops sortUsingFunction:cmpColorStops context:NULL];
}

In my original code, the sort function was declared:

static int cmpColorStops (id lh, id rh, void *context);

Which compiled just fine. Problem is that rp = [rh position]; was  
returning some utterly bogus value, because the assumption was an  
int(?) was being returned from the anonymous object type, not a float.  
Specifically typing the parameters to the sort function removes this  
ambiguity. As it turns out, the bogus values did sort correctly,  
because their relative values were in the right order, which is why  
I've never spotted this before. What I'm still not clear about is how  
this can cause memory corruption, because a float and an int are the  
same size. I'm also not sure why it was OK on Tiger (though possibly  
just due to chance layout differences in memory).


Further thought: could it be that in Tiger, no Cocoa objects declare a  
method called -position, so it correctly picked up my private object's  
method signature. In Leopard, both CALayer and NSPositionalSpecifier  
declare a -position method, so the compiler is assuming one of those  
for the anonymous objects. CALayer's version returns a CGPoint, which  
being larger than a float could explain the memory corruption?


I've actually run into almost the same bug before and it was equally  
hard to track down. It would be useful if there was a compiler warning  
for an implicit cast or mismatch of return type in cases like this,  
because otherwise they are devilishly hard to spot. If there is such a  
warning, please tell me, so I can spare myself future hunts of this  
kind (this one has taken a solid 11 hours to find and fix, primarily  
because cause and effect were completely unrelated!)


Thanks to everyone who pitched in - very grateful.

cheers, Graham




On 5 Jun 2008, at 11:08 pm, Andy Lee wrote:

If there were a Dr. House for debugging, this is the kind of  
diagnostic challenge he'd like.


Stab in the dark: you mentioned that you're on 10.5.3.  Do you have  
a 10.5.2 machine you can use to see if the hang still occurs?  Maybe  
it's not a Tiger/Leopard thing but a 10.5.2/10.5.3 thing.


--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/graham.cox%40bigpond.com

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Cocoa n00b frustrations

2008-06-05 Thread Graham Cox


On 5 Jun 2008, at 11:32 pm, Charles Jenkins wrote:

Hi! Despite the fact that you have heard from me before on this  
list, I am still an newbie trying to struggle through writing my  
first Cocoa app.


I have experienced a couple of frustrations that I would like to  
share to see if anyone knows tools or practices that will help avoid  
them in the future.


NAUGHTY NIBS

I had a Nib file that went bad. Suddenly, my outlets doubled up: IB  
indicated that a class had two outlets named 'textField1' and  
'textField2'.


When it came time to make connections, I had no way to tell the real  
ones from the ghost ones, so I changed the outlets' names in my code  
files and resynchronized. From that point, IB insisted that both the  
old and new connections existed. Worried that this might be the  
source of another problem I was having, I did everything I could  
think of to get rid of the non-existent outlets: I deleted the .h/.m  
and recreated them; I deleted and recreated the NSObject instance in  
IB; I deleted both the .h/.m pair AND the NSObject instance and  
recreated it all using a different class name (MyController instead  
of WindowController); and finally closed down IB and Xcode and  
edited the XIB file with TextWrangler to delete the non-existent  
outlet names.


Nothing worked--the new NSObject instance always magically retained  
the memory of  textField1 and textField2--until I gave up on the Nib  
file by renaming my project directory and creating a new project so  
that I would start with a fresh Nib file. Then I moved my .h/.m  
files over and connected them with no problem to the new Nib.


Is there any kind of Nib repair utility that will clean up a Nib  
file to remove outlets, actions, and classes that do not connect up  
to anything in code? Having such an important file just suddenly "go  
bad" and have to be recreated from scratch is a real bummer.



I have seen this happen as well. Not sure, but it might be an IB 3  
bug, as I never saw it until IB3.


You *can* remove the bogus references without starting over. If I  
recall correctly, you can see them in the list of available outlets in  
the 'Connections' tab and hit the 'X' button to delete each one.



hth,

G.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: App hangs when displaying any sheet in 10.5 [SOLVED]

2008-06-05 Thread Randall Meadows

On Jun 5, 2008, at 9:26 AM, Graham Cox wrote:

It would be useful if there was a compiler warning for an implicit  
cast or mismatch of return type in cases like this, because  
otherwise they are devilishly hard to spot. If there is such a  
warning, please tell me, so I can spare myself future hunts of this  
kind (this one has taken a solid 11 hours to find and fix, primarily  
because cause and effect were completely unrelated!)


GCC_WARN_PROTOTYPE_CONVERSION?

AKA "Prototype Conversion" in project settings.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Newbie question:IB, NSView, NSViewController

2008-06-05 Thread Andreas Mayer


Am 05.06.2008 um 15:46 Uhr schrieb Johnny Andersson:

let's suppose that I want to put a "module" consisting of an  
NSViewController, controlling the view with two buttons, which in  
turn contains a DrawView, on my main window.


You don't put controllers on windows.

Do I put my DrawViewController in  the root of the MainWindow NIB,  
and if so, how do I specify where the view will end up?


Which view? You may move views around - even between windows. But I'm  
not sure that is what you are asking about.


Or, do I instantiate a a DrawViewController in my DrawView NIB, and  
put a DrawView directly into the main window?


That's possible. If it is what you *want* to do, I don't know ...


If it helps, here's what I would have done if I was using Qt:
1) Create DrawWidget
2) Create FancyDrawWidget (containing the buttons, a DrawWidget and  
connections)
3) Create HandwritingWidget, which contains all the logic + a  
FancyDrawWidget.

4) Plop a HandwritingWidget somewhere on my main window.


I don't know Qt, so that doesn't help much. Sounds like this design  
does not properly differentiate between view and controller.


Like I said above: You don't place controllers on windows. You *may*  
put them inside nibs.



Andreas
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: CATextLayer question

2008-06-05 Thread Brian Christensen

On Jun 5, 2008, at 9:04 , Davide Scheriani wrote:


I was playing with my NSView and CATextLayer.
I placed this code:

-(void)mouseDown:(NSEvent *)theEvent
{
// [...snip...]

[rootLayer addSublayer:textLayer];
}

what ive noticed is when I click,the text appear with a fadein.
Any reason of this behaviour?


Modifying most layer properties as well as adding/removing sublayers  
generates implicit animations. You can temporarily disable animations  
by wrapping the relevant code in a CATransaction:


- (void)mouseDown:(NSEvent *)theEvent
{
[CATransaction begin];
	[CATransaction setValue:(id)kCFBooleanTrue  
forKey:kCATransactionDisableActions];


// [...snip...]
[rootLayer addSublayer:textLayer];

[CATransaction commit];
}

/brian



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 [EMAIL PROTECTED]

Re: App hangs when displaying any sheet in 10.5 [SOLVED]

2008-06-05 Thread Graham Cox

Hmmm, I don't think so. The docs say:

Warn if a prototype causes a type conversion that is different from  
what would happen to the same argument in the absence of a prototype.   
This includes conversions of fixed point to floating and vice versa,  
and conversions changing the width or signedness of a fixed point  
argument except when the same as the default promotion.


Also, warn if a negative integer constant expression is implicitly  
converted to an unsigned type.  For example, warn about the assignment  
"x = -1" if "x" is unsigned.  But do not warn about explicit casts  
like "(unsigned) -1".  [GCC_WARN_PROTOTYPE_CONVERSION, -Wconversion]




If I turn this on, I get thousands of warnings, none of which appear  
to be telling me anything useful (i.e. the code is perfectly  
legitimate). With that amount of noise if it does pick up the odd case  
like this I'm never going to see it.


thanks anyway,


G.


On 6 Jun 2008, at 1:33 am, Randall Meadows wrote:


On Jun 5, 2008, at 9:26 AM, Graham Cox wrote:

It would be useful if there was a compiler warning for an implicit  
cast or mismatch of return type in cases like this, because  
otherwise they are devilishly hard to spot. If there is such a  
warning, please tell me, so I can spare myself future hunts of this  
kind (this one has taken a solid 11 hours to find and fix,  
primarily because cause and effect were completely unrelated!)


GCC_WARN_PROTOTYPE_CONVERSION?

AKA "Prototype Conversion" in project settings.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Programatically manipulating an xcdatamodel package?

2008-06-05 Thread Allen Cronce

Hi all,

I posted this question on the Xcode-users list and did not receive a  
response, so I'm trying here.


I'm interested in programmatically manipulating "User Info" key/value  
pairs in a large data model package. The resulting saved xcdatamodel  
package will be used for automatic code generation via mogenerator and  
custom templates.


I'm open to any way to do this, including scripting Xcode to modify  
the model, or writing a command line utility that manipulates the  
package directly. Unfortunately a cursory look at the "elements" plist  
file indicates to me that manipulating its proprietary structure might  
be challenging. The plist seems to be an object archive, but I suspect  
the objects are Xcode proprietary.


Maybe the right way to do this is to momc the xcdatamodel package,  
manipulate the compiled result with the NSManagedObjectModel API's,  
then import the .mom file back into Xcode?


Thanks in advance for any suggestions.

Best,

Allen Cronce
___

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

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

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

This email sent to [EMAIL PROTECTED]


Getting rid of specific "May not respond" messages

2008-06-05 Thread Dale Jensen
This may be an Xcode question, rather than Cocoa, but it relates more  
to the language, so I'll ask here.


In my project, I get a number of warnings that are invalid, telling me  
that something or another "may not respond" to something, when in  
fact, it can.  As an example, I get a lot of these:


warning: 'NSString' may not respond to '- 
stringByReplacingOccurrencesOfString:withString:'

warning: 'NSFileManager' may not respond to '-removeItemAtPath:error:'
warning: 'WebView' may not respond to '-mainFrameURL'

while are all Cocoa framework calls, which do work.  In some  
instances, I've found that tracking down a header file and #importing  
it sometimes gets rid of the message, but not always (can't seem to  
get rid of the three shown here, ever.)


As my project grows, I have more and more of these, and after each  
build, I find myself wading through them to make sure that the  
warnings I'm getting are just these invalid ones, nothing in the code  
I've added.  It's also a nuisance to try and edit code with the  
bubbles in there, and closing the bubble does not result in it staying  
closed after the next build.  Not having the bubbles on solves that  
bit but, again, I'm losing useful functionality due to improper (and  
hopefully fixable) behaviour.


I don't want to ditch all "may not respond" messages, as they do often  
point out a problem, but these incorrect and superfluous ones are  
starting to drive me nuts.  Any suggestions or help in getting rid of  
them would be well appreciated.


Thanks!


dale

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Getting rid of specific "May not respond" messages

2008-06-05 Thread Kyle Sluder
On Thu, Jun 5, 2008 at 11:50 AM, Dale Jensen <[EMAIL PROTECTED]> wrote:
> This may be an Xcode question, rather than Cocoa, but it relates more to the
> language, so I'll ask here.
>
> In my project, I get a number of warnings that are invalid, telling me that
> something or another "may not respond" to something, when in fact, it can.
>  As an example, I get a lot of these:
>
> warning: 'NSString' may not respond to
> '-stringByReplacingOccurrencesOfString:withString:'
> warning: 'NSFileManager' may not respond to '-removeItemAtPath:error:'
> warning: 'WebView' may not respond to '-mainFrameURL'
>
> while are all Cocoa framework calls, which do work.  In some instances, I've
> found that tracking down a header file and #importing it sometimes gets rid
> of the message, but not always (can't seem to get rid of the three shown
> here, ever.)

Have you remembered to #import ?  What does your
project's prefix header look like, if any?  Are you linking with
-framework AppKit?

--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 [EMAIL PROTECTED]


Re: Getting rid of specific "May not respond" messages

2008-06-05 Thread Dale Jensen

On Jun 5, 2008, at 10:55 AM, Kyle Sluder wrote:


Have you remembered to #import ?  What does your
project's prefix header look like, if any?  Are you linking with
-framework AppKit?



Yes.  Prefix header includes Cocoa and Webkit.  Appkit is listed under  
Frameworks > Other



dale

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Getting rid of specific "May not respond" messages

2008-06-05 Thread j o a r


On Jun 5, 2008, at 8:50 AM, Dale Jensen wrote:

In my project, I get a number of warnings that are invalid, telling  
me that something or another "may not respond" to something, when in  
fact, it can.  As an example, I get a lot of these:


warning: 'NSString' may not respond to '- 
stringByReplacingOccurrencesOfString:withString:'

warning: 'NSFileManager' may not respond to '-removeItemAtPath:error:'
warning: 'WebView' may not respond to '-mainFrameURL'

while are all Cocoa framework calls, which do work.  In some  
instances, I've found that tracking down a header file and  
#importing it sometimes gets rid of the message, but not always  
(can't seem to get rid of the three shown here, ever.)



These are all methods added in Mac OS X 10.5. Check the SDK settings  
for your target.


j o a r


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: App hangs when displaying any sheet in 10.5 [SOLVED]

2008-06-05 Thread Brian Stern


On Jun 5, 2008, at 11:26 AM, Graham Cox wrote:

OK, I found the culprit. As suspected, it has nothing to do with  
sheets.


I'm using a sorting function with NSMutableArray:

static int cmpColorStops (DKColorStop* lh, DKColorStop* rh, void  
*context)


In my original code, the sort function was declared:

static int cmpColorStops (id lh, id rh, void *context);

Which compiled just fine. Problem is that rp = [rh position]; was  
returning some utterly bogus value, because the assumption was an  
int(?) was being returned from the anonymous object type, not a  
float. Specifically typing the parameters to the sort function  
removes this ambiguity. As it turns out, the bogus values did sort  
correctly, because their relative values were in the right order,  
which is why I've never spotted this before. What I'm still not  
clear about is how this can cause memory corruption, because a float  
and an int are the same size. I'm also not sure why it was OK on  
Tiger (though possibly just due to chance layout differences in  
memory).


While float and int are the same size they are returned from functions  
in different registers (on both ppc and intel). If the calling  
function expects a float returned type but an int is returned instead  
the calling function will certainly get a bogus value. In addition it  
may save and restore the wrong registers and not save and restore a  
register that needs to be preserved, resulting in memory corruption.


The 'may not respond to selector' warning might be expected in cases  
like this.


Normally assigning a float to an int is perfectly legal so no warning  
should be generated on that account.  Perhaps if there were a warning  
indicating that two different return types are possible it might help  
in cases like this.



Further thought: could it be that in Tiger, no Cocoa objects declare  
a method called -position, so it correctly picked up my private  
object's method signature. In Leopard, both CALayer and  
NSPositionalSpecifier declare a -position method, so the compiler is  
assuming one of those for the anonymous objects. CALayer's version  
returns a CGPoint, which being larger than a float could explain the  
memory corruption?


I've actually run into almost the same bug before and it was equally  
hard to track down. It would be useful if there was a compiler  
warning for an implicit cast or mismatch of return type in cases  
like this, because otherwise they are devilishly hard to spot. If  
there is such a warning, please tell me, so I can spare myself  
future hunts of this kind (this one has taken a solid 11 hours to  
find and fix, primarily because cause and effect were completely  
unrelated!)


Thanks to everyone who pitched in - very grateful.

cheers, Graham



--
Brian Stern
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Getting rid of specific "May not respond" messages

2008-06-05 Thread Dale Jensen

On Jun 5, 2008, at 11:11 AM, j o a r wrote:

These are all methods added in Mac OS X 10.5. Check the SDK settings  
for your target.



Yep, that's got it, thanks.  Changing the SDK causes a bunch of other  
problems, but now at least I know what the issue is.


Though they're added in 10.5, might they still function under the last  
builds of 10.4?  I haven't heard of problems from people using that OS.


Thanks again!


dale

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Problem with cblas_sgemm in 64 bit build

2008-06-05 Thread Rick Hoge


As usual I'm sure it will turn out to be some silly small thing (and  
not a mysterious alignment issue with CBLAS).  The strange thing is  
that the problem only arises when the matrices involved exceed a  
certain size.


After further testing with simplified test cases, I think it actually  
is a bug in the CBLAS function cblas_sgemm that pops up in 64-bit  
builds.  I filed it (bug id 5988197).


Searching the lists.apple.com archives I did not find very many  
mentions of CBLAS or this function - I posted a more detailed  
description of my tests, with sample code, in perfoptimization-dev  
(which seems to have very low traffic).


As a workaround, I'm using the double-precision version cblas_dgemm,  
which works fine (although it's not really what I want).


Rick


Rick

On 4-Jun-08, at 2:08 PM, Kyle Sluder wrote:


Take a look at NSInteger and CGFloat, and the 64-Bit Transition Guide
for Cocoa: 
http://developer.apple.com/documentation/Cocoa/Conceptual/Cocoa64BitGuide/ConvertingExistingApp/chapter_4_section_3.html

--Kyle Sluder


___

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

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

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

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


NSKeyPathExpression and message was received but not handled?

2008-06-05 Thread Colin Cornaby

I'm getting exceptions thrown like the following:

id: An -observeValueForKeyPath:ofObject:change:context: message was  
received but not handled.

Key path: firstName
Observed object: 
Change: {
kind = 1;
}

When I debug, "id" seems to be the description for a  
NSKeyPathExpression. I'm not adding these as observers, as far as I  
know. Is Cocoa doing this automatically? Anyone have any experience  
with this sort of issue?


Thanks,
Colin
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Newbie question:IB, NSView, NSViewController

2008-06-05 Thread Jonathan Dann


On 5 Jun 2008, at 14:46, Johnny Andersson wrote:


To understand what I have problems with, let's suppose that I want  
to put a "module" consisting of an NSViewController, controlling the  
view with two buttons, which in turn contains a DrawView, on my main  
window. Do I put my DrawViewController in  the root of the  
MainWindow NIB, and if so, how do I specify where the view will end  
up? Or, do I instantiate a a DrawViewController in my DrawView NIB,  
and put a DrawView directly into the main window?


I know I'm not explaining this very well; I don't understand the  
concepts well enough to do that yet. If it helps, here's what I  
would have done if I was using Qt:

1) Create DrawWidget
2) Create FancyDrawWidget (containing the buttons, a DrawWidget and  
connections)
3) Create HandwritingWidget, which contains all the logic + a  
FancyDrawWidget.

4) Plop a HandwritingWidget somewhere on my main window.

I'd be grateful for any help - including help on "how to ask the  
right question".


Kind regards,
Johnny


It really depends on the larger architecture of your app on how you  
want to do this.  The reason NSViewController exists is to offload  
view-specific code into a controller for that view (or view hierarchy)  
so that the code does not all go in your app controller or a window  
controller.


With something that was a simple 1 window app with a draw view as a  
subview of the window's content view and the buttons you describe also  
as subviews of the content view then a window controller may do.  As  
you say though if you can encapsulate this better you can ease reusing  
this code.


I've written a sample app and post together with Cathy Shive on (what  
we think) is a good and general way of using NSViewController and the  
extras we've added to make it fit into the MVC paradigm properly, you  
can find it on her blog http://katidev.com  The main way I would set  
this up is to create a view nib with your draw view (or your draw view  
as a subview of some other view) in it an little else (a contextual  
menu too perhaps) and set the file's owner of this draw view nib to an  
instance of NSViewController or a subclass thereof.  All your code to  
control the view is then in the view controller and you have self- 
contained unit.


From here you can instantiate your view controller in your window  
controller and then set the view's position in -awakeFromNib of either  
the view or window controller.  You could also, if you redesign later,  
instantiate your draw view controller during the setup of another view  
controller (or indeed some later time in the application's life) and  
set the draw view as a subview of whatever view this other view  
controller controls!  This way you can set up as complex a controller  
hierarchy as you desire, and changing where the draw view is presented  
in your app boils down to moving the line in which you create your  
draw view controller and moving the view positioning code to somewhere  
else.


This setup is shown in the example code in the second article on  
Cathy's site.  If you have any questions then don't hesitate to ask.   
You can also look at the thread that made us write about all this here


http://www.cocoabuilder.com/archive/message/cocoa/2008/3/19/201743

Hope this helps,

Jon

-- Espresso Served Here -- http://jonathandann.wordpress.com --

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 [EMAIL PROTECTED]

Re: CATextLayer question

2008-06-05 Thread Davide Scheriani

nooo I dont believe it! :)
I come from Flash and Core Animation is like Fuse Framework of Moses.
Is a way to have some sort of "collision" method of one or more layers?



On Jun 5, 2008, at 9:04 , Davide Scheriani wrote:


I was playing with my NSView and CATextLayer.
I placed this code:

-(void)mouseDown:(NSEvent *)theEvent
{
// [...snip...]

[rootLayer addSublayer:textLayer];
}

what ive noticed is when I click,the text appear with a fadein.
Any reason of this behaviour?


Modifying most layer properties as well as adding/removing sublayers  
generates implicit animations. You can temporarily disable  
animations by wrapping the relevant code in a CATransaction:


- (void)mouseDown:(NSEvent *)theEvent
{
[CATransaction begin];
	[CATransaction setValue:(id)kCFBooleanTrue  
forKey:kCATransactionDisableActions];


// [...snip...]
[rootLayer addSublayer:textLayer];

[CATransaction commit];
}

/brian


___

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

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

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

This email sent to [EMAIL PROTECTED]


knowing when WebView is done

2008-06-05 Thread Timothy Ritchey
I am trying to use a WebView to render a page in order to create a  
thumbnail for a CoreData managed entity. I have a custom  
NSManagedObject subclass WebSiteManagedObject with a setUrl: that calls:


NSRect rect = NSMakeRect(0, 0, 900, 1164);
webView = [[WebView alloc] initWithFrame:rect frameName:@"thumbnail"  
groupName:nil];

[webView setFrameLoadDelegate:self];
[webView setMainFrameURL:value];

My WebSiteManagedObject is setup as the delegate, and I track the  
icon, title and frame load messages. I need to know when it is safe to  
cleanup the WebView, but I can't seem to deterministically figure out  
when the WebView is actually done from the delegate calls. I assumed  
that webView:didFinishLoadForFrame: would be the final delegate call,  
which it often is, but periodically, I get webView:didReceiveTitle:  
after the last didFinishLoadForFrame: (in all cases, it seems to be  
related to redirects).


Does anyone know a good way to determine when the WebView is REALLY  
done so I can release it? I've included the delegate implementations  
below. Thanks for any advice. (I realize my approach may be  
fundamentally flawed as well).



- (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title  
forFrame:(WebFrame *)frame

{
if(frame == [sender mainFrame]) {
[self setValue:title forKey:@"title"];
}
}

- (void)webView:(WebView *)sender didReceiveIcon:(NSImage *)image  
forFrame:(WebFrame *)frame

{
if(frame == [sender mainFrame]) {
[self setValue:[image TIFFRepresentation] forKey:@"favicon"];
}
}

- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame  
*)frame

{
if(frame == [sender mainFrame]) {

...

[self setValue:[image TIFFRepresentation] forKey:@"thumbnail"];
[sender autorelease];
}
}


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Getting rid of specific "May not respond" messages

2008-06-05 Thread Nick Zitzmann


On Jun 5, 2008, at 10:38 AM, Dale Jensen wrote:

Though they're added in 10.5, might they still function under the  
last builds of 10.4?  I haven't heard of problems from people using  
that OS.



No, but if you need the functionality under Tiger, you could add  
categories that implement the missing methods where possible.


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 [EMAIL PROTECTED]


IOCreatePlugInInterfaceForService()

2008-06-05 Thread Nathaniel Gottlieb-Graham
(I cross-posted this to the USB list, but I suspect the traffic it'll  
see here is much greater.  Sorry!)


I'm pretty new to USB-related programming, so I'm sure I'm doing  
something dumb here.  I'm trying to write a listener that listens for  
keypresses from a connected USB button board.  The button board is  
totally unsupported, and its functions don't even appear in  
ControllerMate, however, I used a piece of software called Joystick  
and Gamepad Tester to verify that the board is sending signals that  
can be "caught" by applications that know how to look for the raw  
data.  As Joystick and Gamepad Tester doesn't do what I need beyond  
verifying that the board works, and it's closed-source, I'm trying to  
replicate what it does to recognize these signals so that I can write  
a program that allows users to bind the buttons to specific actions.


I've found the device in the IORegistry by matching against its vendor  
and product IDs, but I'm having trouble getting a plugin for it.  My  
kern_return_t is being set to "0xE2C7" when I try to call  
IOCreatePlugInInterfaceForService() on it.  Also, I suspect that my  
approach is wrong, because this seems really hard.  Any ideas?




int foundTheDevice (io_object_t hidDevice)
{
	printf("\nFound the %s - Vendor ID #%X (%d)  Product ID #%X (%d)\n 
\n", DEVICE_NAME, VENDOR_ID, VENDOR_ID, PRODUCT_ID, PRODUCT_ID);


kern_return_t   kr = 0;
IOCFPlugInInterface **plugInInterface = NULL;
IOUSBDeviceInterface245 **dev = NULL;
HRESULT res;
SInt32  score = 0;
UInt16  vendor = 0;
UInt16  product = 0;
UInt16  release = 0;


// get the device interface
printf("kern_return_t is: %d\n", kr);
	kr = IOCreatePlugInInterfaceForService(hidDevice,  
kIOUSBDeviceUserClientTypeID, kIOCFPlugInInterfaceID,  
&plugInInterface, &score);

printf("Trying to create the plugin...\n");
printf("kern_return_t is: %d\n\n", kr);


// we're done with the device object now that we've got the plugin
kr = IOObjectRelease(hidDevice);
if ((kIOReturnSuccess != kr) || !plugInInterface)
{
		// this always gets called, since kern_return_t isn't being  
correctly set

printf("unable to create a plugin (%08x)\n", kr);
exit(1);
}

//... 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 [EMAIL PROTECTED]


Re: C99 [was: RESTful API's - Easy way to interact?]

2008-06-05 Thread Nate Weaver
FWIW, the default C dialect on OS X seems to allow a lot of C99 stuff  
(I assume because it defaults to GNU extensions): variable  
declarations anywhere in a block, "//" comments, and variable-length  
arrays. It doesn't allow declarations in the start of a for loop,  
though.


On Jun 4, 2008, at 8:18 PM, Jens Alfke wrote:



On 4 Jun '08, at 6:06 PM, Randall Meadows wrote:


Two ways:

1) int i;
 for(i=0; i

I'd recommend the latter. C99 is backward compatible has a lot of  
useful additions to C. This topic came up recently on the xcode- 
users list and I posted this plug:



The best features IMHO are:

* Conveniences that C++ has always had:
	* variable declarations don't have to go at the beginning of a  
block (this *really* cleans up code and eliminates a lot of  
opportunities to use uninitialized variables)

* you can declare the loop variable inside a 'for' loop, i.e.
for (int x=0; x<10; x++) { ... }
	* "//" comments; but I think in the real world, all C compilers  
already supported those
* Variable-length local arrays. This is syntactic sugar for alloca,  
and can be used to eliminate some temporary allocations. Just be  
careful not to use this with arbitrarily large arrays, or you can  
overflow the stack.

size_t size = strlen(str)+1;
char buf[size];
memcpy(buf,str,size);

The improvements to struct initializers are great, too.

And if that's not enough for you, you can set the compiler dialect  
to "G99" and get a bunch of cool GCC-only extensions. You can read  
about those in the GCC 4 documentation buried inside the developer  
docs.


—Jens___

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Manipulating images with meta-data

2008-06-05 Thread Ken Ferry
On Wed, Jun 4, 2008 at 4:38 PM, Randall Meadows <[EMAIL PROTECTED]> wrote:
> On a related note, can anyone tell me if creating a CGImageSourceRef from a
> file, changing (only) its properties, and writing it back out--does that
> cause another (lossy) JPEG compression?  As in:
>
> cgImage = CGImageSourceCreateWithURL((CFURLRef)url, NULL);
> imageRef = CGImageSourceCreateImageAtIndex(cgImage, 0, NULL);
> tmpProps = (NSDictionary *)CGImageSourceCopyPropertiesAtIndex(cgImage, 0,
> NULL);
> props = [[tmpProps mutableCopy] autorelease];
> [props setValue:[NSNumber numberWithInt:1] forKey:@"Orientation"];
> fileURL = [NSURL fileURLWithPath:filePath];
> imageDest = CGImageDestinationCreateWithURL((CFURLRef)fileURL, kUTTypeJPEG,
> 1, NULL);
> CGImageDestinationAddImage(imageDest, imageRef, (CFDictionaryRef)props);
> CGImageDestinationFinalize(imageDest);
>

Well, for that case you could have just checked, since you wrote the
code already. :-)

Yes, unfortunately a JPEG is always decoded and recompressed.  Also,
above you probably want to copy over the source level properties, not
just the properties at the contained image level.

-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 [EMAIL PROTECTED]


Re: totally confused by bindings

2008-06-05 Thread Daniel Child
First off, thanks very much for the lengthy response. My initial  
response to your post was rejected for length, so I am trying to  
abbreviate here, pinpointing areas of confusion.


Hmm.  An NSArrayController doesn't manage tables, it manages an  
array (as its name implies).  So, do you have an array somewhere  
with instances of the Word class?  Where is it?  For example, is it  
a property of File's Owner, with a key "words"?

The class structures are:
Word has three ivars {characters, reading, english} (all strings)
WordList has (for now) just one ivar {wordList} (a mutable array)

Word has the appropriate accessors to conform to KVC. That's as far as  
my certainty goes. Here are the main points of confusion.


1. I'm not sure about WordList.  I got an error message about wordList  
not being KVC compliant. So after reading your response and additional  
links on KVC compliance for arrays (one-to-many relations, think it  
was), I suspected I might need to provide WordList with something  
like


- (void)insertObject:(Word *)word inWordListAtIndex:(unsigned  
int)index {

[[self wordList] insertObjectAtIndex: index];
}
- (void)removeObjectFromWordListAtIndex:(unsigned int)index {
[[self wordList] removeObjectAtIndex: index];
}

Unfortunately, that didn't work.

2008-06-05 14:06:20.015 Table Practice[670:10b] An uncaught exception  
was raised
2008-06-05 14:06:20.016 Table Practice[670:10b] [0x13aca0> valueForUndefinedKey:]: this class is not key value coding- 
compliant for the key wordList.
2008-06-05 14:06:20.016 Table Practice[670:10b] *** Terminating app  
due to uncaught exception 'NSUnknownKeyException', reason:  
'[ valueForUndefinedKey:]: this class is not  
key value coding-compliant for the key wordList.'


I recognize here that this error was generated in reference to  
AppController, not WordList, but it seems crazy to me that I would  
have to place KVC-compliant code in a controller. So I think something  
is wrong with the bigger setup. Which brings up issue #2.


2. In my case, File's Owner is simply the proxy for NSApp, and since I  
can't subclass it, it's not the place for me to add wordList, as you  
suggested I might. I think you had a Doc-App structure in mind for  
placing wordList in there, but I haven't really gone into Doc-Apps  
yet. I'm familiar with using FO as a way to connect window controllers  
to the nib. But given that I'm using NSApp as File's Owner, one  
question becomes where or how to tie in my WordList instance and its  
ivar worList.


This is confusing for two reasons:
a) Someone in the series of File'sOwner posts pointed out that much of  
the beginner's code drops a part of the model into the nib, but that  
this is bad coding practice.
b) Some bindings examples use an additional homemade controller and  
some don't. I'm not quite following the reasoning behind this decision.


3. I think one thing is starting to be clear. If you are going to  
truly separate M from V, then you generally make two sets of bindings.


1. Bind some view object to some controller (presumably the  
NSController subclass, though I'm not totally sure).
2. Bind some controller (again, presumably the NSController subclass)  
to some model object.


Maybe this leads to a key concept I'm trying to grapple. When are you  
binding to values, and when to content? You suggested I look at the  
reference for NSArrayController with respect to contentArray. They had  
this to say:


contentArray
an indexed collection that specifies the content of the  
NSArrayController.
The indexed collection is an NSArray instance or subclass, a property  
that is accessible using the key-value-coding indexed accessor  
methods, or is accessible through mutableArrayValueForKey:.


But I'm still a little fuzzy here. In my example, wordList is the  
indexed collection. So I thought that should be it. But you said the  
object class should be Word because wordList is an array of *Word*  
objects. I'm obviously missing this key distinction (between value and  
content), because to me either of the following sentences make sense:


a) I want my array controller to reflect (bind to) the values in the  
table


b) I want my array controller to reflect (bind to) the contents of the  
table


(all with the understanding that "reflecting" is a loose term to mean  
a reciprocal and bidirectional communication so that changes on one  
side are reflected in the other)


Now, as to the question of what to bind to (arrangedObjects,  
arrangedObjects.key, selection.key, etc.), that depends on what  
you're trying to accomplish.  If you want to access all of the  
objects in the array being managed by an array controller, you bind  
to that controller's "arrangedObjects" controller key.


In my case, I think the answer is yes. I want to display everything in  
the wordList => use arrangedObjects (?).


 If you want to access a particular property of the objects in that  
array, you specify a model key path to that p

ANN: F-Script 2.0 alpha

2008-06-05 Thread Philippe Mougin
The new alpha of F-Script 2.0 is out, along with the first binary  
distribution.


F-Script is an open source dynamic language for Cocoa. It includes a  
graphical environment for exploring and experimenting with Cocoa  
objects interactively and can come as a useful addition to the  
existing Xcode toolchain for Cocoa development.


This version brings many major new features, including on-the-fly  
Cocoa class creation, support for Cocoa garbage collection, 64 bit,  
Interface Builder 3 plugin, ability to automate applications using  
Apple's scripting bridge, and more.


You can read about these new features and download F-Script 2.0 alpha  
3 at:


http://pmougin.wordpress.com/2008/06/04/f-script-20-alpha-3/

More information on F-Script at http://www.fscript.org

Cheers,

Philippe Mougin

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: CATextLayer question

2008-06-05 Thread Brian Christensen

On Jun 5, 2008, at 1:44 , Davide Scheriani wrote:


nooo I dont believe it! :)
I come from Flash and Core Animation is like Fuse Framework of Moses.
Is a way to have some sort of "collision" method of one or more  
layers?


I'm not quite sure what you're trying to say or accomplish, but if you  
want to find out when the bounds of two layers intersect you'll need  
to perform that calculation yourself.


/brian



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 [EMAIL PROTECTED]

Re: totally confused by bindings

2008-06-05 Thread Charles Steinman

--- Daniel Child <[EMAIL PROTECTED]> wrote:

> 2008-06-05 14:06:20.015 Table Practice[670:10b] An
> uncaught exception  
> was raised
> 2008-06-05 14:06:20.016 Table Practice[670:10b]
> [ 0x13aca0> valueForUndefinedKey:]: this class is not
> key value coding- 
> compliant for the key wordList.
> 2008-06-05 14:06:20.016 Table Practice[670:10b] ***
> Terminating app  
> due to uncaught exception 'NSUnknownKeyException',
> reason:  
> '[ valueForUndefinedKey:]:
> this class is not  
> key value coding-compliant for the key wordList.'
> 
> I recognize here that this error was generated in
> reference to  
> AppController, not WordList, but it seems crazy to
> me that I would  
> have to place KVC-compliant code in a controller.

Why is that crazy? If you're going to be binding to
something (and it sounds like you're bound to an
AppController instance), it needs to be KVC-compliant
for that property.

Cheers,
Chuck


  
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: totally confused by bindings settings

2008-06-05 Thread Ken Thomases

On Jun 5, 2008, at 10:47 AM, Daniel Child wrote:


First off, thanks very much for the lengthy response.


You're welcome.  Let's see if we can resolve some of the remaining  
confusion.  :)



Hmm.  An NSArrayController doesn't manage tables, it manages an  
array (as its name implies).  So, do you have an array somewhere  
with instances of the Word class?  Where is it?  For example, is  
it a property of File's Owner, with a key "words"?

The class structures are:
Word has three ivars {characters, reading, english} (all strings)
WordList has (for now) just one ivar {wordList} (a mutable array)
In practice, wordList will be an array of Word objects, but it is  
simply declared as NSMutableArray.
This is simply a reduction to basics from part of a larger target  
application where I think bindings will be very useful.


All OK.


Contains how?  What is the interface of this WordList class?   
What properties does it have?
wordList is an array of Word objects but is simply declared as  
NSMutableArray. It could have other classes (and in the real  
application would) but they're not needed for trying to get the  
table to work.


OK.  Just to rephrase this to match the terminology in my question,  
that means that the WordList class has a property named "wordList"  
which is a to-many relationship to instances of the Word class.



That doesn't seem right.  The Class Name should indicate what  
kind of elements are in the array being managed.  That's still  
Word, unless I'm misunderstanding what you're trying to achieve.
OK, thanks for the clarification. But binding to "Word" is not a  
option given in Interface Builder.


At this point, we're not discussing establishing a binding.  We're  
configuring the NSArrayController so that it (and IB) knows what type  
the elements of the array will be.



Similarly, the Content Array binding of the NSArrayController  
should refer to the array of Words maintained by the WordList  
instance (perhaps as a key path from the File's Owner, or  
whatever).  Therefore, it doesn't make sense to have  
".arrangedObjects.wordList" appear in the key path of the table  
column bindings.  The arrangedObjects are already the words in the  
WordList instance.


Let's suppose that File's Owner has a property "wordList" that is  
a to-one relationship to a WordList instance.
I haven't altered File's Owner. It is simply NSApplication. I'm not  
clear how I would even set a property for NSApplication. (If this  
test were more complex and I were using a window controller for the  
owner of a different file, I would totally see how to put in such a  
property.)


You're right when you say (further down) that it's not common to  
subclass NSApplication.  If you did, though, you could tell IB about  
the custom class using the Identity tab of the inspector (Command-6,  
IIRC).  In that case, your subclass could have properties of its own,  
possibly including a WordList.


What about the more common case of not subclassing NSApplication?  In  
that case, your application-wide custom behaviors and data are  
typically put in a custom class and an instance of that class is set  
to be the delegate of NSApp.  The easiest way to set this up is to  
write up the class (the .h and .m files), drag an NSObject instance  
into the nib, and set its class to your custom class.  For purposes  
of this discussion, let's say you name that object "MyAppDelegate".   
Then, Control-drag from File's Owner to MyAppDelegate to connect the  
application's delegate outlet to it.


In this case, you can establish the bindings directly to  
MyAppDelegate.  So, when I said "File's Owner" in my previous email,  
substitute "MyAppDelegate".


You could also establish the bindings through File's  
Owner.delegate..  It amounts to the same thing for  
this nib.  In other nibs, the application delegate won't actually be  
in that same nib, and so the ability to refer to it via a key path  
from either the File's Owner or the Application stand-in will be useful.



Let's also suppose that the WordList class has a property "words"  
which is the to-many relationship to some instances of Word.   
Then, the NSArrayController's Content Array binding should be  
bound to File's Owner with Model Key Path "wordList.words".
But in my case that means connecting to NSApp, and I don't see how  
I would add properties to that. In fact, your suggestion of  
supposing that File's Owner has a property "wordList" confused me  
further and led me to read the entire thread posted recently on  
that topic. I sympathize with the original author's confusion,  
because as one participant pointed out, you don't generally "do"  
much with File's Owner unless you're building a second nib. (I've  
used it as a proxy for window controllers not so long ago, but  
never did much with the FO of the MainMenu.nib.) I see that (like  
someone else in the thread), I have also been mislead by some  
beginner code that instantiates part of the model

Re: Cocoa n00b frustrations

2008-06-05 Thread Georg Tuparev


On Jun 5, 2008, at 3:32 PM, Charles Jenkins wrote:

Hi! Despite the fact that you have heard from me before on this  
list, I am still an newbie trying to struggle through writing my  
first Cocoa app.


I have experienced a couple of frustrations that I would like to  
share to see if anyone knows tools or practices that will help avoid  
them in the future.


NAUGHTY NIBS

I had a Nib file that went bad. Suddenly, my outlets doubled up: IB  
indicated that a class had two outlets named 'textField1' and  
'textField2'.


When it came time to make connections, I had no way to tell the real  
ones from the ghost ones, so I changed the outlets' names in my code  
files and resynchronized. From that point, IB insisted that both the  
old and new connections existed. Worried that this might be the  
source of another problem I was having, I did everything I could  
think of to get rid of the non-existent outlets: I deleted the .h/.m  
and recreated them; I deleted and recreated the NSObject instance in  
IB; I deleted both the .h/.m pair AND the NSObject instance and  
recreated it all using a different class name (MyController instead  
of WindowController); and finally closed down IB and Xcode and  
edited the XIB file with TextWrangler to delete the non-existent  
outlet names.


Nothing worked--the new NSObject instance always magically retained  
the memory of  textField1 and textField2--until I gave up on the Nib  
file by renaming my project directory and creating a new project so  
that I would start with a fresh Nib file. Then I moved my .h/.m  
files over and connected them with no problem to the new Nib.


Is there any kind of Nib repair utility that will clean up a Nib  
file to remove outlets, actions, and classes that do not connect up  
to anything in code? Having such an important file just suddenly "go  
bad" and have to be recreated from scratch is a real bummer.


I never had that problem, but if I recall correctly, someone  
complained about this during the Leopard-preview times. Are you sure  
you have no leftovers from the beta?





DELEGATE DISILLUSIONMENT

You create an object (.h, .m, and object instance in IB) that a  
control (like a table view) will use as a delegate. Using the  
documentation, you cut and paste the delegate's signature to  
eliminate any chance that a typo will prevent it from working. In  
IB, you make sure that the control's 'delegate:' is connected to the  
object.


At runtime, the delegate never gets called.

If checking and rechecking the connection and the method's  
declaration and implementation doesn't help, how do you solve the  
problem?


Objective-C's delegation paradigm is like magic when it works, but  
mysterious and frustrating when there is a problem. Besides a  
malformed method signature and a missing IB connection, what else  
could be wrong?


I use delegation extensively for (oh) 17 years. Never ever had this  
problem. Without looking at your project cannot say what is the cause.  
Do you by any chance override setDelegate: or setting the delegate in  
another setter? Are you sure your object is not nil?


cheers





FINALLY

Anyone know of a Cocoa user group in the Knoxville, Tennessee area?

Thanks!


Georg Tuparev
Tuparev Technologies
Klipper 13
1186 VR Amstelveen
The Netherlands

___

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

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

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

This email sent to [EMAIL PROTECTED]


detect URL change

2008-06-05 Thread Mauricio Camayo
Hi list.

I'm currently making my own parental control plugin, using SIMBL to patch it
to Safari.

I made it trought XCode using a Cocoa Bundle type of project, as exercise,
put a new menu on the menu bar and it worked.

Problem is, don't know how to catch a URL change, so I can determine if it's
a "clean" webpage or not.

Any help?
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Core Data merge and "statement is still active" error?

2008-06-05 Thread Ben Trumbull


On Jun 3, 2008, at 8:15 PM, Michael Link wrote:

Is there a reason you're not using Core Data's - 
mergeChangesFromContextDidSaveNotification: ?


If the object is modified (inserted, update, or deleted), you  
should pass in YES to -refreshObject:mergeChanges:


Actually I am using mergeChangesFromContextDidSaveNotification:, I  
am calling refreshObject:mergeChanges: with NO on the  
NSUpdatedObjectsKey objects just before as this avoids the problem  
of Bug 5937572.


You shouldn't call -refreshObject:mergeChanges:NO on an object with  
changes (passing YES is okay).  The reason for this is if the object  
is deleted or inserted, nuking that state is just plain weird.  The  
graph of objects will not behave they way you would wish.  A nuked  
inserted object is stuck in limbo, and a nuked deleted object can be a  
stale pointer for any of the objects related to it across inverse  
relationships.  Nuking an updated object also has a high probability  
of corrupting the relationship state for other objects with  
relationships to it.


Since the objects on the main thread aren't supposed to have changes,  
skipping the changed ones shouldn't be a burden.


At this point we can now look at ObjectA (which is the same as  
ObjectB except it is owned by the main thread's MOC) which will show  
that it has 10 friends. It should have 20 but the merge has deleted  
the 10 friends that were just inserted on the background thread, but  
just for ObjectA. Looking at those 10 objects that were deleted on  
the main thread you will find that they are still friends with  
ObjectA. This leaves the object graph in an inconsistent state.


The object on the main thread seems to think it has local changes to  
the "friends" relationship and during the merge this is trumping the  
changes you've just made in the other context.  I'm still  
investigating the issue with the new example.


I have an Xcode project that can show both bug 5937572, where the  
object graph is left in an inconsistent state after a merge and bug  
5982319, where the "statement is still active" exception occurs  
during a merge. The project is already attached to bug 5982319  
(Bug-1.zip) and is setup to show the behavior regarding that issue.  
To see the other issue comment out lines 154-189 and uncomment lines  
193-237 in MyDocument.m


Ah.  I see.  The array controller is posting a KVO notification in the  
middle of the fetch operation.  You can work around the problem by  
disabling "Use Lazy Fetching" on the array controller.


- 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 [EMAIL PROTECTED]


Re: NSTextView causes lockups when appending too quickly and/or scrolling

2008-06-05 Thread Steven Moore
Heh, whoops. Maybe I should read the documentation better. The warning  
is already there, I just missed it:


"NSTextStorage also defines a set of methods ... useful for getting  
and setting scriptable properties of NSTextStorage objects... In  
particular, using thecharacters, words or paragraphs methods or their  
corresponding setter methods is an inefficient way to manipulate the  
text storage, since these methods create and return many objects."


-Steven

On Jun 4, 2008, at 4:04 PM, Douglas Davidson wrote:


Anything in NSTextStorageScripting.h (like -paragraphs) is really  
intended for scripting only; stay away from it for other purposes.   
You should file a bug against the documentation to include a warning  
to that effect.  If you want to go through text by paragraphs, you  
should use [[textStorage string] paragraphRangeForRange:] or related  
methods.


Douglas Davidson



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSTextView causes lockups when appending too quickly and/or scrolling

2008-06-05 Thread Douglas Davidson


On Jun 5, 2008, at 2:40 PM, Steven Moore wrote:

Heh, whoops. Maybe I should read the documentation better. The  
warning is already there, I just missed it:


"NSTextStorage also defines a set of methods ... useful for getting  
and setting scriptable properties of NSTextStorage objects... In  
particular, using thecharacters, words or paragraphs methods or  
their corresponding setter methods is an inefficient way to  
manipulate the text storage, since these methods create and return  
many objects."




I think the warning is important enough that it should be noted with  
the documentation for each of the individual methods as well, so I'd  
file a bug about that.  The documentation doesn't really preserve the  
way the headers separate these methods into the  
NSTextStorageScripting.h header file, so something extra is needed.


-Doug

___

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

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

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

This email sent to [EMAIL PROTECTED]


enumeratorAtPath - path string issue???

2008-06-05 Thread Rail Jon Rogut

I'm a newbie to Cocoa, so be gentle...

I'm trying to find all the WAV files in a given folder, so I have a  
function:


- (NSMutableArray *) getFileListArray:(NSString *)searchPath
{   
NSMutableArray * resultArray;

NSString *file;

	NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager]  
enumeratorAtPath:searchPath];


NSLog(@"searchPath = %@", searchPath);

while (file = [dirEnum nextObject])
{
NSLog(@"Found file = %@", file);

if ([[[file pathExtension] lowercaseString] isEqualToString: 
@"wav"])
{
NSLog(@"WAV File = %@", file);

//  Will add to resultArray
}
}

return resultArray;
}

but it doesn't like my searchPath value.. which looks fine to me

(NSLog output): searchPath = /Volumes/JSD 750-1/BFD/Data/AFJ Kit 3/ 
Hihat1/Pedal


If I use the XCode docs example path:

NSString *docsDir = [NSHomeDirectory()  
stringByAppendingPathComponent:  @"Documents"];


(NSLog output): searchPath = /Users/railrogut/Documents

It works fine - so the problem is with my path...???  The actual path  
does exist and has plenty of WAV files in it...


Any ideas of what I'm missing?

Thanks,

Rail
-
Rail Jon Rogut
www.platinumsamples.com
mailto: [EMAIL PROTECTED]

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: detect URL change

2008-06-05 Thread Scott Anguish
I don't think the undocumented internal Safari APIs are appropriate to  
discuss here.



On Jun 5, 2008, at 5:06 PM, Mauricio Camayo wrote:


Hi list.

I'm currently making my own parental control plugin, using SIMBL to  
patch it

to Safari.

I made it trought XCode using a Cocoa Bundle type of project, as  
exercise,

put a new menu on the menu bar and it worked.

Problem is, don't know how to catch a URL change, so I can determine  
if it's

a "clean" webpage or not.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: enumeratorAtPath - path string issue???

2008-06-05 Thread Andy Lee

On Jun 5, 2008, at 5:50 PM, Rail Jon Rogut wrote:

but it doesn't like my searchPath value.. which looks fine to me

(NSLog output): searchPath = /Volumes/JSD 750-1/BFD/Data/AFJ Kit 3/ 
Hihat1/Pedal


What doesn't it like about this?  Is there an error or warning message?

--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 [EMAIL PROTECTED]


Re: knowing when WebView is done

2008-06-05 Thread Mark Bateman

Tim,

I use the webviewdidfinishload method I'm not usre if that is any use  
to you...I'm quite new so I hope I'm not missing something obvious in  
your message.


Mark.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: enumeratorAtPath - path string issue???

2008-06-05 Thread Rail Jon Rogut
Nope - no error or warning.. but here's a picture of the Get Info for  
one of the WAV files in the path...


https://www.platinumsamples.com/images/Path.jpg

and in my code:

- (NSMutableArray *) getFileListArray:(NSString *)searchPath
{   
NSMutableArray * resultArray;

NSString *file;

	NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager]  
enumeratorAtPath:searchPath];


NSLog(@"searchPath = %@", searchPath);

while (file = [dirEnum nextObject])
{
NSLog(@"Found file = %@", file);

if ([[[file pathExtension] lowercaseString] isEqualToString: 
@"wav"])
{
NSLog(@"WAV File = %@", file);

//  Will add to resultArray
}
}

  return resultArray;
}

The while loop is never entered.. so it indicates that  
enumeratorAtPath:searchPath couldn't find the files...  The only  
Console output is from the first NSLog().


Thanks,

Rail
-
Producer/Engineer
www.platinumsamples.com
mailto: [EMAIL PROTECTED]



On Jun 5, 2008, at 3:17 PM, Andy Lee wrote:


On Jun 5, 2008, at 5:50 PM, Rail Jon Rogut wrote:

but it doesn't like my searchPath value.. which looks fine to me

(NSLog output): searchPath = /Volumes/JSD 750-1/BFD/Data/AFJ Kit 3/ 
Hihat1/Pedal


What doesn't it like about this?  Is there an error or warning  
message?


--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 [EMAIL PROTECTED]


NSWindow does not support utility styleMask 0x10 ???

2008-06-05 Thread John Love
This error appears when a window shows in my document-based app via
MyDocument's -windowDidLoadNib method.

 any clues about this mystery ???
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: gcc-4.0 Fail with Realease Configuration

2008-06-05 Thread James Murdza
Hi,

I'm trying to debug a build error in Xcode. My project builds fine when the
"Debug" build configuration is active, but then of course it is not compiled
for other computers. The problem is when I switch the configuration to
"Release," I get: Command /Developer/usr/bin/gcc-4.0 failed with exit code
1. I've attatched my build transcript, if anyone would like to read it.
Could anybody give me any clues as to how I can debug this?

Thanks in advance,
James
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: enumeratorAtPath - path string issue???

2008-06-05 Thread Rail Jon Rogut

dirEnum return NULL when I use the (valid) path

/Volumes/JSD 750-1/BFD/Data/AFJ Kit 3/Hihat1/Pedal

but works fine when I use the path

/Users/railrogut/Documents

Thanks.

Rail
-
Producer/Engineer
www.platinumsamples.com
mailto: [EMAIL PROTECTED]



On Jun 5, 2008, at 3:17 PM, Andy Lee wrote:


On Jun 5, 2008, at 5:50 PM, Rail Jon Rogut wrote:

but it doesn't like my searchPath value.. which looks fine to me

(NSLog output): searchPath = /Volumes/JSD 750-1/BFD/Data/AFJ Kit 3/ 
Hihat1/Pedal


What doesn't it like about this?  Is there an error or warning  
message?


--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/rail%40platinumsamples.com

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSWindow does not support utility styleMask 0x10 ???

2008-06-05 Thread Keary Suska
6/5/08 4:33 PM, also sprach [EMAIL PROTECTED]:

> This error appears when a window shows in my document-based app via
> MyDocument's -windowDidLoadNib method.
> 
>  any clues about this mystery ???

Here's a clue:
http://lists.apple.com/archives/Cocoa-dev/2007/Nov/msg02233.html

Per the posting guidelines sent recently, it is wise to search the archives
before posting a question.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: enumeratorAtPath - path string issue???

2008-06-05 Thread Stephen J. Butler
On Thu, Jun 5, 2008 at 6:14 PM, Rail Jon Rogut <[EMAIL PROTECTED]> wrote:
> Okay.. it has something to do with the NSString in the function call...
>
> By creating a new NSString (szTest) with the same path it works okay.

Are you sure there aren't extra spaces that worked their way in
somehow? With strange problems like this, I always like to use
deliminaters on my logging output. For example,

NSLog(@"searchPath = |%@|", searchPath);

Or even check that the length of the path string is what you expect.
Perhaps non-printable characters are working their way in.

NSLog(@"searchPath(%d) = |%@|", [searchPath length], searchPath);
___

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

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

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

This email sent to [EMAIL PROTECTED]


Converting a CFImageRef to a NSImage

2008-06-05 Thread Felipe Monteiro de Carvalho
Hello,

I am trying to build a statusitem component for a Carbon based
library. Of course I can only use Cocoa for that, so I need to convert
my CFImageRef to a NSImage. Searching in the internet I found code to
do that.

I found the following code in the internet:

  NSImage* image = [[NSImage alloc] initWithSize:rect.size];
   [image lockFocus];
   CGContextDrawImage([[NSGraphicsContext currentContext]
 graphicsPort], *(CGRect*)&rect, imageRef);
   [image unlockFocus];

And I converted and adapted it to Pascal in my full code bellow, but I
keep getting an error saying that the context is invalid. Does anyone
know why? Here is the debug output:

[DBGTGT] :>[TCarbonWSCustomTrayIcon.Show]
Jun  5 20:17:03 computador-de-felipe-monteiro-de-carvalho
/Users/felipe/Programas/lazarus/examples/trayicon/Wndtray.app/Contents/MacOS/Wndtray:
CGContextDrawImage: invalid context
[DBGTGT] :<[TCarbonWSCustomTrayIcon.Show] Handle: 01862980
ACGRect.size.width:  2.2E+01 ACGRect.size.height:
2.2E+01 ACGRect.origin.x:  0.0E+00 ACGRect.origin.y:
0.0E+00 TCarbonBitmap(ATrayIcon.Icon.Handle).CGImage 01B0BEC0

And my code:

class function TCarbonWSCustomTrayIcon.Show(const ATrayIcon:
TCustomTrayIcon): Boolean;
var
  APrivateTrayIcon: TPrivateCocoaCarbonTrayIcon;
  ASize: NSSize;
  ACGRect: CGRect;
  AcurrentContext: NSGraphicsContext;
begin
  {$ifdef VerboseCarbonTrayIcon}
WriteLn(':>[TCarbonWSCustomTrayIcon.Show]');
  {$endif VerboseCarbonTrayIcon}

  Result := False;

  { Creates the handle }

  APrivateTrayIcon := TPrivateCocoaCarbonTrayIcon.Create;

  APrivateTrayIcon.bar := NSStatusBar.systemStatusBar();

  ATrayIcon.Handle := PtrInt(APrivateTrayIcon);

  { Convert our CFImageRef to a NSImage }

  ASize.width := TCarbonBitmap(ATrayIcon.Icon.Handle).Width;
  ASize.height := TCarbonBitmap(ATrayIcon.Icon.Handle).Height;
  ACGRect.size.width := ASize.width;
  ACGRect.size.height := ASize.height;
  ACGRect.origin.x := 0;
  ACGRect.origin.y := 0;

  APrivateTrayIcon.image := NSImage.initWithSize(ASize);
  APrivateTrayIcon.image.lockFocus;
  AcurrentContext := NSGraphicsContext.currentContext();
  CGContextDrawImage(AcurrentContext.graphicsPort, ACGRect,
TCarbonBitmap(ATrayIcon.Icon.Handle).CGImage);
  APrivateTrayIcon.image.unlockFocus;

  { Shows the icon }

  if APrivateTrayIcon.item <> nil then Exit(True);

  APrivateTrayIcon.item :=
APrivateTrayIcon.bar.statusItemWithLength(NSSquareStatusItemLength);
  APrivateTrayIcon.item.retain();
  APrivateTrayIcon.item.setImage(APrivateTrayIcon.image);

  Result := True;

  {$ifdef VerboseCarbonTrayIcon}
WriteLn(':<[TCarbonWSCustomTrayIcon.Show]',
 ' Handle: ', IntToHex(ATrayIcon.Handle, 8),
 ' ACGRect.size.width: ', ACGRect.size.width,
 ' ACGRect.size.height: ', ACGRect.size.height,
 ' ACGRect.origin.x: ', ACGRect.origin.x,
 ' ACGRect.origin.y: ', ACGRect.origin.y,
 ' TCarbonBitmap(ATrayIcon.Icon.Handle).CGImage ',
IntToHex(Int64(TCarbonBitmap(ATrayIcon.Icon.Handle).CGImage), 8)
 );
  {$endif VerboseCarbonTrayIcon}
end;

thanks,
-- 
Felipe Monteiro de Carvalho
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Converting a CFImageRef to a NSImage

2008-06-05 Thread Felipe Monteiro de Carvalho
Oh ... I added some more debug information and got some more info:

[DBGTGT] :<[TCarbonWSCustomTrayIcon.Show] Handle: 01862980
ACGRect.size.width:  2.2E+01 ACGRect.size.height:
2.2E+01 ACGRect.origin.x:  0.0E+00 ACGRect.origin.y:
0.0E+00 AcurrentContext 018629E0 AcurrentContext.graphicsPort
 TCarbonBitmap(ATrayIcon.Icon.Handle).CGImage 01B0BEC0

Which means that AcurrentContext.graphicsPort is zero =/

So, what do I have to do to get a CGContextRef?

thanks,
-- 
Felipe Monteiro de Carvalho
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Core Data merge and "statement is still active" error?

2008-06-05 Thread Michael Link


On Jun 5, 2008, at 4:37 PM, Ben Trumbull wrote:



On Jun 3, 2008, at 8:15 PM, Michael Link wrote:

Is there a reason you're not using Core Data's - 
mergeChangesFromContextDidSaveNotification: ?


If the object is modified (inserted, update, or deleted), you  
should pass in YES to -refreshObject:mergeChanges:


Actually I am using mergeChangesFromContextDidSaveNotification:, I  
am calling refreshObject:mergeChanges: with NO on the  
NSUpdatedObjectsKey objects just before as this avoids the problem  
of Bug 5937572.


You shouldn't call -refreshObject:mergeChanges:NO on an object with  
changes (passing YES is okay).  The reason for this is if the object  
is deleted or inserted, nuking that state is just plain weird.  The  
graph of objects will not behave they way you would wish.  A nuked  
inserted object is stuck in limbo, and a nuked deleted object can be  
a stale pointer for any of the objects related to it across inverse  
relationships.  Nuking an updated object also has a high probability  
of corrupting the relationship state for other objects with  
relationships to it.


Since the objects on the main thread aren't supposed to have  
changes, skipping the changed ones shouldn't be a burden.


I should skip using -refreshObject:mergeChanges:NO on any object that  
is in NSUpdatedObjectsKey? Even though they don't have changes on the  
main thread? I suppose that makes sense, the original reason for doing  
this was to find a work-around for bug-5937572, which seems to work in  
experimentation (although now without lazy controllers). I'm probably  
just coding myself in a corner I don't want to be in anyways by doing  
this. Ideally I would like to simply use  
mergeChangesFromContextDidSaveNotification: although the merge seems  
to produce the previously mentioned inconsistencies. I even tried  
using -refreshObject:mergeChanges:YES, objectWithID:, and  
deleteObject: to emulate what  
mergeChangesFromContextDidSaveNotification: probably does on the  
userInfo of the notification, but it produced the exact same results  
to no surprise.





At this point we can now look at ObjectA (which is the same as  
ObjectB except it is owned by the main thread's MOC) which will  
show that it has 10 friends. It should have 20 but the merge has  
deleted the 10 friends that were just inserted on the background  
thread, but just for ObjectA. Looking at those 10 objects that were  
deleted on the main thread you will find that they are still  
friends with ObjectA. This leaves the object graph in an  
inconsistent state.


The object on the main thread seems to think it has local changes to  
the "friends" relationship and during the merge this is trumping the  
changes you've just made in the other context.  I'm still  
investigating the issue with the new example.


That makes sense. Although I wasn't able to see any changes with the  
public methods available to NSManagedObject, I'll assume that's  
happening somewhere private.


I attached the Bug-2 project to bug-5989987 in Bug Reporter which may  
help in the investigation. Also here: http://www.dazys.com/Bug-2.zip


--
Michael


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: PMSessionEndDocumentNoDialog error code -43

2008-06-05 Thread Torsten Curdt

Bugger! Now also has been reported on the official release 10.5.3 (9D34)

05/06/08 15:43:01 TextEdit[15516] Printing failed because  
PMSessionEndDocumentNoDialog() returned -43.


This happens when using a Cocoa Document based application as receiver  
for the PDF services (from the print menu)


Could it be related to how I receive the data currently?

- (NSData *)dataRepresentationOfType:(NSString *)aType
{
return nil; // <--- return nil or the data?
}

- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString  
*)aType

{
NSLog(@"Received PDF (%d bytes).", [data length]);

pdf = [data copyWithZone:[self zone]];

return YES;
}

Wondering if this should be changed to

- (NSData *)dataOfType:(NSString *)typeName error:(NSError  
**)outError

{
return pdf; // <--- return this or nil?
}

- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName  
error:(NSError **)outError

{
NSLog(@"Received PDF (%d bytes).", [data length]);

pdf = [data copyWithZone:[self zone]];

}

Comments?

cheers
--
Torsten


On May 22, 2008, at 23:26, Torsten Curdt wrote:

Thanks! ...not that I understand why this happens on the new seed -  
but thanks for the pointer! Really helpful!


cheers
--
Torsten

On May 22, 2008, at 17:24, Jens Alfke wrote:



On 22 May '08, at 7:15 AM, Torsten Curdt wrote:


Anyone an idea what error code -43 could be?


fnfErr (file not found). I still know that one by heart :)

Look in , the central listing of Carbon error codes.  
In general, any time you get an error from any API that's a  
negative number (down to -5 or so), it's probably in there.


—Jens




___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Converting a CFImageRef to a NSImage

2008-06-05 Thread Nick Zitzmann


On Jun 5, 2008, at 5:35 PM, Felipe Monteiro de Carvalho wrote:


And I converted and adapted it to Pascal in my full code bellow, but I
keep getting an error saying that the context is invalid. Does anyone
know why?



No, but I think you're making this too difficult. Assuming you mean  
"CGImageRef" (I don't know what a CFImageRef is), then just use - 
[NSBitmapImageRep initWithCGImage:] and then add the resulting image  
rep to an NSImage instance.


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 [EMAIL PROTECTED]


Re: Converting a CFImageRef to a NSImage

2008-06-05 Thread Felipe Monteiro de Carvalho
On Thu, Jun 5, 2008 at 9:06 PM, Nick Zitzmann <[EMAIL PROTECTED]> wrote:
> No, but I think you're making this too difficult. Assuming you mean
> "CGImageRef"

indeed

> then just use -[NSBitmapImageRep initWithCGImage:] and then add the resulting 
> image rep to
> an NSImage instance.

I would love to, but this method was added in 10.5

I am using 10.4

thanks,
-- 
Felipe Monteiro de Carvalho
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Converting a CFImageRef to a NSImage

2008-06-05 Thread Nick Zitzmann


On Jun 5, 2008, at 6:12 PM, Felipe Monteiro de Carvalho wrote:


I would love to, but this method was added in 10.5

I am using 10.4



You can still do this in 10.4, just not with NSBitmapImageRep. Create  
an NSImage, call -lockFocus on it to create a CGContextRef, call  
[[NSGraphicsContext currentContext] graphicsPort] to get the context  
_after_ locking focus, draw the image, then call -unlockFocus. That  
ought to work.


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 [EMAIL PROTECTED]


Re: Converting a CFImageRef to a NSImage

2008-06-05 Thread Randall Meadows

On Jun 5, 2008, at 6:15 PM, Nick Zitzmann wrote:


On Jun 5, 2008, at 6:12 PM, Felipe Monteiro de Carvalho wrote:


I would love to, but this method was added in 10.5

I am using 10.4


You can still do this in 10.4, just not with NSBitmapImageRep.  
Create an NSImage, call -lockFocus on it to create a CGContextRef,  
call [[NSGraphicsContext currentContext] graphicsPort] to get the  
context _after_ locking focus, draw the image, then call - 
unlockFocus. That ought to work.


Here's the method I wrote to do just that:

NSImage *CGImageRefToNSImage (CGImageRef cgImage)
{
   NSRect   imageRect = NSMakeRect(0.0, 0.0, 0.0, 0.0);
   CGContextRef imageContext = nil;
   NSImage  *newImage = nil;

   // Get the image dimensions
   imageRect.size = NSMakeSize(CGImageGetWidth(cgImage),  
CGImageGetHeight(cgImage));


   // Create a new image to receive the Quartz image data
   newImage = [[NSImage alloc] initWithSize:imageRect.size];
   [newImage setCacheMode:NSImageCacheNever];
   [newImage lockFocus];

   // Get the Quartz context and draw
   imageContext = (CGContextRef)[[NSGraphicsContext currentContext]  
graphicsPort];

   CGContextDrawImage(imageContext, *(CGRect *)&imageRect, cgImage);
   [newImage unlockFocus];

   return([newImage autorelease]);
}
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: gcc-4.0 Fail with Realease Configuration

2008-06-05 Thread Kyle Sluder
On Thu, Jun 5, 2008 at 6:38 PM, James Murdza <[EMAIL PROTECTED]> wrote:
> I've attatched my build transcript, if anyone would like to read it.

It doesn't come through the list.  Post it somewhere instead.  The
pastebin at paste.lisp.org is the one used on the #coocadev IRC
channel.

--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 [EMAIL PROTECTED]


Re: Converting a CFImageRef to a NSImage

2008-06-05 Thread Felipe Monteiro de Carvalho
On Thu, Jun 5, 2008 at 9:15 PM, Nick Zitzmann <[EMAIL PROTECTED]> wrote:
> You can still do this in 10.4, just not with NSBitmapImageRep. Create an
> NSImage, call -lockFocus on it to create a CGContextRef, call
> [[NSGraphicsContext currentContext] graphicsPort] to get the context _after_
> locking focus, draw the image, then call -unlockFocus. That ought to work.

That's exactly what I am trying to do, but [NSGraphicsContext
currentContext] returns zero.

-- 
Felipe Monteiro de Carvalho
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: DirWatch

2008-06-05 Thread Uli Kusterer

Am 23.05.2008 um 04:08 schrieb Jens Alfke:

On 22 May '08, at 4:33 PM, Jerry Krinock wrote:
Don't do that.  The solution for this problem has been built into  
the system since Mac OS 10.2 or .3, as noted by Robert:



UKQueue by Uli



We're going in circles now. Lorenzo already said in his first post  
that he's using FNSubscribe, which is the same thing UKQueue uses.



 No, UKKQueue uses kqueue. Though there is an FNNotify-based file  
watcher thrown in there as an extra.


 Oh, and kqueue was introduced with 10.3, as far as I remember. Or  
was that when Finder started using it?


Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de





___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: knowing when WebView is done

2008-06-05 Thread Rush Manbert


On Jun 5, 2008, at 3:23 PM, Mark Bateman wrote:


Tim,

I use the webviewdidfinishload method I'm not usre if that is any  
use to you...I'm quite new so I hope I'm not missing something  
obvious in your message.




See this thread:

http://lists.apple.com/archives/webkitsdk-dev/2005/Dec/msg00047.html

-Rush

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: detect URL change

2008-06-05 Thread Adam Leonard


On Jun 5, 2008, at 3:10 PM, Scott Anguish wrote:

I don't think the undocumented internal Safari APIs are appropriate  
to discuss here.




I agree, but for this specific question you can avoid relying on  
internal Safari APIs.


I think you can pretty safely assume that Safari will always use  
WebKit with a WebView in the foreseeable future.
So, look at the docs for all the notifications WebKit posts. I imagine  
either WebViewProgressStartedNotification or  
WebViewProgressFinishedNotification will give you the information you  
need. Register for them as you would any normal notification, and you  
can even use -[NSNotification object] to interact with the WebView  
that posted it.



Remember that to fully implement a parental control plugin, you will  
probably need to rely on the undocumented implementation details of  
Safari, which is risky, bad, probably off topic here, etc.



Adam Leonard


On Jun 5, 2008, at 5:06 PM, Mauricio Camayo wrote:


Hi list.

I'm currently making my own parental control plugin, using SIMBL to  
patch it

to Safari.

I made it trought XCode using a Cocoa Bundle type of project, as  
exercise,

put a new menu on the menu bar and it worked.

Problem is, don't know how to catch a URL change, so I can  
determine if it's

a "clean" webpage or not.


___

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

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

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

This email sent to [EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Converting a CFImageRef to a NSImage

2008-06-05 Thread Felipe Monteiro de Carvalho
Umm ... I am getting closer to the problem. It seams to be something
in the Pascal - Cocoa bindings. Here is the constructor for
[NSGraphicsContext currentContext]

constructor NSGraphicsContext.currentContext;
type
  TmsgSendWrapper = function (param1: objc.id; param2: SEL): objc.id; cdecl;
var
  vmethod: TmsgSendWrapper;
begin
  ClassID := getClass();
  vmethod := TmsgSendWrapper(@objc_msgSend);
  Handle := vmethod(ClassID,
sel_registerName(PChar(StrNSGraphicsContext_currentContext)));
end;

It returns zero in the Handle because the ClassID is zero:

class function NSGraphicsContext.getClass: objc.id;
begin
  Result := objc_getClass(StrNSGraphicsContext_NSGraphicsContext);
end;

The constant is declared as:

  StrNSGraphicsContext_NSGraphicsContext = 'NSGraphicsContext';

It's a mistery to me why NSGraphicsContext.getClass returns zero ...
It works with basically the same code in all other classes covered by
the bindings.

thanks,
-- 
Felipe Monteiro de Carvalho
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: gcc-4.0 Fail with Realease Configuration

2008-06-05 Thread James Murdza
Oh. Whoops, I should have realized that. Here it is:
http://tinyurl.com/6xdbw6. I honestly don't know what part of it I should be
reading because I've never had this kind of problem before, but I hope that
someone more experienced might.

On Thu, Jun 5, 2008 at 8:20 PM, Kyle Sluder
<[EMAIL PROTECTED]<[EMAIL PROTECTED]>>
wrote:

> On Thu, Jun 5, 2008 at 6:38 PM, James Murdza <[EMAIL PROTECTED]>
> wrote:
> > I've attatched my build transcript, if anyone would like to read it.
>
> It doesn't come through the list.  Post it somewhere instead.  The
> pastebin at paste.lisp.org is the one used on the #coocadev IRC
> channel.
>
> --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 [EMAIL PROTECTED]


Re: Bindings Cocoa and new Thread (Spinning Beach Ball an new Thread)

2008-06-05 Thread Alexander Hartner
Thanks to all those who responded. I managed to implement what you  
suggested. Previously I did had some issues, but managed to resolve  
them. One mistake I made before was doing the main work in the main  
thread via performSelectorOnMainThread. I now separated the UI updated  
and the long task into different methods.


Thanks again
Alex


On 5 Jun 2008, at 00:10, Alexander Hartner wrote:

I have an application which refreshes a NSTable with data from a  
network server. The refresh can take several seconds, and might even  
fail when the server is not accessible. During the refresh process I  
would like to display a sheet with a spinning progress indicator.


Everything worked sort of OK until I added some threading. The  
reason I wanted to add a new thread was to free up the main thread  
to prevent the spinning beach ball from appearing. The beach ball  
appeared every-time when then process took a little bit longer then  
it should.


On my main form I have a button which is link to the refresh action:

- (IBAction) refresh:(id)sender
{
	[NSThread detachNewThreadSelector:@selector(processRefreshGroup:)  
toTarget:self withObject:sender];

//[self processRefreshGroup:sender];
}

- (void) processRefreshGroup:(id)sender
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSApplication * application = [NSApplication sharedApplication];
	[application beginSheet:reloadGroupsPanel modalForWindow: 
[application keyWindow] modalDelegate:nil didEndSelector:nil  
contextInfo:nil];		

[application endSheet:reloadGroupsPanel];   
@try
{   
[reloadGroupsProgressIndicator startAnimation:sender];
[groups removeAllObjects];

//This method can take a long time to complete
[self doExpensiveWorkHere];

[reloadGroupsProgressIndicator stopAnimation:self];
[application stopModal];
[reloadGroupsPanel close];  
}
@catch (NSException * exception)
{
[reloadGroupsProgressIndicator stopAnimation:self];
[application stopModal];
[reloadGroupsPanel close];  

[errorMessageField setString:[exception reason]];
NSApplication * application = [NSApplication sharedApplication];
		[application beginSheet:errorPanel modalForWindow:[application  
keyWindow] modalDelegate:nil didEndSelector:nil  
contextInfo:nil];			

[application endSheet:errorPanel];  
}
//Reload data on NSTable
[groupSelectionTable reloadData];
[pool release];
}

I have a couple of questions:

1.) I gathered i have to create a new NSAutoReleasePool in my  
"threaded" method. Is this correct ?


2.) During execution of this I am updating the UI components from a  
thread which is not the main thread. This produces several error  
messages. How can I updated UI components. I tried using  
performSelectorOnMainThread, but this didn't work either. Not sure  
if this is the right approach.


3.) Is there an alternative way to achieve this without the beach  
ball appearing. I understand what caused it was the fact that I  
never exited the action method, at least not quickly. I would prefer  
an approach which did not require a new thread to be created.


Thanks for you help
Alex






___

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

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

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

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Converting a CFImageRef to a NSImage

2008-06-05 Thread Felipe Monteiro de Carvalho
Oh  I had forgotten to link to the Cocoa framework =P It was only
linked to Carbon...

thanks,
-- 
Felipe Monteiro de Carvalho
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Converting a CFImageRef to a NSImage

2008-06-05 Thread Felipe Monteiro de Carvalho
Ok, things improved a little bit. Now the classes are created
correctly, but it crashes when I call lockFocus =/ Any ideas?

Here is the error message and backtrace:

2008-06-05 21:53:31.854 Wndtray[5100] *** Uncaught exception:
 Error (1002) creating CGSWindow

Program received signal SIGTRAP, Trace/breakpoint trap.
0x9282a45f in _NSRaiseError ()
(gdb) bt
#0  0x9282a45f in _NSRaiseError ()
#1  0x92851247 in +[NSException raise:format:] ()
#2  0x932d82ce in _NXCreateWindow ()
#3  0x932d80ba in CreateWindowNamed ()
#4  0x932d7d0f in NewCacheWindowInfo ()
#5  0x932d7867 in _NXAllocateImageCache ()
#6  0x932d6faa in -[NSCachedImageRep
_initWithSize:depth:separate:alpha:allowDeep:] ()
#7  0x932d6e46 in -[NSCachedImageRep initWithSize:depth:separate:alpha:] ()
#8  0x932d6d45 in -[NSImage lockFocus] ()
#9  0x001b4c88 in NSIMAGE__LOCKFOCUS (this=0x186a9c0) at NSImage.inc:618
#10 0x001935c4 in TCARBONWSCUSTOMTRAYICON__SHOW (ATRAYICON=0x1860380,
pvmt=0x18a0930) at carbontrayicon.inc:69
#11 0x00109230 in TCUSTOMTRAYICON__SHOW (this=0x1860380) at
customtrayicon.inc:112
#12 0x0010925c in TCUSTOMTRAYICON__SETVISIBLE (VALUE=true,
this=0x1860380) at customtrayicon.inc:123
#13 0x00028c11 in TFRMTRAYTEST__BTNSHOWCLICK (SENDER=0x1811a20,
this=0x18115c0) at frmtest.pas:90
#14 0x000eab56 in TCONTROL__CLICK (this=0x1811a20) at control.inc:2094
#15 0x000fd5af in TBUTTONCONTROL__CLICK (this=0x1811a20) at buttoncontrol.inc:57
#16 0x000fdc95 in TCUSTOMBUTTON__CLICK (this=0x1811a20) at buttons.inc:185
#17 0x000fe131 in TBUTTON__CLICK (this=0x1811a20) at buttons.inc:326
#18 0x000fde4a in TCUSTOMBUTTON__WMDEFAULTCLICKED (MESSAGE={MSG =
66567, WPARAM = 0, LPARAM = 0, RESULT = 0, WPARAMLO = 0, WPARAMHI = 0,
LPARAMLO = 0, LPARAMHI = 0, RESULTLO = 0, RESULTHI = 0},
this=0x1811a20) at buttons.inc:240
#19 0xda99 in SYSTEM_TOBJECT_$__DISPATCH$formal ()
#20 0x000e104f in TWINCONTROL__WNDPROC (MESSAGE={MSG = 66567, WPARAM =
0, LPARAM = 0, RESULT = 0, WPARAMLO = 0, WPARAMHI = 0, LPARAMLO = 0,
LPARAMHI = 0, RESULTLO = 0, RESULTHI = 0}, this=0x1811a20) at
wincontrol.inc:4715
#21 0x00180f25 in DELIVERMESSAGE (TARGET=0x1811a20, AMESSAGE=void) at
lclmessageglue.pas:103
#22 0x00180fec in SENDSIMPLEMESSAGE (TARGET=0x1811a20, MSG=66567) at
lclmessageglue.pas:129
#23 0x001815c6 in LCLSENDCLICKEDMSG (TARGET=0x1811a20) at lclmessageglue.pas:525
#24 0x001a1678 in TCARBONCUSTOMBUTTON__HIT (ACONTROLPART=10,
this=0x186a7a0) at carbonbuttons.pp:326
#25 0x00196d18 in CARBONCONTROL_HIT (ANEXTHANDLER=0xbfffe2c0,
AEVENT=0x1b3ca60, AWIDGET=0x186a7a0) at carbonprivatecontrol.inc:46
#26 0x92dee4d7 in DispatchEventToHandlers ()
#27 0x92dedb7c in SendEventToEventTargetInternal ()
#28 0x92df4f7c in SendEventToEventTarget ()
#29 0x92ea86a5 in SendControlHit ()
#30 0x92ea8596 in HIView::NotifyControlHit ()
#31 0x92eb1e38 in HIView::ClickInternal ()
#32 0x92e8d025 in HIView::ClickSelf ()
#33 0x92e12612 in HIView::EventHandler ()
#34 0x92dee4d7 in DispatchEventToHandlers ()
#35 0x92dedb7c in SendEventToEventTargetInternal ()
#36 0x92df4f7c in SendEventToEventTarget ()
#37 0x92e8cd4f in HIView::Click ()
#38 0x92e8cb8b in HandleClickAsHIView ()
#39 0x92e8c531 in HandleWindowClick ()
#40 0x92e8bffe in HandleMouseEvent ()
#41 0x92e34468 in StandardWindowEventHandler ()
#42 0x92dee4d7 in DispatchEventToHandlers ()
#43 0x92dedb7c in SendEventToEventTargetInternal ()
#44 0x92df4f7c in SendEventToEventTarget ()
#45 0x92df540f in ToolboxEventDispatcherHandler ()
#46 0x92dee88e in DispatchEventToHandlers ()
#47 0x92dedb7c in SendEventToEventTargetInternal ()
#48 0x92df4f7c in SendEventToEventTarget ()
#49 0x00172e53 in TCARBONWIDGETSET__APPPROCESSMESSAGES
(this=0x1898140) at carbonobject.inc:492
#50 0x00024f79 in TAPPLICATION__HANDLEMESSAGE (this=0x18b0020) at
application.inc:975
#51 0x000252e1 in TAPPLICATION__RUNLOOP (this=0x18b0020) at application.inc:1086
#52 0x001722aa in EVENTLOOPEVENTHANDLER (INHANDLERCALLREF=0xb550,
INEVENT=0x1b0dce0, INUSERDATA=0x0) at carbonobject.inc:128
#53 0x92dee4d7 in DispatchEventToHandlers ()
#54 0x92dedb7c in SendEventToEventTargetInternal ()
#55 0x92deda41 in SendEventToEventTargetWithOptions ()
#56 0x92df50e3 in ToolboxEventDispatcherHandler ()
#57 0x92dee88e in DispatchEventToHandlers ()
#58 0x92dedb7c in SendEventToEventTargetInternal ()
#59 0x92df4f7c in SendEventToEventTarget ()
#60 0x92e38eb3 in ToolboxEventDispatcher ()
#61 0x92e378cb in RunApplicationEventLoop ()
#62 0x00172c92 in TCARBONWIDGETSET__APPRUN (ALOOP=0x252a0
, this=0x1898140) at carbonobject.inc:435
#63 0x0002529a in TAPPLICATION__RUN (this=0x18b0020) at application.inc:1073
#64 0x251c in PASCALMAIN () at wndtray.dpr:39
#65 0x00018810 in SYSTEM_FPC_SYSTEMMAIN$LONGINT$PPCHAR$PPCHAR ()
#66 0x24c2 in _start ()
#67 0x23e9 in start ()

-- 
Felipe Monteiro de Carvalho
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at coc

Re: Converting a CFImageRef to a NSImage

2008-06-05 Thread Nick Zitzmann


On Jun 5, 2008, at 6:54 PM, Felipe Monteiro de Carvalho wrote:


Ok, things improved a little bit. Now the classes are created
correctly, but it crashes when I call lockFocus =/ Any ideas?

Here is the error message and backtrace:

2008-06-05 21:53:31.854 Wndtray[5100] *** Uncaught exception:
 Error (1002) creating CGSWindow



Are you sure the app is connected to the window server? Did you  
remember to call NSApplicationLoad() before locking focus?


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 [EMAIL PROTECTED]


Re: Converting a CFImageRef to a NSImage

2008-06-05 Thread Felipe Monteiro de Carvalho
On Thu, Jun 5, 2008 at 9:59 PM, Nick Zitzmann <[EMAIL PROTECTED]> wrote:
> Are you sure the app is connected to the window server? Did you remember to
> call NSApplicationLoad() before locking focus?

Thank you very much =) Now it works =P

-- 
Felipe Monteiro de Carvalho
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Drawing over a QTCaptureView

2008-06-05 Thread Gordon Apple
After receiving this, I tried something similar for clipping.  After I
cut in the filter, it worked for a few seconds, then slowed to crawl, then
crashed.  The images from the internal iSight are large.  My theory is that
all those NSImages (and associated caches) simply overwhelmed the garbage
collector and eventually crashed it.  There's got to be a better way.

I thought about Keeping one NSImage, erasing it, and redrawing it each
time, but the filter delegate gets used by more than one QTCaptureView.

 Ideally, the clipping should be done in the GPU and set up only once.


> Gordon:
> 
> I think view:willDisplayImage: is the way to do it, although it is a
> bit kludgey in my opinion since you have to convert to something
> drawable and then back.  Attached is the code I worked up.  It should
> work on 10.4 and 10.5.  All it does is draw a centered rounded square
> over the QTCaptureView's preview image.
> 
> - (CIImage *)view:(QTCaptureView *)view willDisplayImage:(CIImage *)
> image {
> NSImage *capturedImage = [[NSImage alloc] init];
> [capturedImage addRepresentation:[NSCIImageRep
> imageRepWithCIImage:image]];
> 
> [capturedImage lockFocus];
> 
> NSSize imageSize = [capturedImage size];
> NSRect overlayRect = NSZeroRect;
> overlayRect.size = imageSize;
> overlayRect.size.width = NSHeight(overlayRect);
> 
> overlayRect.origin.x = (imageSize.width - NSWidth(overlayRect))/2;
> 
> overlayRect = NSInsetRect(overlayRect, 6, 6);
> 
> CGFloat oldLineWidth = [NSBezierPath defaultLineWidth];
> [NSBezierPath setDefaultLineWidth:4];
> [[[NSColor grayColor] colorWithAlphaComponent:.75] set];
> 
> [NSBezierPath strokeRoundRectInRect:overlayRect radius:10];
> [NSBezierPath setDefaultLineWidth:oldLineWidth];
> 
> [capturedImage unlockFocus];
> 
> // create CIImage from data
> CIImage * ciImage = [[CIImage alloc] initWithData:[capturedImage
> TIFFRepresentation]];
> 
> [capturedImage release];
> 
> return [ciImage autorelease];
> }
> 
> Hope this helps,
> 
> ->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 [EMAIL PROTECTED]


Re: knowing when WebView is done

2008-06-05 Thread Timothy Ritchey
My quick search of the docs only found that delegate method in the  
UIWebKit iPhone docs, not in the regular WebKit.


Cheers,
Tim R.

On Jun 5, 2008, at 6:23 PM, Mark Bateman wrote:


Tim,

I use the webviewdidfinishload method I'm not usre if that is any  
use to you...I'm quite new so I hope I'm not missing something  
obvious in your message.


Mark.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Converting a MenuRef to a NSMenu

2008-06-05 Thread Felipe Monteiro de Carvalho
Hello,

I need to convert a MenuRef to a NSMenu, how can this be done? I am
searching and I found some material about the other way around, but
nothing in this direction.

I am implementing the status item part of a carbon library, so I get
the menu already ready in MenuRefs and I need to recursively convert
the menu and all it's items into a NSMenu to insert into a
NSStatusItem.

thanks,
-- 
Felipe Monteiro de Carvalho
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Core Data merge and "statement is still active" error?

2008-06-05 Thread Ben Trumbull


On Jun 5, 2008, at 7:49 PM, Michael Link wrote:



On Jun 5, 2008, at 4:37 PM, Ben Trumbull wrote:



On Jun 3, 2008, at 8:15 PM, Michael Link wrote:

Is there a reason you're not using Core Data's - 
mergeChangesFromContextDidSaveNotification: ?


If the object is modified (inserted, update, or deleted), you  
should pass in YES to -refreshObject:mergeChanges:


Actually I am using mergeChangesFromContextDidSaveNotification:, I  
am calling refreshObject:mergeChanges: with NO on the  
NSUpdatedObjectsKey objects just before as this avoids the problem  
of Bug 5937572.


You shouldn't call -refreshObject:mergeChanges:NO on an object with  
changes (passing YES is okay).  The reason for this is if the  
object is deleted or inserted, nuking that state is just plain  
weird.  The graph of objects will not behave they way you would  
wish.  A nuked inserted object is stuck in limbo, and a nuked  
deleted object can be a stale pointer for any of the objects  
related to it across inverse relationships.  Nuking an updated  
object also has a high probability of corrupting the relationship  
state for other objects with relationships to it.


Since the objects on the main thread aren't supposed to have  
changes, skipping the changed ones shouldn't be a burden.


I should skip using -refreshObject:mergeChanges:NO on any object  
that is in NSUpdatedObjectsKey?


No, by "changed" I mean returns YES to any of: -isDeleted, - 
isInserted, -isUpdated


In your mergeChangesFromContextDidSaveNotification callback, you save  
the document.  If you do that first, and then call - 
refreshObject:mergeChanges:NO on all the objects in the notification  
that don't have changes, and then call the MOC's  
mergeChangesFromContextDidSaveNotification (since this will send  
notifications for any observing controllers), it appears to work  
around your first problem.


Obviously, that's way more convoluted than it ought to be.

- 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 [EMAIL PROTECTED]


Re: knowing when WebView is done

2008-06-05 Thread Timothy Ritchey
Here is a typical trace for a failing load for me ("main" is the name  
I've given to the frame):


2008-06-05 21:56:40.539 Vigil[43952:10b] didCommitLoadForFrame: main
2008-06-05 21:56:40.546 Vigil[43952:10b] didReceiveTitle: main
2008-06-05 21:56:40.598 Vigil[43952:10b] didReceiveIcon: main
2008-06-05 21:56:41.622 Vigil[43952:10b] didCommitLoadForFrame: -->
2008-06-05 21:56:41.623 Vigil[43952:10b] didReceiveTitle: -->
2008-06-05 21:56:41.720 Vigil[43952:10b] didFinishLoadForFrame: -->

2008-06-05 21:56:41.721 Vigil[43952:10b] didFinishLoadForFrame: main
2008-06-05 21:56:41.851 Vigil[43952:10b]  
WebViewProgressFinishedNotification

2008-06-05 21:56:41.855 Vigil[43952:10b] didReceiveTitle: main


even if I track frame commit/finish load as suggested in the thread,  
if I try to get rid of the webview, the world falls down around me  
when it can't push out that last delegate call of didReceiveTitle. I  
tried even counting title/icon, etc. and that didn't even help (you  
can see there are two calls to the title delegate, both for the main  
frame. There just doesn't appear to be a deterministic way to figure  
out when WebView is actually done, and safe to release.



On Jun 5, 2008, at 8:24 PM, Rush Manbert wrote:



On Jun 5, 2008, at 3:23 PM, Mark Bateman wrote:


Tim,

I use the webviewdidfinishload method I'm not usre if that is any  
use to you...I'm quite new so I hope I'm not missing something  
obvious in your message.




See this thread:

http://lists.apple.com/archives/webkitsdk-dev/2005/Dec/msg00047.html

-Rush



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: DTrace probe problem

2008-06-05 Thread radj
Hello again.

I have another problem now and it is how to set off DTrace from within the
application. This is my code:

// SNIPPET START

int pid = [[NSProcessInfo processInfo] processIdentifier];

NSArray *arguments = [NSArray arrayWithObjects: @"-w", // permit destructive
actions
@"-o /tmp/DTraceLog", //
output file
@"-s /tmp/DTrace.d", //
D script
[NSNumber
numberWithInt:pid], // feed in PID for macro $1
nil];

NSTask *task;
task = [[NSTask alloc] init];
[task setLaunchPath: @"/dev/dtrace"];
[task setArguments: arguments];
[task launch];

// SNIPPET END

the launch path is correct, right? I found dtrace in the /dev folder.
Unfortunately, it crashes and here's a part of the crash log:

// CRASH LOG
...
Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0001, 0x96cddd78
Crashed Thread:  0

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: 'launch path not accessible'

Thread 0 Crashed:
0   com.apple.CoreFoundation  0x96cddd78
___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___ + 0
1   libobjc.A.dylib   0x9003a768 objc_exception_throw + 68
2   com.apple.CoreFoundation  0x96cddcdc +[NSException
raise:format:arguments:] + 136
3   com.apple.CoreFoundation  0x96cddd14 +[NSException
raise:format:] + 52
4   com.apple.Foundation  0x93c502c0 -[NSConcreteTask
launchWithDictionary:] + 392
...
// CRASH LOG END

Is there something wrong with how the NSTask was set up?
The application does not run as "root" but as "_lp". Is that a big factor in
the error?

Cheers,

radj
___

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

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

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

This email sent to [EMAIL PROTECTED]


NSBundle getting location of file in bundle

2008-06-05 Thread Mark Bateman
I'm currently hardcoding the file location just for debugging my app.   
It works great.


I'm now trying to use NSBundle to insert the resource location string  
for a webview. I'm using locally stored content inside the app  
bundle.  I tried using:


NSMutableString *url;   
url = [NSBundle pathForResource: @"AirportInfoPDA"];

I can't tell if this returns the full path including the filename &  
extension as the program now crashes.


the full path i've been using on the simulator is

file:Users/mark/Documents/Projects/FltPlan/PDA/AirportInfoPDA.htm

works well with:

[myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL  
URLWithString: url]]];


How do I form the correct path from the bundle location and use the  
AppendString to add the file:// on the front as I can't get it to work  
even when hard coding the strings using append.






___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSBundle getting location of file in bundle

2008-06-05 Thread Michael Vannorsdel
Try using NSURL's fileURLWithPath:, you won't need to preappend  
"file://".



On Jun 5, 2008, at 8:37 PM, Mark Bateman wrote:

I'm currently hardcoding the file location just for debugging my  
app.  It works great.


I'm now trying to use NSBundle to insert the resource location  
string for a webview. I'm using locally stored content inside the  
app bundle.  I tried using:


NSMutableString *url;   
url = [NSBundle pathForResource: @"AirportInfoPDA"];

I can't tell if this returns the full path including the filename &  
extension as the program now crashes.


the full path i've been using on the simulator is

file:Users/mark/Documents/Projects/FltPlan/PDA/AirportInfoPDA.htm

works well with:

[myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL  
URLWithString: url]]];


How do I form the correct path from the bundle location and use the  
AppendString to add the file:// on the front as I can't get it to  
work even when hard coding the strings using append.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSBundle getting location of file in bundle

2008-06-05 Thread David Wilson
On Thu, Jun 5, 2008 at 10:37 PM, Mark Bateman
<[EMAIL PROTECTED]> wrote:
> I'm now trying to use NSBundle to insert the resource location string for a
> webview. I'm using locally stored content inside the app bundle.  I tried
> using:
>
> NSMutableString *url;
> url = [NSBundle pathForResource: @"AirportInfoPDA"];
>
> I can't tell if this returns the full path including the filename &
> extension as the program now crashes.

There's no such method for NSBundle. Take a look at the API for the
NSBundle class- you need one of the pathForResource:ofType: methods.
You probably want:

url = [[NSBundle mainBundle] pathForResource:@"AirportInfoPDA"
ofType:@"extension"];

-- 
- David T. Wilson
[EMAIL PROTECTED]
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: DTrace probe problem

2008-06-05 Thread Michael Ash
On Fri, Jun 6, 2008 at 10:28 AM, radj <[EMAIL PROTECTED]> wrote:
> Hello again.
>
> I have another problem now and it is how to set off DTrace from within the
> application. This is my code:
>
> // SNIPPET START
>
> int pid = [[NSProcessInfo processInfo] processIdentifier];
>
> NSArray *arguments = [NSArray arrayWithObjects: @"-w", // permit destructive
> actions
>@"-o /tmp/DTraceLog", //
> output file
>@"-s /tmp/DTrace.d", //
> D script

These are not your immediate problem, but they will break next. These
arguments are incorrect. You're passing the flag plus the value as a
*single* argument. This is equivalent to quoting it in the shell. You
don't want that. Pass them as separate arguments. See:

http://www.cocoadev.com/index.pl?NSTaskArguments

>[NSNumber
> numberWithInt:pid], // feed in PID for macro $1
>nil];
>
> NSTask *task;
> task = [[NSTask alloc] init];
> [task setLaunchPath: @"/dev/dtrace"];

This won't work. /dev is for "devices", not "developer". /dev/dtrace
is a dtrace kernel device, *not* the dtrace binary. Use "which dtrace"
in the shell to find out the path to the dtrace executable.

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 [EMAIL PROTECTED]


Re: gcc-4.0 Fail with Realease Configuration

2008-06-05 Thread Andrew Farmer

On 05 Jun 08, at 17:32, James Murdza wrote:

Oh. Whoops, I should have realized that. Here it is:
http://tinyurl.com/6xdbw6. I honestly don't know what part of it I  
should be
reading because I've never had this kind of problem before, but I  
hope that

someone more experienced might.


The key phrase here (which is - to be fair - rather well hidden) is:

"... multiple definitions of symbol ..."

It looks like you're probably #import'ing .m files, or something  
similar. Don't do this.


If that isn't it, try doing a double-broom (Clean All) and see if the  
problem goes away.

___

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

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

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

This email sent to [EMAIL PROTECTED]


Multi Dock

2008-06-05 Thread Apparao Mulpuri
Hi List,

  I am developing a multi monitor application, in which i need to
display Dock on every monitor. Monitor which has System bar is the
primary monitor.

  I didn't find any supporting classes to implement it in Cocoa. Is it
implementable in Cocoa?. Please provide some pointers on it.

Thanks & Regards,
- Apparao.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: enumeratorAtPath - path string issue???

2008-06-05 Thread Kyle Sluder
On Thu, Jun 5, 2008 at 5:50 PM, Rail Jon Rogut <[EMAIL PROTECTED]> wrote:
>if ([[[file pathExtension] lowercaseString] isEqualToString:

FWIW (and depending on what exactly you're trying to do you might want
to ignore me completely), this isn't the "correct" way to determine
file types on OS X.  You might want to consider seeing if the file's
UTI is or conforms to "com.microsoft.waveform-audio" using either
UTTypeEqual() or UTTypeConformsTo().  You can get the UTI of a file
using LSCopyItemAttribute with the kLSItemContentType constant.

--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 [EMAIL PROTECTED]


Re: App hangs when displaying any sheet in 10.5 [SOLVED]

2008-06-05 Thread Graham Cox
I guess the question is, given an object type 'id', which method  
signature will the compiler go with? Does the return type affect the  
method signature? (In C++ it doesn't for example), so two methods:


- (CGPoint) position;
- (float)   position;

might well have identical signatures. The compiler doesn't have an  
object type to narrow it down, so which will it use - the first it  
finds maybe.


So if it picked the first case, it will generate code that returns a  
struct CGPoint and try and stuff it into the address of a float, thus  
overrunning the stack - in spite of the fact that at runtime, it does  
call the correct method which returns a float - there's still a  
mismatch between what the compiler expected and what really happened.  
In other words, the code to handle the return type was set in stone at  
compile time.


That's my best guess as to what's happened here. However, I get no  
compile-time warning, despite having many extra warnings turned on,  
including the one that usually warns about having no signature for the  
method, so assuming it returns int. The lack of this warning suggests  
it has found a method signature to use - and it's got the wrong return  
type.


This does seem to me either a compiler bug, or something that should  
be warned about. (Or it could be that my guesses here are wrong, and  
it's something else). This bug has now bitten me twice, and can easily  
come to affect code already considered debugged because if Apple  
happens to add a method to Cocoa having the same signature but a  
different return type from one of your own, it may well cause the  
compiler to generate bad code unless you strongly type everything. If  
only Obj-C had namespaces


In this case, Apple did exactly that - two new methods named  
'position' were added to Cocoa in 10.5 - one in CALayer, the other in  
NSPositionalSpecifier. In 10.4, no method named 'position' existed  
anywhere in Cocoa.


cheers, Graham




On 6 Jun 2008, at 2:12 pm, Hamish Allan wrote:

On Thu, Jun 5, 2008 at 5:12 PM, Brian Stern <[EMAIL PROTECTED]>  
wrote:


While float and int are the same size they are returned from  
functions in
different registers (on both ppc and intel). If the calling  
function expects
a float returned type but an int is returned instead the calling  
function
will certainly get a bogus value. In addition it may save and  
restore the

wrong registers and not save and restore a register that needs to be
preserved, resulting in memory corruption.


That shouldn't be what happened here, though -- the method in question
was returning a float. Perhaps the calling function expected an int,
but I don't see why...

Hamish
___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/graham.cox%40bigpond.com

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Multi Dock

2008-06-05 Thread Graham Cox
Nope, not possible. Cocoa doesn't provide support for this because the  
Dock is a private Apple application, not a public class in Cocoa.


Your only hope is to create your own dock application, which is  
obviously non-trivial.


However, Since Mac multi-monitor apps don't work this way anyway, your  
strange dock will probably not go down very well with users, so one  
would have to go back to the most fundamental assumptions you're  
making and question them.



G.


On 6 Jun 2008, at 3:10 pm, Apparao Mulpuri wrote:


Hi List,

 I am developing a multi monitor application, in which i need to
display Dock on every monitor. Monitor which has System bar is the
primary monitor.

 I didn't find any supporting classes to implement it in Cocoa. Is it
implementable in Cocoa?. Please provide some pointers on it.

Thanks & Regards,
- Apparao.
___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/graham.cox%40bigpond.com

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: App hangs when displaying any sheet in 10.5 [SOLVED]

2008-06-05 Thread Hamish Allan
On Fri, Jun 6, 2008 at 6:26 AM, Graham Cox <[EMAIL PROTECTED]> wrote:

> I guess the question is, given an object type 'id', which method signature
> will the compiler go with? Does the return type affect the method signature?
> (In C++ it doesn't for example), so two methods:
>
> - (CGPoint) position;
> - (float)   position;
>
> might well have identical signatures. The compiler doesn't have an object
> type to narrow it down, so which will it use - the first it finds maybe.

I'd have thought that in the case:

// id anonymous
float f = [anonymous position];

the compiler ought to assume that the method being used is the one
returning a float, or if not at least warn about an implicit cast from
CGPoint to float. Perhaps if it were -(int)position rather than
-(CGPoint)position, you might not expect a warning, but in that case
you would expect a cast, so it shouldn't break.

However, that does appear to be what is happening. In the absence of
any other explanation, I'd call it a compiler bug.

Hamish
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: App hangs when displaying any sheet in 10.5 [SOLVED]

2008-06-05 Thread Graham Cox
I agree, the compiler ought to be able to use the return type to  
disambiguate two otherwise identically named methods (or warn of the  
mismatch) - but it clearly doesn't.


This is interesting - I looked at the assembly code of the two cases.  
Here's the code for the line:


float lp = [lh position];

First for the anonymous type (id):

LM75:
movl8(%ebp), %edx
lealL_OBJC_SELECTOR_REFERENCES_35-"L012$pb"(%ebx), %eax
movl(%eax), %eax
movl%eax, 4(%esp)
movl%edx, (%esp)
callL_objc_msgSend$stub
lealLC17-"L012$pb"(%ebx), %ecx
movl%eax, %edx
andl$65535, %edx
shrl$16, %eax
cvtsi2ss%eax, %xmm0
cvtsi2ss%edx, %xmm1
mulss   (%ecx), %xmm0
addss   %xmm1, %xmm0
movss   %xmm0, -44(%ebp)
movl-44(%ebp), %eax
movl%eax, -16(%ebp)

And for the strongly typed version:

LM75:
movl8(%ebp), %edx
lealL_OBJC_SELECTOR_REFERENCES_35-"L012$pb"(%ebx), %eax
movl(%eax), %eax
movl%eax, 4(%esp)
movl%edx, (%esp)
callL_objc_msgSend_fpret$stub
fstps   -16(%ebp)

I'm not familiar with Intel assembler (if only it were 68K ;-) so I  
don't have much clue what's going on, but clearly the code is very  
different (and in the second case, looks a lot tighter too). Up to the  
call to the object's method they are the same. The first case uses  
objc_msgSend which is used for "simple return types". The second case  
uses objc_msgSend_fpret which is used to return a double value. What  
the rest of the code in the first case is doing with its supposed  
"simple return type" I don't know - looks pretty arcane though and  
since it damages things, is obviously wrong. Maybe someone who can  
read the assembly can throw some additional light?


cheers, Graham








On 6 Jun 2008, at 3:37 pm, Hamish Allan wrote:

On Fri, Jun 6, 2008 at 6:26 AM, Graham Cox <[EMAIL PROTECTED]>  
wrote:


I guess the question is, given an object type 'id', which method  
signature
will the compiler go with? Does the return type affect the method  
signature?

(In C++ it doesn't for example), so two methods:

- (CGPoint) position;
- (float)   position;

might well have identical signatures. The compiler doesn't have an  
object
type to narrow it down, so which will it use - the first it finds  
maybe.


I'd have thought that in the case:

// id anonymous
float f = [anonymous position];

the compiler ought to assume that the method being used is the one
returning a float, or if not at least warn about an implicit cast from
CGPoint to float. Perhaps if it were -(int)position rather than
-(CGPoint)position, you might not expect a warning, but in that case
you would expect a cast, so it shouldn't break.

However, that does appear to be what is happening. In the absence of
any other explanation, I'd call it a compiler bug.

Hamish


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: App hangs when displaying any sheet in 10.5 [SOLVED]

2008-06-05 Thread Andrew Farmer

On 05 Jun 08, at 22:58, Graham Cox wrote:

callL_objc_msgSend$stub
lealLC17-"L012$pb"(%ebx), %ecx
movl%eax, %edx
andl$65535, %edx
shrl$16, %eax
cvtsi2ss%eax, %xmm0
cvtsi2ss%edx, %xmm1
mulss   (%ecx), %xmm0
addss   %xmm1, %xmm0
movss   %xmm0, -44(%ebp)


This'll take the return value of objc_msgSend (in eax) and convert it  
to floating-point. The shift/multiply/add bit is a bit strange, but  
the cvtsi2ss is a clear sign of an integer->float conversion. GCC is  
assuming that the return value should be interpreted as an integer,  
then cast to a float.



callL_objc_msgSend_fpret$stub
fstps   -16(%ebp)


As the _fpret suggests, this is behaving correctly.

Keep in mind that, in the x86 architecture (along with most other  
modern architectures), floating-point values are kept in separate  
registers from other values. As the Mach-O x86 ABI mandates that (non- 
struct) return values are returned in registers, rather than on the  
stack, it's therefore crucial that functions which return floating- 
point values have explicit prototypes.

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: DTrace probe problem

2008-06-05 Thread radj
> http://www.cocoadev.com/index.pl?NSTaskArguments
>

Oh. So that's how it's supposed to be done.

Use "which dtrace" in the shell to find out the path to the dtrace
> executable.
>

Found it. It's "/usr/sbin/dtrace".

Finally made DTrace run off from the driver but unfortunately, dtrace
requires more previliges than "_lp" user can give. And I've read that
authentication is a little complicated. I bet I can find lots of examples of
running stuff as root in other threads.

Thanks for all your help, guys!

radj
___

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

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

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

This email sent to [EMAIL PROTECTED]


  1   2   >