Re: UIBezierPath: trying to create an array with CGPointMake

2010-12-20 Thread Graham Cox
On 20/12/2010, at 6:20 PM, colo wrote: > Right now I am getting an error of > error: void value not ignored as it ought to be > - (IBAction)resetControlPoints:(id)sender > { > return path; I've deleted all the stuff that's OK. The reason for the error should now be obvious. --Graham ___

Re: File name issue with German umlauts

2010-12-20 Thread Ulf Dunkel
Hi Uli. On 17.12.2010 09:59, Uli Kusterer wrote: Another guess is that the folder he's having an issue with maybe was created by such a wrong way and hence didn't get its name properly normalized ... might be worth trying to re-type the file name in Finder to make sure it's correct? The ap

Re: Core Data mergeChangesFromContextDidSaveNotification: does not *completely* update the context ?

2010-12-20 Thread Aurélien Hugelé
BTW, the main thread sent notification (when main thread moc is saved) does not contain the NSRefreshedObjects key. This would probably be a solution to my problem, but mergeChangesFromContextDidSaveNotification: either does not refresh objects (strange) or their is something wrong since objects

Modal loop memory leak on 10.6

2010-12-20 Thread Jo Meder
Hi, On 10.6.5 I'm seeing a runaway memory leak in my app when I show a modal dialog. I'm not seeing the leak in the same situation on 10.5. The modal loop is run using [NSApplication runModalSession:]. Using Instruments to look at allocations I'm seeing that many instances of CFArray, NSConcre

Cocoa view gets sluggish over time

2010-12-20 Thread Artemiy Pavlov
Hi all! I have a Cocoa view that reacts to -mouseDown and -mouseDragged events and then draws something via -drawRect method. It has about 50 objects that are either NSBezierCurve or NSTextField. The problem is, after a few seconds of mouse dragging, the view becomes very sluggish. I rele

Re: Cocoa view gets sluggish over time

2010-12-20 Thread Richard Somers
Two suggestions. One, you can verify that you are not leaking using one of the tools provided, Instruments or MallocDebug. Two, I think you need to provide code examples for list members to provide constructive comments. --Richard Somers On Dec 20, 2010, at 6:31 AM, Artemiy Pavlov wrote:

Re: Cocoa view gets sluggish over time

2010-12-20 Thread Mike Abdullah
Use Instruments to find out where the slowness lies. Come back once you'e got more information and still don't know the cause. On 20 Dec 2010, at 13:31, Artemiy Pavlov wrote: > Hi all! > > I have a Cocoa view that reacts to -mouseDown and -mouseDragged events and > then draws something via -dr

Re: Cocoa view gets sluggish over time

2010-12-20 Thread Artemiy Pavlov
Richard, here is the code I am using, here x, y, i are variables that define the label position and text. If I comment this snippet, my view is working well. So I am sure that there is something in these lines that needs to be done properly, which I don't know ;-) NSTextField *PatternSt

Re: Cocoa view gets sluggish over time

2010-12-20 Thread Artemiy Pavlov
I have run Instruments and I see a ton of these calls: -[NSWindow fieldEditor:forObject:] So I indeed see that there's something I am not doing right with the NSTextField. On 20 Dec 2010, at 16:09, Mike Abdullah wrote: Use Instruments to find out where the slowness lies. Come back once yo

NSTextField: text appears aliased

2010-12-20 Thread Artemiy Pavlov
Hi all! I have a few text labels I created using NSTextField. However, all of them appear very aliased, as shown in the attached screenshot. Can anyone suggest me how I can fix this and turn on antialiasing for the text? Thanks and best wishes, Artemiy. <>

Re: NSTextField: text appears aliased

2010-12-20 Thread Jerry Krinock
On 2010 Dec 20, at 06:30, Artemiy Pavlov wrote: > I have a few text labels I created using NSTextField. However, all of them > appear very aliased, as shown in the attached screenshot. Can anyone suggest > me how I can fix this and turn on antialiasing for the text? I've seen this happen when

Re: Cocoa view gets sluggish over time

2010-12-20 Thread Artemiy Pavlov
I think I know what's the problem, it's this line. [self addSubview:PatternRateLabel]; With each -drawRect call, NSTextField objects are not being redrawn from scratch, they are added on top of the existing ones. So I end up with thousands of them. I guess I need to put this code in -awake

Re: NSTextField: text appears aliased

2010-12-20 Thread Artemiy Pavlov
On 2010 Dec 20, at 06:30, Artemiy Pavlov wrote: I have a few text labels I created using NSTextField. However, all of them appear very aliased, as shown in the attached screenshot. Can anyone suggest me how I can fix this and turn on antialiasing for the text? I've seen this happen when

Re: Cocoa view gets sluggish over time (solved!)

2010-12-20 Thread Artemiy Pavlov
I guess I need to put this code in -awakeFromNib. And then, if needed, change the text field strings or properties in -drawRect. Yes, that did the trick! I now set up these labels in -awakeFromNib and the view is working well now. Glad I was able to figure it out. Artemiy. __

Re: NSTextField: text appears aliased

2010-12-20 Thread Siegfried
On 20/12/2010, at 12:30, Artemiy Pavlov wrote: > Hi all! > > I have a few text labels I created using NSTextField. However, all of them > appear very aliased, as shown in the attached screenshot. Can anyone suggest > me how I can fix this and turn on antialiasing for the text? > Sincerely, t

Re: NSTextField: text appears aliased

2010-12-20 Thread Artemiy Pavlov
Hi all, thanks a lot for the replies! No I do not use anything special there. Just a black NSRect with NSTextFields on top of them. I think I could solve this by using a shadow under the text, however, I don't know how to do this. The normal shadow mechanism as I use for NSBezierCurve doe

access multiple NSTextFields as an array?

2010-12-20 Thread Artemiy Pavlov
Hi all! I have a row of number labels that I create like so: for(i=1;i<=16;i++){ NSTextField *NumberLabel = [[NSTextField alloc] initWithFrame:NSMakeRect(...)]; [NumberLabel setStringValue:[NSString stringWithFormat:@"%d", i]]; [self addSubview:PatternStepLabel];

Re: NSTextField: text appears aliased

2010-12-20 Thread Artemiy Pavlov
You guys are right, all is actually well, it might have been that Helvetica isn't the prettiest font to use in this color scheme. I changed it to Lucida Grande and it's looking properly sleek now :-) <>___ Cocoa-dev mailing list (Cocoa-dev@lists.ap

Re: access multiple NSTextFields as an array?

2010-12-20 Thread Eric E. Dolecki
Use .tag and set it to i. Google Voice: (508) 656-0622 Twitter: eric_dolecki XBoxLive: edolecki PSN: eric_dolecki http://blog.ericd.net On Mon, Dec 20, 2010 at 10:38 AM, Artemiy Pavlov wrote: > Hi all! > > I have a row of number labels that I create like so: > > for(i=1;i<=16;

Re: access multiple NSTextFields as an array?

2010-12-20 Thread Roland King
if those are the only views you can use [ self subviews ] to get an array of them in the order they are currently stacked. On 20-Dec-2010, at 11:38 PM, Artemiy Pavlov wrote: > Hi all! > > I have a row of number labels that I create like so: > > for(i=1;i<=16;i++){ >NSTextField *NumberLab

Re: access multiple NSTextFields as an array?

2010-12-20 Thread Siegfried
On 20/12/2010, at 13:38, Artemiy Pavlov wrote: > Now, I'd like to be able to access each one of these NSTextField objects to > change their color. My question is, right in this loop, can I create some > sort of an array of pointers to these objects? Just create a NSMutableArray before the loop

Re: UIBezierPath: trying to create an array with CGPointMake

2010-12-20 Thread Fritz Anderson
On 20 Dec 2010, at 1:20 AM, colo wrote: > I'm in the processing of trying to create an array of Path points to > draw a UIBezierPath CGRectMake onto each control point. > > Right now I am getting an error of > error: void value not ignored as it ought to be … > - (IBAction)resetControlPoints:(id)

Re: access multiple NSTextFields as an array?

2010-12-20 Thread Artemiy Pavlov
Just create a NSMutableArray before the loop: NSMutableArray *array = [NSMutableArray arrayWithCapacity:16]; And then add each field to the array right in the loop for (…) { … [array addObject:textField]; } Great, thanks a lot! Can I then access each element via array[0], array[1] etc.

Re: Modal loop memory leak on 10.6

2010-12-20 Thread Fritz Anderson
On 20 Dec 2010, at 4:04 AM, Jo Meder wrote: > It looks like it's something to do with updating windows. It just keeps > allocating these objects until after a fairly short time it crashes when it > runs out of address space. It's growing in 20 MB steps as you watch it. > > I have a smaller test

Re: access multiple NSTextFields as an array?

2010-12-20 Thread Siegfried
On 20/12/2010, at 14:01, Artemiy Pavlov wrote: >> Just create a NSMutableArray before the loop: >> >> NSMutableArray *array = [NSMutableArray arrayWithCapacity:16]; >> >> And then add each field to the array right in the loop >> >> for (…) { >> … >> [array addObject:textField]; >> } > > Gr

Re: access multiple NSTextFields as an array?

2010-12-20 Thread aglee
On Dec 20, 2010, at 11:11 AM, Siegfried wrote: Check documentation for NSArray and NSMutableArray for more info, it's your friend! :-) And an easy way to do this is by Option-Command-double-clicking on "NSArray" and "NSMutableArray" in your code. Note that NSMutableArray inherits from NSArra

Re: access multiple NSTextFields as an array?

2010-12-20 Thread Artemiy Pavlov
Can I then access each element via array[0], array[1] etc.? I.e. will [array[0] setColor:...] work? No! This is not a C array, it's an object. Use -objectAtIndex instead I.e. [[array objectAtIndex:0] setColor:…] Check documentation for NSArray and NSMutableArray for more info, it's your

Re: UIBezierPath: trying to create an array with CGPointMake

2010-12-20 Thread colo
> Look at the documentation for -[UIBezierPath moveToPoint:]. The method > returns void, but you're trying to assign the (nonexistent) result to members > of the points[] array. You ought to be ignoring the void value, and aren't, > just as the error message says. > > You're returning path immed

Re: access multiple NSTextFields as an array?

2010-12-20 Thread Artemiy Pavlov
My apologies, the full code is this: int x; NSMutableArray *Array = [NSMutableArray arrayWithCapacity:9]; for(x=1;x<=9;x++){ NSTextField *PatternRateLabel = etc. etc. [Array addObject:PatternRateLabel]; } [[Array objectAtIndex:0] setColor:...]; __

Re: access multiple NSTextFields as an array?

2010-12-20 Thread Fritz Anderson
On 20 Dec 2010, at 10:16 AM, Artemiy Pavlov wrote: > int x; > NSMutableArray *Array; > > for(x=1;x<=9;x++){ >NSTextField *PatternRateLabel = etc. etc. >[Array addObject:PatternRateLabel]; > } > > [[Array objectAtIndex:0] setColor:...] > > However, if I have this last line, my view freez

Re: access multiple NSTextFields as an array?

2010-12-20 Thread Scott Ribe
On Dec 20, 2010, at 9:16 AM, Artemiy Pavlov wrote: > Yes, I did this after sending this e-mail :-) Weird though, that it doesn't > work straight away... Here is my code: You're not creating the array. Anyway, there's no need for an NSMutableArray. You can just have a plain C array as an attrib

Re: Cocoa view gets sluggish over time

2010-12-20 Thread aglee
On Dec 20, 2010, at 09:13 AM, Artemiy Pavlov wrote: NSTextField *PatternStepLabel = [[NSTextField alloc] initWithFrame:NSMakeRect(x, y, 20, 20)]; NSString *PatternStepLabelString = [NSString stringWithFormat:@"%d", i]; [PatternStepLabel setEditable:NO]; [PatternStepLabel setDrawsBackground:N

Re: access multiple NSTextFields as an array?

2010-12-20 Thread Siegfried
On 20/12/2010, at 14:23, Artemiy Pavlov wrote: > My apologies, the full code is this: > > int x; > NSMutableArray *Array = [NSMutableArray arrayWithCapacity:9]; > > for(x=1;x<=9;x++){ > NSTextField *PatternRateLabel = etc. etc. > [Array addObject:PatternRateLabel]; > } > This line: > [[A

Re: access multiple NSTextFields as an array?

2010-12-20 Thread Artemiy Pavlov
[[Array objectAtIndex:0] setColor:...]; Maybe you want to use -setTextColor ? ___ Yes, sorry, I have setTextColor actually. Still, it doesn't work... ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.co

Re: access multiple NSTextFields as an array?

2010-12-20 Thread Siegfried
On 20/12/2010, at 14:39, Artemiy Pavlov wrote: > Thanks for the help, Siegfried! > > My actualy code is here: > > NSMutableArray *Array; > > -(void)awakeFromNib{ > >int x; >Array = [NSMutableArray array]; > >for(x=1;x<=9;x++){ >NSTextField *PatternRateLabel = etc. etc. >

Re: access multiple NSTextFields as an array?

2010-12-20 Thread aglee
On Dec 20, 2010, at 11:42 AM, Artemiy Pavlov wrote: Yes, sorry, I have setTextColor actually. Still, it doesn't work..   I suggest pasting your exact code into email.  Don't abbreviate and don't type it by hand. --Andy ___ Cocoa-dev mailing list (C

Re: NSTextField: text appears aliased

2010-12-20 Thread John Pannell
Hi Artemiy- Couldn't tell from the screenshot, but it appears that the text might be small... if so, there is a preference to turn off text smoothing for fonts of a certain size or smaller (System Preferences > Appearance - down at the bottom of the pane). Another possibility: are you using la

Re: access multiple NSTextFields as an array?

2010-12-20 Thread Artemiy Pavlov
1.If you want to use the array somewhere else calling -retain on it may be a good idea Oh yes!!! This did the trick! Thanks so much for the help, Siegfried. You saved me from a sleepless night :-) Artemiy. ___ Cocoa-dev mailing list (Cocoa-dev@

Re: access multiple NSTextFields as an array?

2010-12-20 Thread aglee
On Dec 20, 2010, at 11:30 AM, Scott Ribe wrote: Anyway, there's no need for an NSMutableArray. You can just have a plain C array as an attribute of your class, and set up its entries in awakeFromNib: patterRateLabels[0] = numberLabel1; patterRateLabels[1] = numberLabel2;   I don't recommend t

Re: Cocoa view gets sluggish over time

2010-12-20 Thread Artemiy Pavlov
Thank you very much for these tips, Andy! They are really helpful. I have only started to learn Cocoa three weeks ago and answers on this list really gave me a good kick. All the best, Artemiy. You seem to have solved your main problem, so I'll just comment on a couple of other things.

Re: UIBezierPath: trying to create an array with CGPointMake

2010-12-20 Thread Lee Ann Rucker
On Dec 20, 2010, at 8:23 AM, colo wrote: Because i'm really stupid. :P I'm truly hacking away trying to translate the following method of code into iOS specific code to run on the ipad. I'm still totally in a learning stage, cram a widget into a socket and see if it works. No real good arguments

Re: access multiple NSTextFields as an array?

2010-12-20 Thread Lee Ann Rucker
On Dec 20, 2010, at 8:16 AM, Artemiy Pavlov wrote: >>> Can I then access each element via array[0], array[1] etc.? I.e. >>> will [array[0] setColor:...] work? >> >> No! This is not a C array, it's an object. Use -objectAtIndex >> instead I.e. [[array objectAtIndex:0] setColor:…] >> >> Chec

Re: Cocoa view gets sluggish over time

2010-12-20 Thread Graham Cox
On 21/12/2010, at 1:42 AM, Artemiy Pavlov wrote: > With each -drawRect call, NSTextField objects are not being redrawn from > scratch, they are added on top of the existing ones. So I end up with > thousands of them. > > I guess I need to put this code in -awakeFromNib. And then, if needed, ch

Re: Core Data mergeChangesFromContextDidSaveNotification: does not *completely* update the context ?

2010-12-20 Thread Ben Trumbull
On Dec 19, 2010, at 9:49 PM, Aurélien Hugelé wrote: > Hi! > > I think mergeChangesFromContextDidSaveNotification: does not work as most > people expect: > I have a mainthread and a subthread. My subthread updates a managed object > (change one of the property value) and save. > In the mainthre

Re: Modal loop memory leak on 10.6

2010-12-20 Thread Jo Meder
Hi Fritz, On 21/12/2010, at 5:07 AM, Fritz Anderson wrote: > We don't have your code (and there may be a lot of it before we can find the > bug), so I'm just going on brute instinct… > > Are you doing anything other than strict, narrow, > swear-on-your-mother's-life-it's-only, drawing in drawR

Re: Core Data mergeChangesFromContextDidSaveNotification: does not *completely* update the context ?

2010-12-20 Thread Aurélien Hugelé
Thanks Ben, after thought, this is indeed very logical and can be expected when you know Core Data. I came to the same conclusion but you phrased it much better than me :) Aurélien, Objective Decision Team Le 21 déc. 2010 à 01:45, Ben Trumbull a écrit : > > On Dec 19, 2010, at 9:49 PM, Au

NSKeyedArchiver on iOS and Cocoa

2010-12-20 Thread lorenzo7620
Are these two compatible? Can something archived one platform be unarchived on the other? I can't find anything in docs that addresses this, but I'm havig trouble doing precisely this (archived on iPhone, unarchived on MacOSX). I get the NSInvalidUnarchiveOperationException.

Re: NSKeyedArchiver on iOS and Cocoa

2010-12-20 Thread Ricky Sharp
On Dec 20, 2010, at 8:22 PM, lorenzo7...@gmail.com wrote: > Are these two compatible? Can something archived one platform be unarchived > on the other? I can't find anything in docs that addresses this, but I'm > havig trouble doing precisely this (archived on iPhone, unarchived on > MacOSX).

Re: Re: NSKeyedArchiver on iOS and Cocoa

2010-12-20 Thread lorenzo7620
On Dec 20, 2010 9:43pm, Ricky Sharp wrote: On Dec 20, 2010, at 8:22 PM, lorenzo7...@gmail.com wrote: > Are these two compatible? Can something archived one platform be unarchived on the other? I can't find anything in docs that addresses this, but I'm havig trouble doing precisely this

Performance: Drawing hundreds of short text strings

2010-12-20 Thread Mark Coniglio
My application needs to draw hundreds of short text strings into an NSView. After reviewing the Cocoa documentation on drawing text, I am left unsure as to how to do this with the highest level of efficiency. The text I am drawing will all be the same font and font size and style; the color

Re: Performance: Drawing hundreds of short text strings

2010-12-20 Thread Joar Wingfors
On 20 dec 2010, at 01.22, Mark Coniglio wrote: > My application needs to draw hundreds of short text strings into an NSView. > After reviewing the Cocoa documentation on drawing text, I am left unsure as > to how to do this with the highest level of efficiency. Don't optimize in the dark! Imp

Re: Performance: Drawing hundreds of short text strings

2010-12-20 Thread Sherm Pendley
On Mon, Dec 20, 2010 at 11:53 PM, Joar Wingfors wrote: > > On 20 dec 2010, at 01.22, Mark Coniglio wrote: > >> My application needs to draw hundreds of short text strings into an NSView. >> After reviewing the Cocoa documentation on drawing text, I am left unsure as >> to how to do this with the