Re: Problems with NSPathControl

2010-07-12 Thread Kyle Sluder
On Mon, Jul 12, 2010 at 10:34 PM, Scott Anguish wrote: > > On Jul 12, 2010, at 6:13 PM, Kyle Sluder wrote: > >> On Mon, Jul 12, 2010 at 2:12 PM, Kevin Perry wrote: >>> Yeah, this is an unfortunate bug that we didn't catch until Snow Leopard. >> >> Good to know. Might we be able to get some mentio

Re: Problems with NSPathControl

2010-07-12 Thread Scott Anguish
On Jul 12, 2010, at 6:13 PM, Kyle Sluder wrote: > On Mon, Jul 12, 2010 at 2:12 PM, Kevin Perry wrote: >> Yeah, this is an unfortunate bug that we didn't catch until Snow Leopard. > > Good to know. Might we be able to get some mention of this in the > NSPathControl documentation? rdar://problem/

NSFetchedResultsController variant?

2010-07-12 Thread Matt James
Does anyone know if someone's written a variant of the NSFetchedResultsController class for views other than UITableView? I had to write my own view for displaying sets of data and need something that serves the same purpose, but my own view. I'd obviously be happy to modify my view such that it

Re: Deploying to an iPad

2010-07-12 Thread Scott Anguish
On Jul 12, 2010, at 5:44 PM, Martin Glaß wrote: > don't know if i will be of any help, but: > > when adding a file you should be asked if you would like it to be copied to > the project's directory. > this should be a checkbox in a dialog. have you tried this? > > - martin > > Am 12.07.2010 2

Re: Still another static analyzer (and LLVM parser) mistake

2010-07-12 Thread Sean McBride
Matt Neuburg (m...@tidbits.com) on 2010-07-12 20:16 said: >There's no warning if you do this: > >NSArray* arr = [NSArray arrayWithObjects: @"howdy"]; > >GCC's parser is smart enough to know that the missing nil terminator is just >asking for trouble. FWIW, there are a bunch of compiler warnings t

Re: Still another static analyzer (and LLVM parser) mistake

2010-07-12 Thread Kyle Sluder
On Mon, Jul 12, 2010 at 5:16 PM, Matt Neuburg wrote: > There's no warning if you do this: > > NSArray* arr = [NSArray arrayWithObjects: @"howdy"]; > > GCC's parser is smart enough to know that the missing nil terminator is just > asking for trouble. Have you filed a bug? http://www.llvm.org/bugs

Re: Another static analyzer mistake

