File types opened by NSDocument architecture

2008-07-22 Thread Tom Bernard
/* + (NSArray *)readableTypes { return [NSArray arrayWithObjects:@"TIFF", @"tiff", @"TIF", @"tif", @"GIF", @"gif", @"JPEG", @"jpeg", @"JPG", @"jpg", @"png", nil]; } */ My application needs to open the above listed file types. When I am in Finder and I drag and drop one one of these files to m

Re: Weak link usage? @property?

2008-07-22 Thread Marco Masser
So what's the correct form of weak linking to avoid retain cycles? Please be aware that "weak" has a different meaning depending on the context (GC vs non-GC). Docs: Note: In memory management, a nonretained object reference is known as a weak reference, which is something altogether diff

Two Questions About Parsing a String

2008-07-22 Thread Ian Jackson
Hi, I'm looking for some help parsing a string from a file. Firstly, getting the string is causing some issues. I read the String Programming Guide for Cocoa, and got this: NSString *path = ...; NSData *data = [NSData dataWithContentsOfFile:path]; // assuming data is in UTF8 NSString *strin

Re: File types opened by NSDocument architecture

2008-07-22 Thread Heinrich Giesen
On 22.07.2008, at 09:50, Tom Bernard wrote: /* + (NSArray *)readableTypes { return [NSArray arrayWithObjects:@"TIFF", @"tiff", @"TIF", @"tif", @"GIF", @"gif", @"JPEG", @"jpeg", @"JPG", @"jpg", @"png", nil]; } */ My application needs to open the above listed file types. When I am in Finder

SBApplication error with iTunes 7.7

