Re: Core Animation vs. Basic Cocoa Graphics

2010-03-11 Thread jonat...@mugginsoft.com
On 10 Mar 2010, at 17:13, Mazen M. Abdel-Rahman wrote: > Hi All, > > I was able to write a simple calendar view that uses basic cocoa graphics to > draw directly on the view (NSBezierPath, etc.). I actually use several > different paths for drawing the calendar (it's a weekly calendar) to al

Re: Core Animation vs. Basic Cocoa Graphics

2010-03-11 Thread Volker in Lists
Hi, are you drawing ALL of your paths whenever the user scrolls or only the ones that are within the visible rect? If the first, you may try to change that to the second and gain lots of performance. I draw a sound wave view and when drawing all of it while zoomed into it, it is sooowww. Bu

KVO on NSDictionary elements

2010-03-11 Thread Gustavo Pizano
Hello all. Im implementing a live filter, and each, time I insert a filter in the filterDictionary the controller (which is another class) gets notified about the insertion.\ I was reading the KVO, and its says something about NSKeyValueChangeKindKey. So this is what Im doing in the Controller c

Re: How to debug this error on closing a document?

2010-03-11 Thread Gideon King
Well I spent some of the day going through the application with the analyzer - first time I have used it, and I'm pretty impressed - I like the way it draws the lines showing the relevant lines of code...but although it did pick up some leaks etc, it made no difference to my specific problem. W

Unable to receive keyDown Event in NSBorderlesswindow

2010-03-11 Thread Poonam Virupaxi Shigihalli
Hi, I am using NSBorderless style mask for window and I am unable to receive the NSKeyDown event for that window.But if I make the window style as titled then I am able to receive the keyDown events. I am using below function for Keydown event: - (void)keyDown:(NSEvent *) event Thanks,

Re: Unable to receive keyDown Event in NSBorderlesswindow

2010-03-11 Thread Dado Colussi
> I am using NSBorderless style mask  for window  and I am unable to receive > the NSKeyDown event for that window.But if I make the window style as titled > then I am able to receive the keyDown events. > > I am using below function for Keydown event: > > - (void)keyDown:(NSEvent *) event Impl

Re: Unable to receive keyDown Event in NSBorderlesswindow

2010-03-11 Thread Ron Fleckner
On 11/03/2010, at 10:57 PM, Poonam Virupaxi Shigihalli wrote: Hi, I am using NSBorderless style mask for window and I am unable to receive the NSKeyDown event for that window.But if I make the window style as titled then I am able to receive the keyDown events. I am using below functi

EXC_BAD_ACCESS

2010-03-11 Thread Billy Flatman
Hi All, I'm getting a 'EXC_BAD_ACCESS' error when calling the fill on a NSBezierPath. Below is an outline of my code. @interface Shape : NSObject { NSBezierPath *path; } - (void)paint; @end @implementation Shape - (void) paint { [[NSColor redColor] set]; [path fill]; } @

Re: EXC_BAD_ACCESS

2010-03-11 Thread Thomas Davie
Your initBezierPath method reallocates and reinitialises a path that's already been created. It also autoreleases the result (as the allocation method doesn't start with alloc, copy, mutableCopy, retain or new). The result is that the first time 'path' is assigned it gets a non-released value.

Re: EXC_BAD_ACCESS

2010-03-11 Thread Thomas Davie
Oops, sorry, my dealloc was buggy o.O - (void)dealloc { [path release]; [super dealloc]; } Bob On 11 Mar 2010, at 13:38, Billy Flatman wrote: > Hi All, > > I'm getting a 'EXC_BAD_ACCESS' error when calling the fill on a NSBezierPath. > Below is an outline of my code. > > > @interface Sha

Re: EXC_BAD_ACCESS

2010-03-11 Thread Roland King
isn't this almost exactly the same question you asked a week ago? It looks like you did 1/2 of what Graham told you then but didn't totally understand his answer. Same answer, you're setting path to a newly-created NSBezierPath you don't own and overwriting the one you alloc/init'ed earlier. S

Re: Help visualizing something in IB

2010-03-11 Thread Brian Postow
On Mar 10, 2010, at 8:04 PM, Quincey Morris wrote: > On Mar 10, 2010, at 15:54, Brian Postow wrote: > >> Basically, I want the topView to scroll, but I always want to be able to see >> the buttonView. So if part of the topView isn't visible because it's been >> scrolled up, I want the buttonvi

View does not get refreshed after Window deminimized...