2010-07-12 Thread Shawn Erickson
You should file defects using or , or email the clang list () or Xcode list to report issues like these. -Shawn ___ Cocoa-dev mailing list (Cocoa-de

Re: NSResizableWindowMask and view update

2010-07-12 Thread Tony Romano
Yep, overlooked that the drawRect will give me the dirty rect. Because the sizing handle is diagonal to the origin (0,0), it looked like it wasn't flipped. Fix the problem by one missing multiply in a calculation. Thanks and it's time to call it day! -Tony On Jul 12, 2010, at 4:54 PM, Kyle

Still another static analyzer (and LLVM parser) mistake

2010-07-12 Thread Matt Neuburg
There's no warning if you do this: NSArray* arr = [NSArray arrayWithObjects: @"howdy"]; GCC's parser is smart enough to know that the missing nil terminator is just asking for trouble. m. -- matt neuburg, phd = m...@tidbits.com, A fool + a tool + an autorelease p

Another static analyzer mistake

2010-07-12 Thread Matt Neuburg
This, rightly, warns of a leak: MPMoviePlayerViewController* mpvc = [[MPMoviePlayerViewController alloc] initWithContentURL:urlurl]; This does not: MPMoviePlayerViewController* mpvc = [[MPMoviePlayerViewController alloc] initWithContentURL:urlurl]; [self presentMoviePlayerViewControllerAnima

Re: NSResizableWindowMask and view update

2010-07-12 Thread Kyle Sluder
On Mon, Jul 12, 2010 at 4:41 PM, Tony Romano wrote: > During the setStyleMask, the view is sent a drawRect message which is > expected.  But the values in the rect are not flipped and are not the view > bounds. So? The rect argument to -drawRect: is not the size of your view. It is a rectangle

NSTextView becomes temporarily unresponsive

2010-07-12 Thread David Swofford
I'm beginning the conversion of a scientific app from Carbon to Cocoa, and have run into a problem with NSTextView. FWIW, I have it embedded in an NSScrollView that is in turn included as an HICocoaView in a Carbon window (but I don't think this is relevant to my problem). It works, but I've r

NSResizableWindowMask and view update

2010-07-12 Thread Tony Romano
I have a document based cocoa app with each document window having it's own window controller and view(the view is flipped). I have an option to turn on/off the resize grip and I set the mask using setStyleMask. All this works fine. During the setStyleMask, the view is sent a drawRect message

NSViewController and key value coding

2010-07-12 Thread Andrew James
All, I've been writing way to much code to populate an NSPopUpButton with an array that can change at any moment.  Due to that, I'd rather use Cocoa's Key Value Coding technology.  I've read Apple docs over the past two days in regards to key value coding and observing. To really cement my und

Re: newbie core data question

2010-07-12 Thread Keary Suska
On Jul 12, 2010, at 1:14 PM, Oftenwrong Soong wrote: > My managed classes need non-standard persistent attributes, such as CGPoint. > Possibly, I'll need other C structs or enums as well. > > The Core Data Programming Guide section about non-standard persistent > attributes > (link below) says

Re: Problems with NSPathControl

2010-07-12 Thread Kyle Sluder
On Mon, Jul 12, 2010 at 2:12 PM, Kevin Perry wrote: > Yeah, this is an unfortunate bug that we didn't catch until Snow Leopard. Good to know. Might we be able to get some mention of this in the NSPathControl documentation? rdar://problem/8182284 --Kyle Sluder

Missing Source managed object model

2010-07-12 Thread Brent Smith
Hi everybody, I'm trying to run core data migration on the store of my app but it seems to be unable to find the source object model no matter what. I tried different approaches, taking some hints by some results I found on google, but without success. This is what I tried: Note, this is a non doc

Re: Deploying to an iPad

2010-07-12 Thread Martin Glaß
don't know if i will be of any help, but: when adding a file you should be asked if you would like it to be copied to the project's directory. this should be a checkbox in a dialog. have you tried this? - martin Am 12.07.2010 23:17, schrieb Christian Graus: hi guys. I am getting back in to

Re: Problems with NSPathControl

2010-07-12 Thread Dave DeLong
OK, not a bad idea. However, even if I have the menu, I'm still going to have to somehow map the menuitems to the NSPathComponentCells to get the URL, because the NSMenuItems don't have their representedObject set to anything. So I'm going to have to map a menuitem to a file URL. OK, this sho

Deploying to an iPad

2010-07-12 Thread Christian Graus
hi guys. I am getting back in to iPad development, and at this stage, I have an application that was written for us, which I want to deploy. I've not made any code changes, but I've changed the databases, which means I've changed the files that should be deployed with the application. I've just

Re: Problems with NSPathControl

2010-07-12 Thread Kevin Perry
Yeah, this is an unfortunate bug that we didn't catch until Snow Leopard. Here's one way to work around it (there may be a better alternative that I'm not aware of). You can implement pathControl:willPopUpMenu: and keep a pointer to the menu it gives you. When the action is called, -[NSMenu high

Re: Problems with NSPathControl

2010-07-12 Thread Dave DeLong
Or do I have to do something wonky like altering the target/action of menuitems before they show up? Dave On Jul 12, 2010, at 2:45 PM, Dave DeLong wrote: > Fair enough; How can I retrieve which item was clicked? The sender of the > action is the actual NSPathControl, and -clickedPathComponen

Re: Problems with NSPathControl

2010-07-12 Thread Dave DeLong
Fair enough; How can I retrieve which item was clicked? The sender of the action is the actual NSPathControl, and -clickedPathComponentCell:, which works on 10.6, returns nil on 10.5. Dave On Jul 12, 2010, at 2:39 PM, Kevin Perry wrote: > Dave, > > I believe what you're seeing is the intend

Re: Finding Application support folder without Cocoa or Carbon

2010-07-12 Thread Alexander Cohen
Beautiful, thank you. AC On Jul 12, 2010, at 4:21 PM, Kevin Perry wrote: > You can use the C API in /usr/include/NSSystemDirectories.h. > > On Jul 12, 2010, at 1:17 PM, Alexander Cohen wrote: > >> Hello, >> >> I need to find the system Application Support folder without using either >> Carbo

Re: Problems with NSPathControl

2010-07-12 Thread Kevin Perry
Dave, I believe what you're seeing is the intended behavior. There are cases where developers have not wanted the URL to change when an item in the pop-up menu is selected. Instead of doing this automatically and forcing developers to prevent or undo this behavior, NSPathControl instead expects

Re: Finding Application support folder without Cocoa or Carbon

2010-07-12 Thread Laurent Cerveau
I think the lowest level you get this is with FSFindFolder laurent Sent from my road phone On Jul 12, 2010, at 10:17 PM, Alexander Cohen wrote: > Hello, > > I need to find the system Application Support folder without using either > Carbon or Cocoa, i can use CoreFoundation though. Is there

Problems with NSPathControl

2010-07-12 Thread Dave DeLong
Hi everyone, I have an NSPathControl set to the Pop Up style, with an initial path of "/Users/dave". It's restricted to items of type "public.folder". When I run this project and interact with the path control, I see a menu like this: Choose dave Users (Volum

Re: Finding Application support folder without Cocoa or Carbon

2010-07-12 Thread Jean-Daniel Dupas
Le 12 juil. 2010 à 22:17, Alexander Cohen a écrit : > Hello, > > I need to find the system Application Support folder without using either > Carbon or Cocoa, i can use CoreFoundation though. Is there a way to do this? > What prevent you to use CoreServices which is neither Carbon, nor Cocoa ?

Re: Finding Application support folder without Cocoa or Carbon

2010-07-12 Thread Kevin Perry
You can use the C API in /usr/include/NSSystemDirectories.h. On Jul 12, 2010, at 1:17 PM, Alexander Cohen wrote: > Hello, > > I need to find the system Application Support folder without using either > Carbon or Cocoa, i can use CoreFoundation though. Is there a way to do this? > > thx > > AC

Finding Application support folder without Cocoa or Carbon

2010-07-12 Thread Alexander Cohen
Hello, I need to find the system Application Support folder without using either Carbon or Cocoa, i can use CoreFoundation though. Is there a way to do this? thx AC___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin reque

Re: NSThread Subclassing problem for Singleton instance

2010-07-12 Thread Kyle Sluder
On Mon, Jul 12, 2010 at 12:33 PM, Abhinav Tyagi wrote: > Thanks for giving your valuable time to this post. > I have been working on Mac platform since last 5 months prior to which I have > worked on Windows platform. > I have used threads using  NSThread's > detachNewThreadSelector:@selector() ea

NSThread Subclassing problem for Singleton instance

2010-07-12 Thread Abhinav Tyagi
Hi, Thanks for giving your valuable time to this post. I have been working on Mac platform since last 5 months prior to which I have worked on Windows platform. I have used threads using NSThread's detachNewThreadSelector:@selector() earlier and they worked fine. However this time my thread is no

newbie core data question

2010-07-12 Thread Oftenwrong Soong
My managed classes need non-standard persistent attributes, such as CGPoint. Possibly, I'll need other C structs or enums as well. The Core Data Programming Guide section about non-standard persistent attributes (link below) says there are two ways to go about this: transformable attributes an

getting/setting "check Grammar" in spellchecker panel, without NSTextView

2010-07-12 Thread Nathaniel Cunningham
I have an application (for 10.5+) that uses spellchecking via the spellchecker panel, but does not use an NSTextView for the main text area. I can use NSSpellChecker tasks to do grammar checking as well, but the "Check Grammar" checkbox in the spellchecker panel is grayed out. The only ways to pro

Re: Use of blocks

2010-07-12 Thread Thomas Clement
On 12 juil. 2010, at 14:23, Giannandrea Castaldi wrote: > On Mon, Jul 12, 2010 at 9:43 AM, vincent habchi wrote: >> Buongiorno :) >> >> Le 12 juil. 2010 à 09:34, Giannandrea Castaldi a écrit : >> >>> I want to use blocks to extract the min price and the max price from >>> an NSArray of trips.

Re: Use of blocks

2010-07-12 Thread Marcelo Alves
On 12/07/2010, at 04:34, Giannandrea Castaldi wrote: > I've also looked for a solution with NSExpression and NSPredicate with > the function min/max but if I've correctly understood the use of > NSExpression and NSPredicate with such functions is only for CoreData. > Thanks. See the "Set and Ar

Re: Use of blocks

2010-07-12 Thread Preston Sumner
You can use key-path collection operators, assuming someTrips is a property of self: NSNumber *minPrice = [self valueForKeyPath:@"sometri...@min.adultfinalprice"]; NSNumber *maxPrice = [self valueForKeyPath:@"sometri...@max.adultfinalprice"]; By the way, minValue and maxValue in your e

Re: Use of blocks

2010-07-12 Thread Giannandrea Castaldi
Yes, as already suggested by Preston, key path operators are very expressive. Thanks for the suggestions. Jean On Mon, Jul 12, 2010 at 4:31 PM, Keith Duncan wrote: >> overkill. You can get less, faster code by using a for/in loop: >> >> float minValue = INFINITY; >> for(id obj in someTrips) >>  

Re: NSPreferencePane and sheets

2010-07-12 Thread Michael Ash
On Mon, Jul 12, 2010 at 11:30 AM, Dave DeLong wrote: > That did the trick!  Thanks! > > Out of curiosity, under what circumstances for sheet displaying should I be > using the NSApplication method? That method is for when you're building a completely custom sheet. You'd build the sheet as an NSP

Re: NSPreferencePane and sheets

2010-07-12 Thread Dave DeLong
That did the trick! Thanks! Out of curiosity, under what circumstances for sheet displaying should I be using the NSApplication method? Thanks, Dave On Jul 9, 2010, at 7:40 PM, Michael Ash wrote: > > You need to use the NSOpenPanel method > beginSheetForDirectory:file:types:modalDelegate:con

Re: Use of blocks

2010-07-12 Thread Keith Duncan
> overkill. You can get less, faster code by using a for/in loop: > > float minValue = INFINITY; > for(id obj in someTrips) >minValue = MIN(minValue, [[obj adultFinalPrice] floatValue]); You could get even less, more expressive code, using key path operators: NSNumber *minValue = [someTrips

Re: Use of blocks

2010-07-12 Thread Michael Ash
On Mon, Jul 12, 2010 at 3:34 AM, Giannandrea Castaldi wrote: > Hi, > I want to use blocks to extract the min price and the max price from > an NSArray of trips. I've found the following way: > >    float minValue = 0.0; >    [someTrips enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, > BOOL *s

Re: Use of blocks

2010-07-12 Thread Giannandrea Castaldi
On Mon, Jul 12, 2010 at 9:43 AM, vincent habchi wrote: > Buongiorno :) > > Le 12 juil. 2010 à 09:34, Giannandrea Castaldi a écrit : > >> I want to use blocks to extract the min price and the max price from >> an NSArray of trips. I've found the following way: >> >>    float minValue = 0.0; >>    [

NSCollectionView and selecting range

2010-07-12 Thread Georg Seifert
Hi, I asked this in my last post, but this was under the wrong topic. My question: In a NSCollectionView: How do I allow the range selection with the shift key (like in a tableView)? Best Regards Georg ___ Cocoa-dev mailing list (Cocoa-dev@lists.a

Re: Use of blocks

2010-07-12 Thread vincent habchi
Buongiorno :) Le 12 juil. 2010 à 09:34, Giannandrea Castaldi a écrit : > I want to use blocks to extract the min price and the max price from > an NSArray of trips. I've found the following way: > >float minValue = 0.0; >[someTrips enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, > B

Use of blocks

2010-07-12 Thread Giannandrea Castaldi
Hi, I want to use blocks to extract the min price and the max price from an NSArray of trips. I've found the following way: float minValue = 0.0; [someTrips enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { if (minValue == 0.0 || [[obj adultFinalPrice] floatValue] <