Re: NSScanner Failing with EXC_BAD_ACCESS

2010-10-15 Thread Dave Keck
> The problem is probably that theScannedString has never been initialize > it. Always initialize when you declare, because otherwise your value could > be nonsense and can't be logged. So, minimally, you'd say this: Good advice regarding initialization, but... > NSString *theScannedString = nil;

Re: The dreaded "UITableView won't refresh" problem: SOLVED.

2010-10-15 Thread Matt Neuburg
On Wed, 13 Oct 2010 16:57:22 -0700, G S said: >Turns out to be a simulator bug, or a bug in the way Xcode is loading >apps into the simulator. > >The simulator was showing a UI from a XIB that had long since been >deleted from disk and removed from the project. And yet the compiled >nib from it wa

Re: NSScanner Failing with EXC_BAD_ACCESS

2010-10-15 Thread Matt Neuburg
On Fri, 15 Oct 2010 11:44:26 -0700, Chris Tracewell said: >NOTE :: GC Enabled > >I am using an NSScanner in an NSString category but am crashing whenever >I try to log the string I scanned into or to return it. If I comment out >the NSLog there are no problems. > >NSString *theScannedString; >NSSc

Re: NSScanner Failing with EXC_BAD_ACCESS

2010-10-15 Thread Chris Tracewell
Thanks all. I got it working, indeed the Scanner was failing, which as Kiel suggested, must have led to an invalid pointer by the time I tried to log/return it. Once I checked the BOOL it quit crashing and then with some reworking of my NSScanner code it processed and returned the string I wante

Re: What is the expected Cocoa API behavior in an incomplete object traversal?

2010-10-15 Thread Tito Ciuro
Hi Martin, On 15/10/2010, at 20:48, Martin Wierschin wrote: >> Well, in a normal situation the array would contain conforming objects. >> However, as it can happen once in a while, one can add an object to an array >> thinking it's of one type when in fact it's another. > > When you say "one c

Re: What is the expected Cocoa API behavior in an incomplete object traversal?

2010-10-15 Thread Martin Wierschin
Well, in a normal situation the array would contain conforming objects. However, as it can happen once in a while, one can add an object to an array thinking it's of one type when in fact it's another. When you say "one can add", do you mean that the user chooses these objects in the GUI

Re: Smooth scrolling in NSScrollView

2010-10-15 Thread Gideon King
Both copiesOnScroll and drawsBackground are turned on. I tried another little experiment and turned the layer backing for the subviews off, and the only times that the drawing code for the subviews was called is when they are coming on to the visible rect - when they are already there, the draw

Re: NSScanner Failing with EXC_BAD_ACCESS

2010-10-15 Thread Bill Bumgarner
On Oct 15, 2010, at 12:00 PM, Hank Heijink (Mailinglists) wrote: >> NSString *theScannedString; > > I would set theScannedString to nil here to avoid your crash below. That would be making the assumption that the implementation of scanCharactersFromSet:intoString: does not muck with the pointe

Re: What is the expected Cocoa API behavior in an incomplete object traversal?

2010-10-15 Thread Tito Ciuro
Hi Corbin, On 15/10/2010, at 16:55, Corbin Dunn wrote: > If it is instead some array input that the user provided, and it is a user > error to provide the wrong input, then you should return a user-presentable > NSError and the caller should present the error on failure. This sounds right to

Re: What is the expected Cocoa API behavior in an incomplete object traversal?

2010-10-15 Thread Klaus Backert
On 15 Oct 2010, at 21:42, Tito Ciuro wrote: Hello, I'm implementing a method and I'm not sure what the behavior should be when detecting an anomaly. Case in point: I have a method that iterates through an array of objects. As I traverse the array, I'm, checking whether the object in th

Re: What is the expected Cocoa API behavior in an incomplete object traversal?

2010-10-15 Thread Hank Heijink (Mailinglists)
On Oct 15, 2010, at 3:42 PM, Tito Ciuro wrote: > Hello, > > I'm implementing a method and I'm not sure what the behavior should be when > detecting an anomaly. > > Case in point: I have a method that iterates through an array of objects. As > I traverse the array, I'm, checking whether the obj

Re: What is the expected Cocoa API behavior in an incomplete object traversal?

2010-10-15 Thread Corbin Dunn
Hey Tito, It depends. Does your method require all objects in the array to conform to a protocol? If yes, and one doesn't, then throw an exception, since it is a programming error. If no, meaning you allow some to pass through with nothing happening, then you should define the behavior in a hea

What is the expected Cocoa API behavior in an incomplete object traversal?

2010-10-15 Thread Tito Ciuro
Hello, I'm implementing a method and I'm not sure what the behavior should be when detecting an anomaly. Case in point: I have a method that iterates through an array of objects. As I traverse the array, I'm, checking whether the object in the array conforms to a custom protocol. If it does, e

Re: NSScanner Failing with EXC_BAD_ACCESS

2010-10-15 Thread Kiel Gillard
http://developer.apple.com/library/ios/documentation/cocoa/reference/foundation/Classes/NSScanner_Class/Reference/Reference.html#//apple_ref/occ/instm/NSScanner/scanCharactersFromSet:intoString: You pass by reference to the - [NSScanner scanCharactersFromSet:intoString:] method an uninitialised p