2010-03-11 Thread cocoa learner
Hi All, I have subclassed a custom view in following way - @implementation AppContentView - (id)initWithFrame: (NSRect)frame { self = [super initWithFrame:frame]; if (self) { // Initialization code here. } return self; } - (void)drawRect:(NSRect)rect { [[NSCo

IsFileOnARemoteVolume

2010-03-11 Thread gMail.com
I am trying to code my own API isFileOnARemoteVolume since I didn't find anything similar on Cocoa. If any, please let me know. I use statfs to detect whether the filePath I pass as variable is on a remote volume. Anyway, this wont work in case of broken symlinks. So I have used a dirty trick to g

NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Alexander Bokovikov
Hi, All. I have a table view in the "main" window, where it works fine. And have yet another very similar table view in a popup modal panel. where it fails immediately after panel is closed. Debugger shows subj, as the failure point. In both cases dataSource for table view is assigned in

NSTextView backed by core data, undo problems

2010-03-11 Thread Martin Hewitson
Dear list, I have a puzzling problem which is making my puzzler sore. Here's the outline: I have a core-data doc based app. I have core data entities which represent files on disk. When the entity is created, the contents of the file are loaded (in to a binary-data attribute called 'content').

Bug with the ABPeoplePicker drag?

2010-03-11 Thread Eric Giguere
Hi all I've been experiencing problems with the drag and drop from the Address book control in my application. The control is in a view where a TableList is the destination for the drag. When the drop message is sent to my view, the following message is sent back to the control, as instructed

Re: How to debug this error on closing a document?

2010-03-11 Thread Jerry Krinock
On 2010 Mar 11, at 02:27, Gideon King wrote: > or whether I would have to subclass NSConcreteNotification and override > dealloc and then use pose as, so I could print out the notification name > etc, to get the info That would work, but Method Replacement [1] was added in Objective-C 2.0 as

Re: [[Class alloc] init] preferable over [[Class instance] retain]?

2010-03-11 Thread Matt Neuburg
On Tue, 9 Mar 2010 23:58:55 +, Jeff Laing said: >The upshot was that apparently the iPhone developers like you to avoid the use of autorelease pools where possible. One hidden difference in the above is that in the first case you have (probably) populated the autorelease pool and in the other

Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Fritz Anderson
On 11 Mar 2010, at 9:38 AM, Alexander Bokovikov wrote: > I have a table view in the "main" window, where it works fine. And have yet > another very similar table view in a popup modal panel. where it fails > immediately after panel is closed. Debugger shows subj, as the failure point. > In both

Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Corbin Dunn
On Mar 11, 2010, at 7:38 AM, Alexander Bokovikov wrote: > Hi, All. > > I have a table view in the "main" window, where it works fine. And have yet > another very similar table view in a popup modal panel. where it fails > immediately after panel is closed. Debugger shows subj, as the failure p

Re: Help visualizing something in IB

2010-03-11 Thread Quincey Morris
On Mar 10, 2010, at 8:04 PM, Quincey Morris wrote: > If you must follow this approach, then I'd suggest you register to get > frame-changed notifications from topView. That way, you'll know if it moved > within the window, or if it was resized as a result of the window/enclosing > view resizing

Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Alexander Bokovikov
On Thursday, March 11, 2010 at 10:11 PM Fritz Anderson wrote: 1. You don't say what "fail" means. A crash? What error code? What stack trace? EXC_BAD_ACCESS. Assembler call stack view shows line next to the subj call. OS X 10.5.8 Never tried it in 10.6.X 2. This is all moot, because, as the

Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Alexander Bokovikov
On Thursday, March 11, 2010 at 10:29 PM Corbin Dunn wrote: Break on objc_exception_throw. Could you explain it? What does it mean? Thanks. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comme

Re: View does not get refreshed after Window deminimized...

2010-03-11 Thread Quincey Morris
On Mar 11, 2010, at 06:50, cocoa learner wrote: > And on this custom view I have a progress bar, that progressbar gets it's > progress value from a NSThread. And I am using following function render the > progressbar, from NSThread - > > > [progBar performSelectorOnMainThread: (display) withObje

Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Fritz Anderson
On 11 Mar 2010, at 11:44 AM, Alexander Bokovikov wrote: > Of couse, I never called it directly. I never implemented it. I just _use_ > NSTableView. Nothing more. The fact is that it is working nice in the main > app, where it is never destroyed explicitly. But it doesn't work correctly in > a m

Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Eli Bach
On Mar 11, 2010, at 10:44 AM, Alexander Bokovikov wrote: > Of couse, I never called it directly. I never implemented it. I just _use_ > NSTableView. Nothing more. The fact is that it is working nice in the main > app, where it is never destroyed explicitly. But it doesn't work correctly in > a

Need help with scrolling marquee

2010-03-11 Thread Michael A. Crawford
I'm trying to create an effect on the iPhone to scroll text across the view in a given location. Not really sure how to go about it so I did some experimenting. Af first I tried to animate the scroll using a timer. That gave me inconsistent movement; the velocity of the scrolling text appeare

Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Corbin Dunn
On Mar 11, 2010, at 9:48 AM, Alexander Bokovikov wrote: > > On Thursday, March 11, 2010 at 10:29 PM Corbin Dunn wrote: > >> Break on objc_exception_throw. > > Could you explain it? What does it mean? http://www.corbinstreehouse.com/blog/2008/08/your-most-important-breakpoint-in-cocoa/ corbin

Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Corbin Dunn
On Mar 11, 2010, at 9:44 AM, Alexander Bokovikov wrote: > On Thursday, March 11, 2010 at 10:11 PM Fritz Anderson wrote: > >> 1. You don't say what "fail" means. A crash? >> What error code? What stack trace? > > EXC_BAD_ACCESS. Assembler call stack view shows line next to the subj call. > > OS

Re: Help visualizing something in IB

2010-03-11 Thread Brian Postow
On Mar 11, 2010, at 1:04 PM, Quincey Morris wrote: > On Mar 10, 2010, at 8:04 PM, Quincey Morris wrote: > >> If you must follow this approach, then I'd suggest you register to get >> frame-changed notifications from topView. That way, you'll know if it moved >> within the window, or if it was

Re: NSTextView backed by core data, undo problems

2010-03-11 Thread Kyle Sluder
On Thu, Mar 11, 2010 at 7:50 AM, Martin Hewitson wrote: > The nasty little problem I have is that if I edit the contents of a file via > the NSTextView, then do 'undo', the cursor (selection) in the NSTextView > jumps to the end of the document, and the scrollview jumps to the top. Almost > as

Noob iPhone Question

2010-03-11 Thread Michael Davey
Hi, I am now being approached to develop an iPhone application for one of my clients which will involve storing a cache of previously downloaded images. My question is whether or not there are constraints as to how my storage space I have at my disposal, and whether any of you have a link to f

[MEET] CocoaHeads-NYC tonight - NSOperation

2010-03-11 Thread Andy Lee
Sorry for the two hours' notice... Marc van Olmen will give the talk entitled "Introduction to NSOperation" that he was unable to give last month. I have no doubt it'll be worth the wait. As usual: (1) Please feel free to bring questions, code, and works in progress. We have a projector and w

Re: Noob iPhone Question

2010-03-11 Thread Michael Davey
Thanks - I think I may still implement some form of cache control just to keep it manageable though. On 11 Mar 2010, at 21:32, Thomas Mueller wrote: > Hi Michael, > > I don't think there are any artificial limits for how much memory your > application can use. As long as there is space left on

Re: Need help with scrolling marquee

2010-03-11 Thread Graham Cox
On 12/03/2010, at 5:23 AM, Michael A. Crawford wrote: > - (void)timerFireMethod:(NSTimer*)theTimer > { > #if 0 >// Here I was using a periodic timer to animate the scroll. I noticed that >// the animation wasn't smooth and then remembered that CA is supposed to > do >// the animatin

Re: Need help with scrolling marquee

2010-03-11 Thread Eric E. Dolecki
Isn't there a truncation property that handles this for a UILabel? On Thu, Mar 11, 2010 at 4:53 PM, Graham Cox wrote: > > On 12/03/2010, at 5:23 AM, Michael A. Crawford wrote: > > > - (void)timerFireMethod:(NSTimer*)theTimer > > { > > #if 0 > >// Here I was using a periodic timer to animate

Re: Need help with scrolling marquee

2010-03-11 Thread Michael A. Crawford
Thanks, Graham, I realized the timer would have jitter. When I realized what was going on and began to think about how to fix it, that is when I had one of those head-slap moments where I asked, "Why am I not using CoreAnimation for this?" -Michael On Mar 11, 2010, at 4:53 PM, Graham Cox wrot

Re: Need help with scrolling marquee

2010-03-11 Thread Michael A. Crawford
I played with the truncation property but to make that work you have to continually modify the length of the string. I want to write the string to the buffer once and then have CA scroll it for me at a constant speed I can set. This is where I'm looking for assistance. -Michael On Mar 11, 20

Answer: Bison with Objective-C Semantic Actions? Works

2010-03-11 Thread Thomas Wetmore
Just a quick thank-you to those who responded to my question about using bison to generate a language intepreter in an Cocoa Foundation/Xcode/Objective-C environment. Xcode does everything needed to make it seamless. I named the yacc file Interpreter.ym and made the semantic value type for all

Switching methods in private classes in Apple frameworks

2010-03-11 Thread Gideon King
(following on from the thread "How to debug this error on closing a document?", but it's really moved on to a new topic at this point) I was not aware that poseAsClass is not available in 64 bit applications. I looked at the Apple example of exchanging a method in NSWindow, and it looked easy e

Re: Switching methods in private classes in Apple frameworks

2010-03-11 Thread Greg Parker
On Mar 11, 2010, at 4:24 PM, Gideon King wrote: > (following on from the thread "How to debug this error on closing a > document?", but it's really moved on to a new topic at this point) > > I was not aware that poseAsClass is not available in 64 bit applications. I > looked at the Apple example

Re: Help visualizing something in IB

2010-03-11 Thread Quincey Morris
On Mar 11, 2010, at 10:58, Brian Postow wrote: > I should be able to just use the clipRect of the superview, right? Well, you have to observe something that produces notifications -- which means the bounds or frame of a view. You're likely not interested in the actual bounds or frame you're be

Core Data: inverse relationship not updated until next Run Loop

2010-03-11 Thread Eric Lin
In using Core Data, I was under the impression that if I do this: [department addEmployeesObject:employee] // department now has 1 employee [moc deleteObject:employee] Then department will end up with no employees, assuming that the inverse relationship is set correctly. But it turns out within

Re: Switching methods in private classes in Apple frameworks

2010-03-11 Thread Gideon King
This is really cool...so I can replace a method without being a subclass or category. So I implemented an NSObject subclass with the new method, and did the method exchange, and my new method was called instead of the old one, but I had a problem - the call to the switched out method (dealloc

Re: Core Animation vs. Basic Cocoa Graphics

2010-03-11 Thread Mazen M. Abdel-Rahman
Thanks everyone for your help on this. I started using an image cache - but that did not improve the performance as much as I thought it should. I then removed the section of my code that creates NSTrackingsAreas - and the improvement was immediately noticeable. For the calendar grid I was cre

Re: View does not get refreshed after Window deminimized...

2010-03-11 Thread cocoa learner
Hummm... looks like my approach has flaw. Thanks a ton, Cocoa.learner On Thu, Mar 11, 2010 at 11:52 PM, Quincey Morris < quinceymor...@earthlink.net> wrote: > On Mar 11, 2010, at 06:50, cocoa learner wrote: > > > And on this custom view I have a progress bar, that progressbar gets it's > > progr

Use of KVC Array operators

2010-03-11 Thread Eli Bach
The operators mentioned on this page, particularly "@unionOfSets". I have the following Core Data object's setup ClassA ClassB ClassC relationA --> relationB --

Re: Switching methods in private classes in Apple frameworks

2010-03-11 Thread Jerry Krinock
On 2010 Mar 11, at 18:00, Gideon King wrote: > This is really cool...so I can replace a method without being a subclass or > category. I just need to chime in here, in case anyone missed it, to emphasize how *ALL-CAPS COOL* this is indeed. In the ReadMe of Apple's MethodReplacement.zip sample

Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Alexander Bokovikov
On 11.03.2010, at 23:25, Corbin Dunn wrote: http://www.corbinstreehouse.com/blog/2008/08/your-most-important-breakpoint-in-cocoa/ I've done what was told there. No difference. I just get EXC_BAD_ACCESS in XCode status line and debugger's call stack list shows: objc_msgSend - [NSTableVie

Making a beta version expire

2010-03-11 Thread Ulai Beekam
For a beta version of an app, let's say I want to make sure that users cannot use the beta for far too long, far longer than the app goes out of beta. (Note that this case would in reality rarely occur. Most users would end up getting notified of a new update far sooner. This is just a "safety"

Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Eli Bach
On Mar 11, 2010, at 8:55 PM, Alexander Bokovikov wrote: > Is there anything criminal here? Is the datasource for the NSTableView still a valid, non-released object when the window is closed? Eli ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com

Re: Making a beta version expire

2010-03-11 Thread Jim Correia
On Mar 11, 2010, at 11:03 PM, Ulai Beekam wrote: > Do you think this would work? I mean, it seems that it should, but one can > never be sure Why can’t you be sure? After reading your algorithm and convincing yourself that the code is correct, step through it in the debugger with expirations

Re: Switching methods in private classes in Apple frameworks

2010-03-11 Thread Gideon King
Thanks Jerry, I should mention that I did get this caveat note from Greg Parker (Apple's "runtime wrangler"): "..you must be cautious about what your replacement method does. In particular, you must not use any of the class's ivars and you must not call [super something]. As long as you follow

Re: Cocoa-dev Digest, Vol 7, Issue 294

2010-03-11 Thread Shripada Hebbar
Hi Michael, You can use a text filed inside a scrollview. And use CAKeyFrameAnimation on the layer of the text field on its 'position' property. The idea is something like this: You need to compute the appropriate duration for the animation from the size of the text you have. The duration needs t

Re: Core Data: inverse relationship not updated until next Run Loop

2010-03-11 Thread Jim Correia
On Mar 11, 2010, at 8:11 PM, Eric Lin wrote: > In using Core Data, I was under the impression that if I do this: > > [department addEmployeesObject:employee] // department now has 1 employee > [moc deleteObject:employee] > > Then department will end up with no employees, assuming that the inver

Re: Core Animation vs. Basic Cocoa Graphics

2010-03-11 Thread Alvaro Costa Neto
Hi Mazen, how are you? Maybe I can offer a tip on how to improve your performance: there is a technique called BSP-Tree which divides the space in two equal parts recursively, creating a tree of subdivisions. This technique improves the search of which area of the space (in your case, the view

Cannot find symbol(s) in release version

2010-03-11 Thread Wade Guangwu Xia
Hi, I met a issue that there are several link errors when build a project which can be built successfully in debug version. The detail information is below: 1. There are two projects, the targets of both projects is framework. 2. Project A dependents project B's output. 3.

Re: Load data from csv file and plot line graph

2010-03-11 Thread Ni Lei
For the code example, > CPTestAppScatterPlotController.m > that I downloaded from core-plot Google website, a line graph can be > plotted based on randomly > generated initial data x, y. > > // Add some initial data >NSMutableArray *contentArray = [NSMutableArray > arrayWithCapacity:100]

Re: Better sorting using threads?

2010-03-11 Thread Andrew James
Does Cocoa have sorted containers so that an object can be inserted in sorted order?  If so it seems like this would be far less expensive. --aj From: Ken Ferry To: Ken Thomases Cc: Cocoa-Dev List Sent: Wed, March 10, 2010 11:37:31 PM Subject: Re: Better so

Re: Core Data: inverse relationship not updated until next Run Loop

2010-03-11 Thread Frank Illenberger
>> In using Core Data, I was under the impression that if I do this: >> >> [department addEmployeesObject:employee] // department now has 1 employee >> [moc deleteObject:employee] >> >> Then department will end up with no employees, assuming that the inverse >> relationship is set correctly. >>

Re: NSServices - Validation bug

2010-03-11 Thread Jim Correia
On Mar 8, 2010, at 5:02 AM, tr...@atheeva.com wrote: > I have some queries regarding Services menu validation . I would like to > enable different services provided by my app based on whether a file or > folder is selected in the Finder. I have set NSFilenamesPboardType as the > send type for

Re: Switching methods in private classes in Apple frameworks

2010-03-11 Thread Bill Bumgarner
On Mar 11, 2010, at 8:58 PM, Gideon King wrote: > So as long as you are careful about what you do, yes it is entirely possible > to replace methods at will. I hope nobody misuses it, but it certainly was > essential in my debugging - yes, I found it! Yay! Where "careful about what you do" inc

Re: Better sorting using threads?

2010-03-11 Thread Bill Bumgarner
On Mar 11, 2010, at 11:15 AM, Andrew James wrote: > Does Cocoa have sorted containers so that an object can be inserted in sorted > order? If so it seems like this would be far less expensive. Depends entirely on need. Keeping a container sorted on insert can be quite expensive; potentiall

Re: [MEET] CocoaHeads-NYC tonight - NSOperation

2010-03-11 Thread Symadept
Hi Andy, Can you please record the discussion and presentation since the people like me non US Residents can view them. I am really looking for such topic. Thanks & regards Mustafa Shaik On Fri, Mar 12, 2010 at 5:11 AM, Andy Lee wrote: > Sorry for the two hours' notice... > > Marc van Olmen w

Re: Better sorting using threads?

2010-03-11 Thread Ken Ferry
> Does Cocoa have sorted containers so that an object can be inserted in sorted order? If so it seems like this would be far less expensive. Probably the best thing to do if you want this is to maintain the sort yourself by inserting new objects in the correct position. You can find the position

Re: NSTextView backed by core data, undo problems

2010-03-11 Thread Martin Hewitson
Thanks, Kyle. I figured the answer would be something like this. OK, then I'll need to rethink the architecture a bit. I was aiming for an Xcode-like interface with potentially multiple views to the same file content, but without using 'updates continuously' this is going to be more difficult to