2008-07-22 Thread Fabian
Hello all, I have an app that interacts with iTunes via Scripting Bridge. After upgrading to iTunes 7.7 I get this error message every time I call [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"]. The message is: 'unknown type name "tdta".' This doesn't seem to effect performan

Re: Being notified of changes to a file

2008-07-22 Thread Yann Disser
Ok, thank you all guys! I got it working somehow ^^ Here is my code (if anyone is interested - I am probably doing a lot of crazy things, please correct me): #import @interface Observer : NSObject {} - (void) outputStuff:(NSNotification*)aNotification; @end @implementation Observer - (void

Re: NSEntityDescription random crash

2008-07-22 Thread Nicolas L.
Thank you - I have tried enabling NSZombie and it seems the object being freed is my managedObjectModel. I really can't figure out why the MOM instance is being deallocated. I don't have a lot of code to post since I'm using the standard Xcode- generated code for non-duc based CoreData apps. (

Re: Two Questions About Parsing a String

2008-07-22 Thread PGM
On 22-Jul-08, at 11:09 AM, Ian Jackson wrote: I'm looking for some help parsing a string from a file. Firstly, getting the string is causing some issues. I read the String Programming Guide for Cocoa, and got this: NSString *path = ...; NSData *data = [NSData dataWithContentsOfFile:path];

Page flip effect using Core Animation?

2008-07-22 Thread Demitri Muna
Hello, I'm beginning to delve into Core Animation, and am trying to implement what (I think) should be a very simple effect. I want to rotate a 50x50 layer around an axis defined by one of the edges which is fixed. The best analogy is looking down on a book and turning a page, the edge of

Re: [NSString stringWithContentsOfURL:...], threads, and 10.5.4, xcode 3.1

2008-07-22 Thread Kyle Sluder
On Mon, Jul 21, 2008 at 5:02 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >NSString* csvString = [NSString stringWithContentsOfURL: lookupURL > encoding: NSUTF8StringEncoding error: &lookupError]; This line right here requires an autorelease pool. Have you created one for your thread?

Re: webDAV (lite) framework?

2008-07-22 Thread Kyle Sluder
On Mon, Jul 21, 2008 at 10:37 AM, William Bates <[EMAIL PROTECTED]> wrote: > Is there an objective-C webDAV framework around? I've been rolling my own (I > only need some basic functionality) but can't image it hasn't been done > already... Does it not make sense for you to rely on Finder's built-

Re: Weak link usage? @property?

2008-07-22 Thread Scott Squires
Yes, I typed in the wrong word. Link instead of reference. My point being: 1. The compiler complains and states that 'assign' is incorrect for non-GC usage (if I don't explicitly state assign). If i do use assign it doesn't complain but because it thinks assign is incorrect I wanted t

Re: webDAV (lite) framework?

2008-07-22 Thread em
>Does it not make sense for you to rely on Finder's built-in WebDAV >support? Absoutely not--that wouldn't make sense if I was looking for an objective-c framework. And by the way, do you always answer a question with another question? Isn't that bizarre? -em ___

Re: webDAV (lite) framework?

2008-07-22 Thread Matt Gough
On 22 Jul 2008, at 4:50pm, em wrote: And by the way, do you always answer a question with another question? Isn't that bizarre? I don't know; is it? (Sorry couldn't resist :) ) Matt ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Re: Two Questions About Parsing a String

2008-07-22 Thread Jens Alfke
On 22 Jul '08, at 2:09 AM, Ian Jackson wrote: NSString *path = ...; NSData *data = [NSData dataWithContentsOfFile:path]; // assuming data is in UTF8 NSString *string = [NSString stringWithUTF8String:[data bytes]]; The reason this doesn't work is that -stringWithUTF8String: expects a NUL-ter

Re: webDAV (lite) framework?

2008-07-22 Thread Jens Alfke
On 22 Jul '08, at 4:55 AM, Kyle Sluder wrote: Does it not make sense for you to rely on Finder's built-in WebDAV support? Because if you can get away with it, it's great... I'm having visions of Dreamweaver's go-it-alone attitude towards WebDAV and how much happier I was when I could stop deal

Re: [NSString stringWithContentsOfURL:...], threads, and 10.5.4, xcode 3.1

2008-07-22 Thread [EMAIL PROTECTED]
At 7:50 AM -0400 7/22/08, Kyle Sluder wrote: On Mon, Jul 21, 2008 at 5:02 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: NSString* csvString = [NSString stringWithContentsOfURL: lookupURL encoding: NSUTF8StringEncoding error: &lookupError]; This line right here requires an autorelea

Garbage Collection Pre-Processor Flag

2008-07-22 Thread Jonathon Mah
Hi all, Are Xcode build settings exposed as pre-processor variables? I know they're available when pre-processing Info.plists, but can't find a way to use them in source code files (.m). I ask because it could be great if you could do something like this: #ifdef OBJC_GC #error This code do

Exception thrown when calling NSConnection connectionWithReceivePort:sendPort:

2008-07-22 Thread Chris Backas
Hello all, This is a little long, the error is summarized at the bottom for anyone who wants to skip ahead though ;) I have an application which is using Distributed Objects to ask a remote machine to obtain and interact with certain resources on its behalf. This has been working great so

Re: how to prevent baseline shift when using NSSuperscriptAttributeName on a NSTextView's NSAttributedString ?

2008-07-22 Thread Ross Carter
The strange thing is that there only seem to be 3 baseline positions supported by NSTextField; any positive value, 0, and any negative value. I assume you've seen this, from http://developer.apple.com/documentation/Cocoa/Conceptual/AttributedStrings/Articles/standardAttributes.html#/ /apple

Re: Newbie CALayer Questions

2008-07-22 Thread Bob Barnes
On Jul 21, 2008, at 9:49 AM, Scott Anguish wrote: On 21-Jul-08, at 10:48 AM, Bob Barnes wrote: I hadn't considered that but I cut and pasted it directly from the documentation. - (void)drawInContext(CGContextRef)ctx { NSLog(@"drawInContext called"); } that should be - (void)drawI

Re: SBApplication error with iTunes 7.7

2008-07-22 Thread Hengist Podd
___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com

Re: Garbage Collection Pre-Processor Flag

2008-07-22 Thread Marcel Weiher
On Jul 22, 2008, at 9:21 , Jonathon Mah wrote: Are Xcode build settings exposed as pre-processor variables? I know they're available when pre-processing Info.plists, but can't find a way to use them in source code files (.m). It's not Xcode build settings, but gcc does have predefined macr

Binding TableColumn Programatically

2008-07-22 Thread kiran Sanka
I am adding a NSTableColumn to a tableview NSTableColumn *aTableColumn = [[NSTableColumn alloc] initWithIdentifier: @"title"]; [tableView addTableColumn:aTableColumn]; and Binding the tableColumn to an array controller (which contains array of Dictionaries) with key path title. [aTableColum

Re: NSTextView overdraw bug in Leopard?

2008-07-22 Thread Gerd Knops
On Jul 21, 2008, at 6:10 PM, Martin Wierschin wrote: Hi everyone, We've had a report or two from users where text will incorrectly draw in an area it's not supposed to. Basically a line fragment (or part of one) from the prior NSTextContainer will draw over text in the current container.

Re: Newbie CALayer Questions

2008-07-22 Thread Bob Barnes
On Jul 21, 2008, at 12:06 PM, David Duncan wrote: On Jul 21, 2008, at 9:49 AM, Scott Anguish wrote: On 21-Jul-08, at 10:48 AM, Bob Barnes wrote: I hadn't considered that but I cut and pasted it directly from the documentation. - (void)drawInContext(CGContextRef)ctx { NSLog(@"drawInCont

Re: webDAV (lite) framework?

2008-07-22 Thread Kyle Sluder
On Tue, Jul 22, 2008 at 10:50 AM, em <[EMAIL PROTECTED]> wrote: >>Does it not make sense for you to rely on Finder's built-in WebDAV >>support? > Absoutely not--that wouldn't make sense if I was looking for an > objective-c framework. The point I was trying to gently make is that if the OP is atte

name and email address parsing

2008-07-22 Thread Wayne Shao
Hi, Does cocoe libraries support regex for common string parsing? I want to parse our the user's name from email address such as "Joe Smith" <[EMAIL PROTECTED]> Joe M. Smith <[EMAIL PROTECTED]> Joe M. Smith (joejoe) <[EMAIL PROTECTED]> joejoe would be nickname here. I n

Re: Binding TableColumn Programatically

2008-07-22 Thread Marco Masser
but in the above added tableColumn data is not populated and an opening brace is shown in each row of that column. To me, this sounds like some data is being read and displayed in the table, but it's not quite what you want. If you do an NSLog(@"%@", someArray), the -description method will

Re: name and email address parsing

2008-07-22 Thread Dave DeLong
The RegexKit Framework[1] adds that functionality you're looking for. Dave [1] http://regexkit.sourceforge.net/ On Tue, Jul 22, 2008 at 11:23 AM, Wayne Shao <[EMAIL PROTECTED]> wrote: > Hi, > > Does cocoe libraries support regex for common string parsing? ___

NSbuttonCell's Bound Title Misbehaving

2008-07-22 Thread Ian was here
I have a table with one column. This column uses NSButtonCells. I have an array controller whose object class is NSMutableDictionary. It uses two keys: "value" and "state". Value is the string that will be used as the title for a button cell. State is the state of the button cell, which is a ch

Re: name and email address parsing

2008-07-22 Thread Kyle Sluder
On Tue, Jul 22, 2008 at 1:23 PM, Wayne Shao <[EMAIL PROTECTED]> wrote: > I want to parse our the user's name from email address such as > "Joe Smith" <[EMAIL PROTECTED]> Do be careful; I'm reasonably sure that it is impossible to express all valid email addresses with a regex. And if it is p

Re: NSbuttonCell's Bound Title Misbehaving

2008-07-22 Thread Quincey Morris
On Jul 22, 2008, at 10:56, Ian was here wrote: I have a table with one column. This column uses NSButtonCells. I have an array controller whose object class is NSMutableDictionary. It uses two keys: "value" and "state". Value is the string that will be used as the title for a button cell. S

GetDblTime, 64-bit, and cocoa

2008-07-22 Thread [EMAIL PROTECTED]
i need to set a timer when i get a first mouse click and perform something if i don't get another click within the double click time. i found this old thread (from 2003) in the archives: http://www.cocoabuilder.com/archive/message/cocoa/2003/10/22/90328 from that thread, it would appear that the

Re: Avoiding mutual retain cycles

2008-07-22 Thread Philippe Mougin
Le 22 juil. 08 à 06:21, Marcel Weiher a écrit : On Jul 21, 2008, at 13:03 , Philippe Mougin wrote: Le 21 juil. 08 à 20:50, Markus Spoettl a écrit : I'm wondering if there is a general rule or mechanism that suggests what to do in such a case. For instance, how are delegates implemented i

NSPredicateEditorRowTemplate and ANY predicate

2008-07-22 Thread Frédéric Testuz
Hello, Is it possible to prepare a row template for a NSPredicateEditor in IB for a predicate like "ANY keyPath == 'aValue'" ? Otherwise I found this : If I can't do it in IB, I think it will be the simplest solution : - (N

Help with "Messages without a matching method signature..." issue

2008-07-22 Thread Brad Gibbs
I read the Newbie Question on a method signature thread from June 4 a few times, but, either that isn't the problem I'm having, or I'm not understanding the solution... Any help would be greatly appreciated. On compile, I get the following warnings: warning: 'Class2' may not respond to '+s

Re: Help with "Messages without a matching method signature..." issue

2008-07-22 Thread Steve Bird
On Jul 22, 2008, at 3:28 PM, Brad Gibbs wrote: Below is the offending code: Class 1 - This class provides IBActions, each of which calls the sendMSG: toPort: method of Class 2. The arguments for the methods in this class are used to construct NSStrings in Class 2. Class 2 - The argument

Re: NSbuttonCell's Bound Title Misbehaving

2008-07-22 Thread Ian was here
Changing the model key path from "value" to "state" in the column's value binding solved the problem. Thanks. --- On Tue, 7/22/08, Quincey Morris <[EMAIL PROTECTED]> wrote: > From: Quincey Morris <[EMAIL PROTECTED]> > Subject: Re: NSbuttonCell's Bound Title Misbehaving > To: cocoa-dev@lists.a

error building against sdk 10.5

2008-07-22 Thread g biss
Hello List, In Xcode 3.1, I create a new cocoa project and build. When the default menu item "Project->Set Active SDK->Mac OS 10.5 (Project Settings)" is selected, I get this build error: / Developer/SDKs/MacOSX10.5.sdk/System/Libary/Fram

Re: Help with "Messages without a matching method signature..." issue

2008-07-22 Thread Charles Steinman
-sendMSG:toPort: is an instance method, which should be sent to an object. You are sending it to Class2, which is a class rather than an instance of that class. Cheers, Chuck --- On Tue, 7/22/08, Brad Gibbs <[EMAIL PROTECTED]> wrote: > From: Brad Gibbs <[EMAIL PROTECTED]> > Subject: Help with

Re: Help with "Messages without a matching method signature..." issue

2008-07-22 Thread Brad Gibbs
It's in the file, it's just that the warning message pushed the brace down and out of my select -> copy -> paste to e-mail. Sorry for the confusion. On Jul 22, 2008, at 12:35 PM, Steve Bird wrote: On Jul 22, 2008, at 3:28 PM, Brad Gibbs wrote: Below is the offending code: Class 1

Re: Help with "Messages without a matching method signature..." issue

2008-07-22 Thread Brad Gibbs
That was it Feeling foolish, but grateful. Thanks. On Jul 22, 2008, at 12:41 PM, Charles Steinman wrote: -sendMSG:toPort: is an instance method, which should be sent to an object. You are sending it to Class2, which is a class rather than an instance of that class. Cheers, Chuck

Re: error building against sdk 10.5

2008-07-22 Thread Nick Zitzmann
On Jul 22, 2008, at 1:40 PM, g biss wrote: Developer/SDKs/MacOSX10.5.sdk/System/Libary/Frameworks/ DictionaryServices.framework/Headers/DictionaryServices.h:83: error: syntax error before 'CTFontRef' How did DictionaryServices get moved there? It's supposed to be inside the CoreServices

Re: Two Questions About Parsing a String

2008-07-22 Thread Ian Jackson
Thanks for your responses. Looks like stringWithContentsOfFile:encoding:error: does what I need. Jens, at least I know not to pursue the NSScanner thing any further in this case. Thanks, Ian. On 23/07/2008, at 3:39 AM, Jens Alfke wrote: On 22 Jul '08, at 2:09 AM, Ian Jackson wrote:

Re: error building against sdk 10.5

2008-07-22 Thread g biss
On Jul 22, 2008, at 12:49 PM, Nick Zitzmann wrote: On Jul 22, 2008, at 1:40 PM, g biss wrote: Developer/SDKs/MacOSX10.5.sdk/System/Libary/Frameworks/ DictionaryServices.framework/Headers/DictionaryServices.h:83: error: syntax error before 'CTFontRef' How did DictionaryServices get moved

Re: NSTextView overdraw bug in Leopard?

2008-07-22 Thread Martin Wierschin
Hi Gerd, I have seen something vaguely similar that may or may not be related: I implemented drop caps by having a NSTextContainer subclass counting lines and modifying the lineFragmentRect (see below). After migrating to Leopard that would occasionally fail ... - (NSRect)lineFragmentRectF

Re: NSPredicateEditorRowTemplate and ANY predicate

2008-07-22 Thread Peter Ammon
On Jul 22, 2008, at 12:05 PM, Frédéric Testuz wrote: Hello, Is it possible to prepare a row template for a NSPredicateEditor in IB for a predicate like "ANY keyPath == 'aValue'" ? I'm not sure I understand your question. How is this different than just a normal OR type compound predic

Re: error building against sdk 10.5

2008-07-22 Thread Nick Zitzmann
On Jul 22, 2008, at 2:12 PM, g biss wrote: This I don't know. The installer put it there? Not on my system, it didn't. DictionaryServices is supposed to be part of the CoreServices framework. Nick Zitzmann ___ Co

Re: error building against sdk 10.5

2008-07-22 Thread Tony Becker
I'm going to make some assumptions here... This is a project that "works" under 10.4 and has compile errors when the SDK is "switched" to 10.5 Go into your "Targets" and select your application, or the first dependancy of your target that doesn't build Double click on the target to get the

Re: NSTextView overdraw bug in Leopard?

2008-07-22 Thread Gerd Knops
On Jul 22, 2008, at 3:13 PM, Martin Wierschin wrote: Hi Gerd, [..] In your case I would worry about the call sequence when line fragments are calculated. There's no guarantee that each fragment will only be swept out once and in an order sorted by vertical position. Especially if you h

Core Data and unsigned integer types, why are there none?

2008-07-22 Thread Sean McBride
Hi all, Core Data provides several built-in types like string, date, etc. It also has "integer 16", "integer 32", and "integer 64", all of which are signed. I'm curious why there are no unsigned versions. I assume there is some reason. How do the rest of you deal with this? If you need to mod

Re: Duplicate rows appearing in outlineview after creating new Entity in moc, why?

2008-07-22 Thread Sean McBride
On 7/17/08 3:58 PM, Jonathan Dann said: >Yeah come to think of it I saw this behaviour when adopting the >mediator pattern in my app. In the NSPersistentDoc tutorial you can >create a Dept. object just using NSObjectController, then bind your >array contorller's contentSet binding to the object c

NSTask

2008-07-22 Thread Torsten Curdt
When I do [NSThread detachNewThreadSelector:@selector(something) toTarget:self withObject:nil]; How can I get access to the NSThread object?? I would have expected detachNewThreadSelector to return a NSTask object. cheers -- Torsten __

Re: Core Data and unsigned integer types, why are there none?

2008-07-22 Thread Brett Powley
On 23/07/2008, at 6:41 AM, Sean McBride wrote: Core Data provides several built-in types like string, date, etc. It also has "integer 16", "integer 32", and "integer 64", all of which are signed. I'm curious why there are no unsigned versions. I assume there is some reason. If I were

Re: NSTask

2008-07-22 Thread Nick Zitzmann
On Jul 22, 2008, at 3:31 PM, Torsten Curdt wrote: When I do [NSThread detachNewThreadSelector:@selector(something) toTarget:self withObject:nil]; How can I get access to the NSThread object?? What are you trying to accomplish? I woul

Re: NSTask

2008-07-22 Thread Michael Watson
Why would you expect to get a pointer to an object that executes shell tasks? Threads aren't shell calls. What are you trying to do with this other thread? -- m-s On 22 Jul, 2008, at 17:31, Torsten Curdt wrote: When I do [NSThread detachNewThreadSelector:@selector(something)

Re: NSTask

2008-07-22 Thread Torsten Curdt
On Jul 22, 2008, at 23:35, Nick Zitzmann wrote: On Jul 22, 2008, at 3:31 PM, Torsten Curdt wrote: When I do [NSThread detachNewThreadSelector:@selector(something) toTarget:self withObject:nil]; How can I get access to the NSThread objec

NSThread (was Re: NSTask)

2008-07-22 Thread Torsten Curdt
Bah ...sorry for the NSTask/NSThread mix up. Obviously too tired. cheers -- Torsten On Jul 22, 2008, at 23:35, Nick Zitzmann wrote: On Jul 22, 2008, at 3:31 PM, Torsten Curdt wrote: When I do [NSThread detachNewThreadSelector:@selector(something) toTarget:self

Re: how to prevent baseline shift when using NSSuperscriptAttributeName on a NSTextView's NSAttributedString ?

2008-07-22 Thread Rua Haszard Morris
I need to support arbitrary superscript, not just squared... I should be clear: - I initially only set superscript attribute for the characters that are superscript, i.e. part of a larger string. - When this attributed string was given to an NSTextField (static non editable), the textfield

Problem on clearing points and paths on a NSView

2008-07-22 Thread JArod Wen
Hi, I met a problem on clearing points and paths on a customized NSView. I set four NSBezierPath for drawing: pathForPositionMeasure, pathForDistanceMeasure, pathForAngleMeasure and selectedPath, and used the following code for clearing: [pathForPositionMeasure removeAllPo

CA: Are nested 3D transforms supported?

2008-07-22 Thread Jens Alfke
I'm trying to add a perspective view to GeekGameBoard, my board-game framework. I apply a rotation about the X axis, concatenated with a perspective transform, to the NSView's root layer; this tilts the board "away from" the screen, giving a more normal viewing angle. So far so good. The

Re: NSTask

2008-07-22 Thread Randall Meadows
On Jul 22, 2008, at 3:49 PM, Torsten Curdt wrote: On Jul 22, 2008, at 23:35, Nick Zitzmann wrote: On Jul 22, 2008, at 3:31 PM, Torsten Curdt wrote: I was looking into the cancelation of the thread. (isCanceled/cancel since 10.5) And just noticed that I don't have the reference to the NSThre

Re: NSTask

2008-07-22 Thread David Duncan
On Jul 22, 2008, at 2:49 PM, Torsten Curdt wrote: I was looking into the cancelation of the thread. (isCanceled/cancel since 10.5) And just noticed that I don't have the reference to the NSThread - at least not when using detachNewThreadSelector. And then I was wondering how you would get a

Re: Basic question on /Library/Application Support

2008-07-22 Thread Kiel Gillard
Hi John, If you use Carbon, you can use FSFindFolder() to find the application support folder and have Carbon create it for you by passing kCreateFolder as an argument. However, if you are using Cocoa, I'm not sure if NSSearchPathForDirectoriesInDomains() creates folders when you search for a path

Re: Exception thrown when calling NSConnection connectionWithReceivePort:sendPort:

2008-07-22 Thread Ken Thomases
On Jul 22, 2008, at 10:46 AM, Chris Backas wrote: So... the problem is that when I try to reconnect to DO, meaning, call getServerProxy the second time, I get an exception from the DOConnection = [[NSConnection connectionWithReceivePort:nil sendPort:DOConnectionSocket] retain]; line. The

Re: PropertyList -> NSBrowser / NSOutlineView?

2008-07-22 Thread Ken Thomases
On Jul 22, 2008, at 6:09 PM, Joeles Baker wrote: Any other hints for a really basic NSBrowser or NSOutlineView sample (not /Developer/Examples/AppKit/OutlineView) ? I can't personally vouch for these, but a full-text search of all doc sets yields: http://developer.apple.com/samplecode/Sou

Re: Binding TableColumn Programatically

2008-07-22 Thread Ron Lue-Sang
On Jul 22, 2008, at 1:08 PM, kiran Sanka wrote: I am adding a NSTableColumn to a tableview NSTableColumn *aTableColumn = [[NSTableColumn alloc] initWithIdentifier: @"title"]; [tableView addTableColumn:aTableColumn]; and Binding the tableColumn to an array controller (which contains array o

Re: how to prevent baseline shift when using NSSuperscriptAttributeName on a NSTextView's NSAttributedString ?

2008-07-22 Thread Martin Wierschin
Personally, I don't think NSSuperscriptAttributeName is particularly useful. I just adjust the baseline and font size: newFontSize = oldFontSize * 0.75, baseline for superscript += 0.4 * oldFontSize, baseline for subscript -= 0.3 * oldFontSize. I do something very similar, but instead of u

Re: error building against sdk 10.5

2008-07-22 Thread g biss
On Jul 22, 2008, at 1:29 PM, Tony Becker wrote: I'm going to make some assumptions here... This is a project that "works" under 10.4 and has compile errors when the SDK is "switched" to 10.5 Thanks Tony, These are 10.5 projects that don't work under 10.5, where the compile errors go awa

Re: Avoiding mutual retain cycles

2008-07-22 Thread Marcel Weiher
On Jul 22, 2008, at 11:52 , Philippe Mougin wrote: Le 22 juil. 08 à 06:21, Marcel Weiher a écrit : http://portal.acm.org/citation.cfm?id=1035292.1028982 There are also interesting bits in their conclusion: "This explains why highly optimized tracing and reference counting collectors have

Re: Problem on clearing points and paths on a NSView

2008-07-22 Thread Graham Cox
Well, do you actually erase them? The drawRect: method usually starts with something that paints the background colour - if you don't do that then any pixels previously drawn are not cleared. e.g.: - (void) drawRect:(NSRect) rect { [[NSColor whiteColor] set]; NSRectFill( r

Re: Basic question on /Library/Application Support

2008-07-22 Thread Jens Alfke
On 22 Jul '08, at 3:53 PM, Kiel Gillard wrote: If you use Carbon, you can use FSFindFolder() to find the application support folder and have Carbon create it for you by passing kCreateFolder as an argument. FSFindFolder works fine in Cocoa apps too. (That's what NSSearchPathForDirectorie

Re: Problem on clearing points and paths on a NSView

2008-07-22 Thread Jens Alfke
On 22 Jul '08, at 3:03 PM, JArod Wen wrote: I met a problem on clearing points and paths on a customized NSView. I set four NSBezierPath for drawing: pathForPositionMeasure, pathForDistanceMeasure, pathForAngleMeasure and selectedPath, and used the following code for clearing: And the dr

A quick one: Passing a reference/pointer to NSString

2008-07-22 Thread Jeff Brown
Hi Guys What do I need to do in the following code to get theString to take the value I'm giving it in foo i.e. "Hi there"? - (void) aMethod { NSString* theString = @""; [self foo:theString]; } - (NSString*) foo:(NSString*)aString { NSString* stringB = @"Hi there"; aString = str

Re: A quick one: Passing a reference/pointer to NSString

2008-07-22 Thread Graham Cox
NSString is not mutable, so once created, you can't change its contents. You can reassign the pointer to another string, as you are doing - though without knowing your intentions it doesn't really look right (and could cause a memory leak). Your 'foo' method is prototyped to return a string

Re: A quick one: Passing a reference/pointer to NSString

2008-07-22 Thread Jeff Brown
Sorry - it should have been: - (void) aMethod { NSString* string1 = @""; NSString* string2 = @""; string1 = [self foo:string2]; } - (NSString*) foo:(NSString*)aString { NSString* stringA = @"Hi there"; NSString* stringB = @"Everyone"; aString = stringB; return stringA; }

Re: A quick one: Passing a reference/pointer to NSString

2008-07-22 Thread Ken Thomases
On Jul 22, 2008, at 8:33 PM, Jeff Brown wrote: What do I need to do in the following code to get theString to take the value I'm giving it in foo i.e. "Hi there"? - (void) aMethod { NSString* theString = @""; [self foo:theString]; } - (NSString*) foo:(NSString*)aString { NSString* s

Re: PropertyList -> NSBrowser / NSOutlineView?

2008-07-22 Thread Joel Norvell
Joeles, The NIBs and Xcode project files seem to be absent, but you can still see the source code for "OutlineMe" in Google Code Search. Go to: http://google.com/codesearch And enter: OutlineMe lang:objectivec HTH, Joel ___ Cocoa-

Re: A quick one: Passing a reference/pointer to NSString

2008-07-22 Thread Graham Cox
On 23 Jul 2008, at 11:49 am, Jeff Brown wrote: Sorry - it should have been: - (void) aMethod { NSString* string1 = @""; NSString* string2 = @""; string1 = [self foo:string2]; } - (NSString*) foo:(NSString*)aString { NSString* stringA = @"Hi there"; NSString* stringB = @"Everyone";

Re: A quick one: Passing a reference/pointer to NSString

2008-07-22 Thread Ken Thomases
On Jul 22, 2008, at 8:49 PM, Jeff Brown wrote: Sorry - it should have been: - (void) aMethod { NSString* string1 = @""; NSString* string2 = @""; string1 = [self foo:string2]; } - (NSString*) foo:(NSString*)aString { NSString* stringA = @"Hi there"; NSString* stringB = @"Everyone";

Re: A quick one: Passing a reference/pointer to NSString

2008-07-22 Thread Ken Thomases
On Jul 22, 2008, at 9:07 PM, Graham Cox wrote: - (void) leakLikeABastard:(NSString**) aString { *aString = @"new string"; } There's nothing about returning an object pointer by reference that's inherently prone to leaking. The more likely problem is in the caller of such a method. If

Re: A quick one: Passing a reference/pointer to NSString

2008-07-22 Thread Ken Thomases
On Jul 22, 2008, at 9:14 PM, Ken Thomases wrote: Alternatives to consider: *) Have the method return an NSArray* containing the strings *) Have the method return a struct which has two NSString* fields *) Have a method such as: - (void) getGreeting:(NSString**)greeting andAdressee: (NSString*

Re: A quick one: Passing a reference/pointer to NSString

2008-07-22 Thread Graham Cox
I know, the problem lies with the caller. But this approach is bad form in my view, and does require that you take more care to avoid leaks. Graham On 23 Jul 2008, at 12:19 pm, Ken Thomases wrote: There's nothing about returning an object pointer by reference that's inherently prone to l

Re: A quick one: Passing a reference/pointer to NSString

2008-07-22 Thread Jeff Brown
Thanks guys for all the advice. Much appreciated. Jeff Start at the new Yahoo!7 for a better online experience. www.yahoo7.com.au ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

Re: CA: Are nested 3D transforms supported?

2008-07-22 Thread John Harper
On Jul 22, 2008, at 3:07 PM, Jens Alfke wrote: When I implement this, I get the wrong results. It looks like the pieces do get rotated, but then they're projected flat onto the board layer, so when the board tilts back it's clear that it's still flat but with distorted pieces drawn on it.

Re: Problem on clearing points and paths on a NSView

2008-07-22 Thread Jens Alfke
On 22 Jul '08, at 6:45 PM, JArod Wen wrote: Now I am considering the possible memory leakage in renderPath, since each time the path will be initialized and the previous one will cause memory leakage, which may be also the reason why I cannot get rid of them from the view. But if so, how a

Re: Problem on clearing points and paths on a NSView

2008-07-22 Thread JArod Wen
Thanks for your reply! drawRect: -(void)drawRect:(NSRect)rect { [self renderCurrentFrame]; } and renderCurrentFrame: - (void)renderCurrentFrame { if(isMeasured) switch (measureMethod) { case 0: [self rende

NSConnection Issue

2008-07-22 Thread Patrick Walker
I was wondering if anyone had any solutions to determine whether or not an NSConnection via NSSocketPorts are still valid without each end polling to see if it still connects? Right now, if the client tries to access the rootObject it hangs. While this may may only happen occasionally, I

Core Audio Memory Leak

2008-07-22 Thread Jiva DeVoe
This code: UInt32 maxPacketSize; size = sizeof(maxPacketSize);<--- LEAKS HERE AudioFileGetProperty(myInfo.mAudioFile, kAudioFilePropertyPacketSizeUpperBound, &size, &maxPacketSize); According to instruments, leaks where I pointed it out above. I cut this code almost directl

Re: NSConnection Issue

2008-07-22 Thread Adam R. Maxwell
On Jul 22, 2008, at 9:54 PM, Patrick Walker wrote: I was wondering if anyone had any solutions to determine whether or not an NSConnection via NSSocketPorts are still valid without each end polling to see if it still connects? Right now, if the client tries to access the rootObject it han

Returning exactly what has been promised

2008-07-22 Thread Steve Cronin
Folks; I find if I have a method which returns an NSString for example, that often, in the interior of that method I will use an NSMutableString to construct the string I intend to return. My question concerns the actual final return statement. Is there ANY reason to choose A over B? A

Re: Returning exactly what has been promised

2008-07-22 Thread Damien Cooke
You could return like this return [myWorkingMutableString copy]; This makes a immutable copy returning an NSString. Regards Damien On 23/07/2008, at 2:24 PM, Steve Cronin wrote: Folks; I find if I have a method which returns an NSString for example, that often, in the interior of that met

Re: Returning exactly what has been promised

2008-07-22 Thread Graham Cox
On 23 Jul 2008, at 3:38 pm, Damien Cooke wrote: You could return like this return [myWorkingMutableString copy]; This makes a immutable copy returning an NSString. Yes, but it also is leaking the returned string, because you have returned a retained object. You should autorelease the str

Re: Problem on clearing points and paths on a NSView

2008-07-22 Thread Quincey Morris
On Jul 22, 2008, at 18:45, JArod Wen wrote: drawRect: -(void)drawRect:(NSRect)rect { [self renderCurrentFrame]; } As both Graham and Jens said, drawRect has to draw *everything* in 'rect', including the background fill (which effectively erases what you drew the last time through)

Re: NSConnection Issue

2008-07-22 Thread Ken Thomases
On Jul 23, 2008, at 12:07 AM, Adam R. Maxwell wrote: On Jul 22, 2008, at 9:54 PM, Patrick Walker wrote: I was wondering if anyone had any solutions to determine whether or not an NSConnection via NSSocketPorts are still valid without each end polling to see if it still connects? Right now,

Re: Problem on clearing points and paths on a NSView

2008-07-22 Thread Ken Ferry
On Tue, Jul 22, 2008 at 9:06 PM, Jens Alfke <[EMAIL PROTECTED]> wrote: > > As Graham pointed out, the reason your shapes don't get erased is that you > don't erase them. Your -drawRect method needs to begin by clearing the > passed-in NSRect to the background color, otherwise you may be leaving > b

Re: Returning exactly what has been promised

2008-07-22 Thread Ken Thomases
On Jul 22, 2008, at 11:54 PM, Steve Cronin wrote: I find if I have a method which returns an NSString for example, that often, in the interior of that method I will use an NSMutableString to construct the string I intend to return. My question concerns the actual final return statement.

Re: Returning exactly what has been promised

2008-07-22 Thread Quincey Morris
On Jul 22, 2008, at 21:54, Steve Cronin wrote: I find if I have a method which returns an NSString for example, that often, in the interior of that method I will use an NSMutableString to construct the string I intend to return. My question concerns the actual final return statement. Is

Re: Returning exactly what has been promised

2008-07-22 Thread Bill Bumgarner
On Jul 22, 2008, at 9:54 PM, Steve Cronin wrote: I find if I have a method which returns an NSString for example, that often, in the interior of that method I will use an NSMutableString to construct the string I intend to return. My question concerns the actual final return statement. I

  1   2   >