Send Cocoa-dev mailing list submissions to
email@hidden
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.apple.com/mailman/listinfo/cocoa-dev
or, via email, send a message with subject or body 'help' to
email@hidden
You can reach the person managing the list at
email@hidden
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cocoa-dev digest..."
Today's Topics:
1. Re: NSTableView drag and drop too smart for its own good
(Corbin Dunn)
2. Re: NSTableView drag and drop too smart for its own good
(Jerry Krinock)
3. NSTextField not updating NSUserDefaults using bindings
(Rod Schmidt)
4. RE: How to know user clicks [print] button in cocoa PDE
(Jeff Chen)
5. Re: NSGlyph from Unicode (Pascal Goguey)
6. String in NSRect (Brian Amerige)
7. ThreadWorker return value (Greg Hoover)
8. Re: Threading and NSApplicationMain() (Rosyna)
9. POSTing into a server from COCOA (deepak gopal)
10. Re: POSTing into a server from COCOA (Spencer Salazar)
11. Re: POSTing into a server from COCOA (Ken Tozier)
12. GCOV question (Vinay Prabhu)
13. DO deadlock problem (David McGavran)
14. Re: DO deadlock problem (David McGavran)
----------------------------------------------------------------------
Message: 1
Date: Wed, 13 Sep 2006 12:49:16 -0700
From: Corbin Dunn <email@hidden>
Subject: Re: NSTableView drag and drop too smart for its own good
To: Paul Kim <email@hidden>
Cc: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
The problem is that it seems like NSTableView sees itself as the
source of the drag, so it won't allow drops at the position of the
original dragged row (thinking it's just a move of a row within
itself). It doesn't even seem to call -tableView: validateDrop:
proposedRow: proposedDropOperation: on my data source when the drag
is over the original row position (even though in my case, the table
has different data so it would make sense to drop it there).
This is a bug which will be fixed.
Is there an easy way to work around this or am I stuck re-
implementing NSTableView's drag and drop in a subclass to get this
to work?
An easy, cool, workaround: use two tableviews (they can have the same
datasource/delegate). When switching sources, use NSViewAnimation to
fade one table out and the other table in. Cool! (and avoids your
issue). For abstraction, you can keep a pointer to the "active
tableview" or something like that and switch back and forth.
-corbin
------------------------------
Message: 2
Date: Wed, 13 Sep 2006 13:05:10 -0700
From: Jerry Krinock <email@hidden>
Subject: Re: NSTableView drag and drop too smart for its own good
To: Cocoa Developers <email@hidden>
Message-ID: <C12DB286.26EC4%email@hidden>
Content-Type: text/plain; charset="US-ASCII"
on 06/09/13 9:57, Paul Kim at email@hidden wrote:
I have two table views, one is a source list and....
If all of what you say is true, I'd say this is unfortunate. I
would have
expected it to call -validateDrop
Is there an easy way to work around this or am I stuck re-
implementing NSTableView's drag and drop in a subclass to get this to
work?
Oooooo, I'd suspect there is some other trick that would be much
easier than
re-implementing drag and drop in a subclass. How about this:
newTableView = [originalTableView copy] ;
// Make sure the above is a deep copy that
// copies all instance variables
[originalTableView retain] ;
[originalTableView removeFromSuperview] ;
[newTableView reloadData] ; // (gets new data)
[windowContentView addSubview:newTableView] ;
Then, after you've completed the drop,
[originalTableView release] ;
------------------------------
Message: 3
Date: Wed, 13 Sep 2006 15:39:02 -0600
From: Rod Schmidt <email@hidden>
Subject: NSTextField not updating NSUserDefaults using bindings
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
I have a preference dialog with two fields: a user name and a
password field. These are bound to values in the the user defaults.
This works fine for most of my users (at least I haven't received any
bug reports), except for two users. For them, the username field
isn't being updated in the user defaults. The user types in their
user name, closes the dialog, and goes on with using the software.
The software retrieves this default and it is not up to date. Yet
when the preferences dialog is re-opened it has the correct value.
One user said that if he typed one character, then closed the prefs
dialog, reopened it, and then typed another character, and on and
on..., it would work.
As far as I can tell, the bindings are set up correctly, including
the continuously update value setting is set to true.
I've tried to duplicate it myself and haven't been able to. Any ideas?
Thanks,
Rod
------------------------------
Message: 4
Date: Thu, 14 Sep 2006 10:09:15 +0800
From: "Jeff Chen" <email@hidden>
Subject: RE: How to know user clicks [print] button in cocoa PDE
To: "nishino tetsuya" <email@hidden>,
"email@hidden" <email@hidden>,
"email@hidden" <email@hidden>,
"email@hidden" <email@hidden>
Message-ID: <20060914100915445.00000001276@chnxcs325>
Content-Type: text/plain; charset=iso-2022-jp
Hi,
Now I understand your requirements. I'm afraid there's something
unsuitable with your code to show window and close window.
Following is my sample code:
When the "OK" button is pressed on the window:
SelectWindow(a WindowRef);
ShowWindow(a WindowRef);
RunAppModalLoopForWindow(a WindowRef);
HideWindow(a WindowRef);
When the "OK" button is pressed on the window:
ClearKeyboardFocus(a WindowRef);
QuitAppModalLoopForWindow(a WindowRef);
Would you try following solution?
Best Regards
Jeff Chen
-----Original Message-----
From: nishino tetsuya [mailto:email@hidden]
Sent: Thursday, September 14, 2006 1:58 AM
To: email@hidden; email@hidden;
email@hidden; email@hidden
Subject: RE: How to know user clicks [print] button in cocoa PDE
Hello,
When the "Print" button is pressed, I will show the window with the
follwong codes:
ShowWindow(a WindowRef)
RunAppModalLoopForWindow(a WindowRef)
HideWindow(a WindowRef)
When the "OK" button is pressed on the window, I will close the window
with:
QuitAppModalLoopForWindow(a WindowRef)
Mac OSX 10.4 Developer Release notes states the followings
Implementation Changes: Carbon/Cocoa Window Interaction
Several changes have been made to the Window Manager and Control
Manager to
improve behavior when both Carbon and Cocoa windows are present in
the same
process:
- automatic release of focus on click from Cocoa windows
I personally think that Apple changed their code to deal with this
issue,
but
we have to do it manually on 10.3 when I only switch cocoa to carbon
window.
Thanks,
Tetsu
From: "Jeff Chen" <email@hidden>
To: "nishino tetsuya" <email@hidden>,
"email@hidden" <email@hidden>,
"email@hidden" <email@hidden>,
"email@hidden" <email@hidden>
Subject: RE: How to know user clicks [print] button in cocoa PDE
Date: Wed, 13 Sep 2006 14:01:14 +0800
Hi
How do you close your cocoa window?
I think your cocoa dialog should be run modally,isn't it? Then when
you
close the cocoa dialog, you can't simply use [NSWindow close], you
must
quit modal status for the dialog.
Your code should be following:
[NSApp stopModal];
[YourCustomCocoaWindow close];
Best Regards
Jeff Chen
-----Original Message-----
From: printing-bounces+jeff-
sdcc.chen=email@hidden
[mailto:printing-bounces+jeff-
sdcc.chen=email@hidden
m]On Behalf Of nishino tetsuya
Sent: Tuesday, September 12, 2006 7:46 AM
To: email@hidden; email@hidden; cocoa-
dev@lists.
apple.com
Subject: RE: How to know user clicks [print] button in cocoa PDE
Hi,
I don't have idea for your problem, but can I ask you question.
I am having the following problem:
I made PDE in 10.3.8. When you open a document with Safari and click
"Print" button,
the PDE will show a dialog (Cocoa). Then, as soon as you click "OK"
button
on the dialog it will be
closed. However, the window for the Safari document no longer has
focus
(the three buttons
in the top left (Close, Minimize & Maximize) become grayed-out and
disabled.).
All you can do is to quit Safari comletely from "Safari" menu.
Is there any way to manually change focus from Cocoa window to Carbon
window?
In 10.4, the OS takes care of this.
Thanks,
Tetsu Nishino
From: "Yu, Min" <email@hidden>
To: "email@hidden" <email@hidden>,
"email@hidden" <email@hidden>
Subject: How to know user clicks [print] button in cocoa PDE
Date: Fri, 8 Sep 2006 10:09:13 +0800
Hi All,
I met with a problem when I made PDE with cocoa:
I can't catch the event that user presses [Print] button, in carbon
PDE, I
can get the ControlRef of [Print] button and install event handler
to it.
However, in cocoa, I can only get the NSButton * pointer of [Print]
button,
but I can't install event handler to NSControl in cocoa. I can
only use
the event in NSResponder. But NSResponder doesn't provide the event
that
handles the clicking of [Print] Button.
Who knows how I can catch the event that user clicks [print] Button in
cocoa? Or who knows how to install event handler to a special
NSControl in
cocoa?
Best Regards
Jeff Chen
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Printing mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40hotmail.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Printing mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40chn.fujixerox.com
This email sent to email@hidden
------------------------------
Message: 5
Date: Thu, 14 Sep 2006 11:15:21 +0900
From: Pascal Goguey <email@hidden>
Subject: Re: NSGlyph from Unicode
To: Douglas Davidson <email@hidden>
Cc: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Hello Douglas!
Thanks for your reply.
Ok, I fixed the allocate and release part, and it seems there is no
major speed problem
anymore. The rest of the code is the same, so
Now, in the "number of things I am missing", I understand that the
actual shape of a
character depends on the font and may also depend on the surrounding
characters.
That's why I ended up using a layout manager because I think the
layout manager
should have the info I need (i.e. the right glyph at the right place).
What I am doing: I put the incoming text into a textstorage object.
The text storage
then gets a layout manager that should take care of its contents. Now
if I ask
the layout manager for its glyphs, shouldn't it give me the right
values?
Here is a simplified version of my method. All objects are supposed
to be created
somewhere and to exist. For simplicity purposes, I didn't add any
test for validity.
Which step is wrong? Is there a missing step?
- (NSBezierPath *) createBezierPathFromString:(NSString *)string
ofSize:(float)size {
int position = 0;
NSGlyph g;
NSBezierPath * bezier = [NSBezierPath bezierPath];
// Step 1: load the tectStorage object with my incoming string
[textStorage setAttributedString:[[NSAttributedString alloc]
initWithAttributes:attributes];
// Step 2 : set the layout manager for the text storage.
[textStorage addLayoutManager:layoutManager];
// Make a bezier path that will represent our text.
bezier = [[NSBezierPath alloc] init];
// Init the first drawing point
[bezier moveToPoint:NSMakePoint(0.0, 0.0)];
// Step 3 : Find each style run in the NSTextStorage. Note that
there might
// be a shorter way of getting all the bezier info of a text run.
But for the time being
// I would like to make this one work.
int count = [layoutManager numberOfGlyphs];
while(position < count) {
g = [layout glyphAtIndex:position];
[bezier appendBezierPathWithGlyph:g inFont: [NSFont
boldSystemFontOfSize:size]];
position++;
}
return bezier;
}
Pascal
On 14 sept. 06, at 01:27, Douglas Davidson wrote:
On Sep 13, 2006, at 3:51 AM, Pascal Goguey wrote:
I also have messed a lot with the NSLayoutManager without success,
My second example shows the use of NSLayoutManager, etc.
It's extremely slow (I don't know if the path calculation or the
drawing is slow...).
If you don't know what part is slow, Sampler or Shark will tell
you. If you are creating and destroying a new layout manager every
time, that will definitely be slow; try keeping the text system
objects around and changing the text only when necessary. The
process of glyph generation is fairly fast; if you need glyph
generation without NSLayoutManager, you can use NSGlyphGenerator.
However, there are a number of things that you are missing. In
general there is not a one-to-one mapping between Unicode
characters and glyphs in a given font. There may be multiple
glyphs required to represent a given character, or multiple
characters may be represented by a single glyph, or there may be
more complicated situations. The proper glyph to use may depend on
context--that is, on the surrounding characters. Furthermore, the
positioning of the glyphs is not always one after another; their
positions may need adjusting, or they may need reordering.
Using the glyph generation facilities of NSLayoutManager without
layout, or using NSGlyphGenerator, will give you a first-pass
minimal translation of characters to glyphs. It may not be one-to-
one, and there may be NSNullGlyphs inserted as padding in cases
where multiple characters would otherwise be represented by a
single glyph. For the full proper contextual glyphs, however, you
must do layout as well; this is also required for positioning and
reordering.
Another issue is font substitution. A single font may not suffice
to represent all of the characters in a given string, so
NSAttributedString goes through a process known as font fixing,
whereby a new suitable font is substituted whenever characters
cannot be represented in the specified font. When you examine the
glyphs in the layout manager, you should remember that they are
glyphs in the font given by the font attribute on the attributed
string after font fixing, not necessarily the font originally
specified. You will need to use the layout manager to convert back
from glyph indexes to character indexes and examine the text
storage's font attribute at the relevant character index.
See the conceptual documentation on the Cocoa text system for more
information.
Douglas Davidson
------------------------------
Message: 6
Date: Wed, 13 Sep 2006 23:13:16 -0400
From: Brian Amerige <email@hidden>
Subject: String in NSRect
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Hi all,
I've got an NSRect with an Image, and a grip that I'm using for a
subclassed NSSplitView. Here's the code:
- (void)drawDividerInRect:(NSRect)aRect
{
NSImage *grip = [NSImage imageNamed:@"SplitterHandle.png"];
NSImage *bar = [NSImage imageNamed:@"sidebar_header"];
[bar setFlipped:YES];
[grip setFlipped:YES];
NSImage * canvas = [[[NSImage alloc] initWithSize:aRect.size]
autorelease];
NSRect canvasRect = NSMakeRect(0, 0, [canvas size].width, [canvas
size].height);
NSRect gripRect = NSMakeRect(0,4, [canvas size].width, [canvas
size].height);
gripRect.origin.x = (NSMidX(aRect)*1.9 - ([grip size].width/2));
[canvas lockFocus];
[bar setSize:aRect.size];
[bar drawInRect:canvasRect fromRect:canvasRect
operation:NSCompositeSourceOver fraction:1.0];
[grip drawInRect:gripRect fromRect:canvasRect
operation:NSCompositeSourceOver fraction:1.0];
[canvas unlockFocus];
[self lockFocus];
[canvas drawInRect:aRect fromRect:canvasRect
operation:NSCompositeSourceOver fraction:1.0];
[self unlockFocus];
}
How would I get a string in there are well? (For example, a label for
this separator).
Thanks in advance!
Brian Amerige
http://extendmac.com
http://cocoaforum.com
------------------------------
Message: 7
Date: Wed, 13 Sep 2006 20:49:50 -0700
From: Greg Hoover <email@hidden>
Subject: ThreadWorker return value
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
I'm using the ThreadWorker class by Robert Harder for a variety of MT
tasks in my app. I've discovered that if one of my worker threads
returns an NSAttributedString object, the whole app hangs, but if it
returns an NSArray object, the app works beautifully. The calls are
all identical and I haven't modified the functionality of the methods
-- the only thing I've changed is the returned object. I've also
tried adding superfluous retain calls to the returned objects,
thinking that the object was possibly being deallocated before it
could be used, but this didn't solve the problem. Does anyone have
experience with this? Can certain objects not be distributed across
threads/tasks/etc?
Thanks.
Greg
------------------------------
Message: 8
Date: Wed, 13 Sep 2006 21:40:19 -0700
From: Rosyna <email@hidden>
Subject: Re: Threading and NSApplicationMain()
To: Nick Zitzmann <email@hidden>, Rob Ross
<email@hidden>
Cc: email@hidden
Message-ID: <p06230905c12e8d21a08a@[192.168.1.5]>
Content-Type: text/plain; charset="us-ascii" ; format="flowed"
not thread safe does not mean main thread most of the time (with the
exclusion of NSAppleScript which is documented explicitly at least 3
times as only being able to run from the main thread). OS X itself
may put the runloop in a non-main thread in certain circumstances
(rosetta, java). Where main thread means thread 0. If main thread
means thread where the main runloop is running, then ignore
everything I said.
Ack, at 9/12/06, Nick Zitzmann said:
NSApplicationMain() always launches in the same thread, which had
better be the main thread since a good deal of the AppKit is not
thread-safe.
--
Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug
Unsanity: Unsane Tools for Insanely Great People
It's either this, or imagining Phil Schiller in a thong.
------------------------------
Message: 9
Date: Thu, 14 Sep 2006 06:12:16 +0100 (BST)
From: deepak gopal <email@hidden>
Subject: POSTing into a server from COCOA
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=iso-8859-1
Hi All
I am a Java programmer and I am new to Cocoa and Objective C.
(Started off in August.) I am trying out few things in
CurrencyConverter project in the Cocoa examples.
The basic currency converter is a simple multiplier which
multiplies two values and gives the result. We write the conversion
code in the .m class class in the project.
But now I want to use Cocoa as the front end and connect to a Java
server in the backend.
Here I would like to enter two values to be multiplied in the cocoa
project window and would then POST the data (i.e the two values) to
the server and get the result from the server and display the same.
I have been using NSURLConnection and its methods to connect to the
server:
(I haven't yet found a way to pass the parameters, so I am just
trying to connect to the server first)
These are the steps I follow:
1) NSString *urlString = [NSString stringWithCString:"http://
172.19.23.36:8080/Mul/servlet/first"
];
2) NSMutableURLRequest *request=[NSMutableURLRequest requestWithURL:
[NSURL
URLWithString:urlString]
cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];
3) NSURLConnection *conn = [[NSURLConnection alloc]
initWithRequest:request delegate:self];
But this doesn't work. i.e. its not connecting to the server.
I checked my connections through a browser and they are ok.
The tool gives a warning in the first step saying that selector
[NSString stringWithCString] is not recognised. Its the same
warning for all the NSString methods.
I have borrowed the codes given in the cocoa documentation and
guides and from the sample codes available in ADC.
I am really confused I can't find a good way to connect to the my
server and send a request to it. I have been spending a lot of time
on this without getting any results.
Can anyone suggest/post a sample code with the same functionalities?
Thank You
Deep
---------------------------------
Find out what India is talking about on - Yahoo! Answers India
Send FREE SMS to your friend's mobile from Yahoo! Messenger
Version 8. Get it NOW
------------------------------
Message: 10
Date: Thu, 14 Sep 2006 01:30:57 -0400
From: Spencer Salazar <email@hidden>
Subject: Re: POSTing into a server from COCOA
To: email@hidden
Cc: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Hey there,
On Sep 14, 2006, at 1:12 AM, deepak gopal wrote:
These are the steps I follow:
1) NSString *urlString = [NSString stringWithCString:"http://
172.19.23.36:8080/Mul/servlet/first"
];
[...]
The tool gives a warning in the first step saying that selector
[NSString stringWithCString] is not recognised. Its the same
warning for all the NSString methods.
A "selector not recognized" warning is for most intents and purposes
actually an error (its due to the dynamic nature of Objective-C that
its just a warning). I think stringWithCString: was deprecated and
then removed. NSString does have a stringWithCString:encoding:
selector, but what I think you are really looking for is this:
NSString *urlString = @"http://172.19.23.36:8080/Mul/servlet/first";
Cocoa basically has an agreement with the compiler that says every
time you put a @ before a c-string, the compiler will transform the C
string into a valid and appropriately formed NSString *. I cant tell
if there are other problems with your code, but that should get you a
little closer at least.
spencer
------------------------------
Message: 11
Date: Thu, 14 Sep 2006 02:06:36 -0400
From: Ken Tozier <email@hidden>
Subject: Re: POSTing into a server from COCOA
To: Cocoa Dev List <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
On Sep 14, 2006, at 1:12 AM, deepak gopal wrote:
Hi All
I am really confused I can't find a good way to connect to the my
server and send a request to it. I have been spending a lot of time
on this without getting any results.
Can anyone suggest/post a sample code with the same functionalities?
Thank You
Deep
Hi Deep
I wrote this little class to encapsulate HTTPRequests using POST and
it's been working nicely for several months. It doesn't deal with
Java specifically, but it shouldn't require too many tweaks
@interface KHTTPSocket : NSObject
{
NSURL *url;
}
+ (id) socketWithURL:(NSURL *) inURL;
- (id) initSocketWithURL:(NSURL *) inURL;
- (id) send:(id) inData;
@end
@implementation KHTTPSocket
+ (id) socketWithURL:(NSURL *) inURL
{
return [[[KHTTPSocket alloc]
initSocketWithURL: inURL]
autorelease];
}
- (id) initSocketWithURL:(NSURL *) inURL
{
if (self = [super init])
{
url = [inURL retain];
}
return self;
}
- (void) dealloc
{
[url release];
[super dealloc];
}
- (id) send:(NSString *) inData
{
// serialize inData into PHP form
// NOTE: "query=" prefix is what the PHP script looks for in the
$_POST
// variable to see if there's anything for it to process
NSMutableURLRequest *request = [NSMutableURLRequest
requestWithURL: url];
const char *temp = [inData UTF8String];
NSData *body = [NSData dataWithBytes: temp length: strlen
(temp)],
*result;
NSString *bodyLength = [[NSNumber numberWithInt: [body length]]
stringValue];
NSCharacterSet *returnChars = [NSCharacterSet
characterSetWithCharactersInString: @"\r"];
NSHTTPURLResponse *response;
NSError *error;
NSLog(@"php query string = %@", phpData);
// generate the HTTP POST
[request setHTTPMethod: @"POST"];
[request setValue: @"application/x-www-form-urlencoded"
forHTTPHeaderField: @"Content-type"];
[request setValue: bodyLength forHTTPHeaderField: @"Content-
length"];
[request setValue: @"close" forHTTPHeaderField: @"Connection"];
[request setHTTPBody: body];
// send it away
result = [NSURLConnection sendSynchronousRequest: request
returningResponse: &response
error: &error];
NSLog(@"result = %@, error = %@", result, error);
// process result if any
if ((result != nil) && ([result length] > 0))
{
// You may need to change this part. I use it with PHP scripts that
return PList formatted data
NSString *temp = [[[NSString alloc] initWithBytes: [result bytes]
length: [result length]
encoding: NSUTF8StringEncoding]
stringByTrimmingCharactersInSet: returnChars];
return [temp propertyList];
}
else if (error != NULL)
{
// something went awry log HTTP header and error
NSLog(@"response = %@", [response allHeaderFields]);
NSLog(@"error = %@", error);
}
return nil;
}
@end
And to use it
KHTTPSocket *socket = [KHTTPSocket socketWithURL: inURL];
id result = [socket send: @"testing 1, 2, 3"]; // <- do something
with the data in your server side java
NSLog(@"result = %@", result);
HTH
Ken
---------------------------------
Find out what India is talking about on - Yahoo! Answers India
Send FREE SMS to your friend's mobile from Yahoo! Messenger
Version 8. Get it NOW
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40comcast.net
This email sent to email@hidden
------------------------------
Message: 12
Date: Thu, 14 Sep 2006 12:42:13 +0530
From: Vinay Prabhu <email@hidden>
Subject: GCOV question
To: "Cocoa-Dev (E-mail)" <email@hidden>
Message-ID: <002301c6d7cd$1ab4c580$5847a8c0@vinayprabhu>
Content-Type: text/plain; charset="iso-8859-1"
Hi,
I am trying to use, GCOV code coverage tool for unit testing.
1) With GCC 3.3, there seems to be a file path issue, so the .da
file is not
created.
2) With GCC 4.0, on PowerPC, when the "-fprofile-arcs and -ftest-
coverage"
is set in the Other C flags field.
Compiler error appears.
On Mac-Intel, with the above settings, it compiles, but no coverage
files
are created.
Is there anything else to be set up to get the coverage data?
Can any one suggest, how to use GCOV?
This is off-topic from Cocoa, but I have searched the mailing list
archives.
There are lot of question on this topic in XCode users list, but I
couldn't
find any answer.
If anyone came across this problem and solved, please help me in
this...
Regards
Vinay
------------------------------
Message: 13
Date: Thu, 14 Sep 2006 11:24:49 +0200
From: David McGavran <email@hidden>
Subject: DO deadlock problem
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Hoping someone can chime in on this....
I have a Distributed objects server that is also a client. Kind of a
man in the middle thing.
It gets a call on one of its methods that will turn around and
connect to another server.
Inside its CreateLink method it calls [NSConnection
rootProxyForConnectionWithRegisteredName]; This seems to pump the
CFRunLoop (via the stack trace). Inside this RunLoop I get another
call to start another connection with a different name. So I have
reentered. My code is reentrant and that should be ok. However when
this method calls [NSConnection
rootProxyForConnectionWithRegisteredName] it deadlocks and doesn't
call back. It gets stuck in mach_msg_trap.
The stack trace is something like this
#0 0x9000b268 in mach_msg_trap
#1 0x9000b1bc in mach_msg
#2 0x907dbb78 in __CFRunLoopRun
#3 0x907db47c in CFRunLoopRunSpecific
#4 0x92939598 in -[NSConnection sendInvocation:]
#5 0x92938034 in -[NSObject(NSForwardInvocation) forward::]
#6 0x90a430b0 in _objc_msgForward
!!!!!!!!! Here I have been reentered !!!!!!!!!!!!!!!!!!!!!!!
#7 0x00005304 in -[MYSERVEROBJECT CREATENEWLINK] at main.mm:563
!!!!!!!!! Here I have been reentered !!!!!!!!!!!!!!!!!!!!!!!
#9 0x90a431f4 in objc_msgSendv
#10 0x9293fd50 in -[NSInvocation invoke]
#11 0x9293f74c in -[NSConnection dispatchInvocation:]
#12 0x9293d858 in -[NSConnection handleRequest:sequence:]
#13 0x9293d1cc in -[NSConnection handlePortCoder:]
#14 0x9293cf38 in -[NSConcretePortCoder dispatch]
#15 0x9293c918 in __NSFireMachPort
#16 0x907e9820 in __CFMachPortPerform
#17 0x907e9734 in __CFRunLoopDoSource1
#18 0x907dbe4c in __CFRunLoopRun
#19 0x907db47c in CFRunLoopRunSpecific
#20 0x92939598 in -[NSConnection sendInvocation:]
#21 0x92938034 in -[NSObject(NSForwardInvocation) forward::]
#22 0x90a430b0 in _objc_msgForward
#23 0x00005304 in -[MYSERVEROBJECT CREATENEWLINK] at main.mm:563
How can I fix this? Is it possible to make sure that I don't get any
method calls until the current is done? Or to block NSConnection
from pumping the messages?
Thanks
Dave
------------------------------
Message: 14
Date: Thu, 14 Sep 2006 11:51:42 +0200
From: David McGavran <email@hidden>
Subject: Re: DO deadlock problem
To: David McGavran <email@hidden>
Cc: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Ignore... Sorry the server thread was dieing. Guess I still would
like it not to deadlock, but I found the real problem
Cheers
Dave
On Sep 14, 2006, at 11:24 AM, David McGavran wrote:
Hoping someone can chime in on this....
I have a Distributed objects server that is also a client. Kind of
a man in the middle thing.
It gets a call on one of its methods that will turn around and
connect to another server.
Inside its CreateLink method it calls [NSConnection
rootProxyForConnectionWithRegisteredName]; This seems to pump the
CFRunLoop (via the stack trace). Inside this RunLoop I get another
call to start another connection with a different name. So I have
reentered. My code is reentrant and that should be ok. However
when this method calls [NSConnection
rootProxyForConnectionWithRegisteredName] it deadlocks and doesn't
call back. It gets stuck in mach_msg_trap.
The stack trace is something like this
#0 0x9000b268 in mach_msg_trap
#1 0x9000b1bc in mach_msg
#2 0x907dbb78 in __CFRunLoopRun
#3 0x907db47c in CFRunLoopRunSpecific
#4 0x92939598 in -[NSConnection sendInvocation:]
#5 0x92938034 in -[NSObject(NSForwardInvocation) forward::]
#6 0x90a430b0 in _objc_msgForward
!!!!!!!!! Here I have been reentered !!!!!!!!!!!!!!!!!!!!!!!
#7 0x00005304 in -[MYSERVEROBJECT CREATENEWLINK] at main.mm:563
!!!!!!!!! Here I have been reentered !!!!!!!!!!!!!!!!!!!!!!!
#9 0x90a431f4 in objc_msgSendv
#10 0x9293fd50 in -[NSInvocation invoke]
#11 0x9293f74c in -[NSConnection dispatchInvocation:]
#12 0x9293d858 in -[NSConnection handleRequest:sequence:]
#13 0x9293d1cc in -[NSConnection handlePortCoder:]
#14 0x9293cf38 in -[NSConcretePortCoder dispatch]
#15 0x9293c918 in __NSFireMachPort
#16 0x907e9820 in __CFMachPortPerform
#17 0x907e9734 in __CFRunLoopDoSource1
#18 0x907dbe4c in __CFRunLoopRun
#19 0x907db47c in CFRunLoopRunSpecific
#20 0x92939598 in -[NSConnection sendInvocation:]
#21 0x92938034 in -[NSObject(NSForwardInvocation) forward::]
#22 0x90a430b0 in _objc_msgForward
#23 0x00005304 in -[MYSERVEROBJECT CREATENEWLINK] at main.mm:563
How can I fix this? Is it possible to make sure that I don't get
any method calls until the current is done? Or to block
NSConnection from pumping the messages?
Thanks
Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
------------------------------
_______________________________________________
Cocoa-dev mailing list
email@hidden
http://lists.apple.com/mailman/listinfo/cocoa-dev
End of Cocoa-dev Digest, Vol 3, Issue 1144
******************************************