Re: NSScanner Failing with EXC_BAD_ACCESS

2010-10-15 Thread Hank Heijink (Mailinglists)
On Oct 15, 2010, at 2:44 PM, Chris Tracewell wrote: > NOTE :: GC Enabled > > I am using an NSScanner in an NSString category but am crashing whenever I > try to log the string I scanned into or to return it. If I comment out the > NSLog there are no problems. > > NSString *theScannedString; I

NSScanner Failing with EXC_BAD_ACCESS

2010-10-15 Thread Chris Tracewell
NOTE :: GC Enabled I am using an NSScanner in an NSString category but am crashing whenever I try to log the string I scanned into or to return it. If I comment out the NSLog there are no problems. NSString *theScannedString; NSScanner *theScanner = [NSScanner scannerWithString:theNewHTML]; NSC

Re: HUD Window from Service?

2010-10-15 Thread Kyle Sluder
On Fri, Oct 15, 2010 at 6:59 AM, Ron Olson wrote: > Hi all- > > I am writing a service that grabs some data from a selected file and > displays it in a pop-up HUD-style window a la Quick Look. I have been > searching around but haven't figured out a way to display a HUD window > (or any kind of wi

Re: Smooth scrolling in NSScrollView

2010-10-15 Thread Keary Suska
On Oct 15, 2010, at 8:50 AM, Gideon King wrote: > Thanks for the suggestion Uli. > > The subviews are layer backed views. I've stripped them down to simply > drawing the color into a path - absolutely nothing unusual or complex there. > > Now this is rather embarrassing, but I found out that th

Re: Smooth scrolling in NSScrollView

2010-10-15 Thread Gideon King
Thanks for the suggestion Uli. The subviews are layer backed views. I've stripped them down to simply drawing the color into a path - absolutely nothing unusual or complex there. Now this is rather embarrassing, but I found out that the cause of the visual slowdown was entirely due to running i

HUD Window from Service?

2010-10-15 Thread Ron Olson
Hi all- I am writing a service that grabs some data from a selected file and displays it in a pop-up HUD-style window a la Quick Look. I have been searching around but haven't figured out a way to display a HUD window (or any kind of window, for that matter) outside the context of an application,

Re: Partially opaque window with opaque views

2010-10-15 Thread Uli Kusterer
On Oct 5, 2010, at 12:25 PM, Trygve Inda wrote: > Is there a way to have a window with a 50% opaque background, but several > odd-shaped views that are 100% opaque? The dock does this but seems be one > window per icon. Can I do it all as one window? Look into NSBorderlessWindowMask. You may also

Re: Identifying Cocoa Methods

2010-10-15 Thread Uli Kusterer
On Oct 9, 2010, at 1:22 AM, Jason Slack-Moehrle wrote: > I need to integrate Carbon and Cocoa so that I can replace the existing > Carbon GUI elements with Cocoa equivalents. Mostly Dialog Boxes, etc. > > I know that I need to write C-ACllable Wrapper Functions for the Cocoa stuff > that I need,

Re: NSOutline and NSTreeController using bindings

2010-10-15 Thread Hrishikesh Murukkathampoondi
Ah ok I did not know about mutableArrayValue. BTW is there any difference (performance or otherwise) between what you suggested (using mutableArrayValue) and what I did earlier? Thanks Hrishi On 15-Oct-2010, at 3:40 PM, Chris Hanson wrote: > My apologies - I dashed off my last email to you too

Re: Smooth scrolling in NSScrollView

2010-10-15 Thread Uli Kusterer
On Oct 15, 2010, at 3:12 AM, Gideon King wrote: > Hi, I am trying to get a large view to scroll smoothly in an NSScrollView > using an animation on the scrollpoint. The first time I do this, the > scrolling is quite jerky, especially when I get to places where there are > subviews. Once it has s

Re: NSOutline and NSTreeController using bindings

2010-10-15 Thread Chris Hanson
My apologies - I dashed off my last email to you too quickly and made a significant mistake in it. I intended to suggest using -mutableArrayValueForKey: rather than -valueForKey:. For example: - (void)awakeFromNib { [[self mutableArrayValueForKey:@"myListRoot"] addObject:foo];

Re: NSOutline and NSTreeController using bindings

2010-10-15 Thread Hrishikesh Murukkathampoondi
Thank you for the suggestion. I changed the code to use KVC like you suggested but it still makes no difference. But doing what you said along with calls to willChangeValueForKey and didChangeValueForKey This worked: -(void) awakeFromNib { NSTreeNode *tn = [NSTreeNode treeNodeWithRepresent

Re: Debug Problem on MacOSX 10.5

2010-10-15 Thread Andreas Höschler
Hi Dave and Laurent, >Did you try fb [NSException raise]? fb stands for future break and you can set it by pausing the debugger as soon as your app launches. No, I didn't try that. Will give it a try ... Try breaking on objc_exception_throw() instead. This worked like a charm! Thanks a