Re: allKeys and allValues

2010-10-05 Thread gMail.com
Hi Dave, Thanks. Your solution seems to be fine NSArray * allKeys = [dictionary allKeys]; NSArray * allValues = [dictionary objectsForKeys:allKeys notFoundMarker:[NSNull null]]; I also took a better look at the iTunes Music Library.xml dictionary, and there is a fine trick. The Tracks dictionary

Confused about floats

2010-10-05 Thread Amy Heavey
I've got two float values (x and y) that I'm using to change the coordinates of a drawing action that is being looped through. I can add a value to x and it draws the next image along, but I want to test the value of x and if it is out of bounds I want to reset it to zero and increase y, so

FSCatalogSearch miss file

2010-10-05 Thread Robert Černý
Hello folks, I'm using FSCatalogSearch to find files on HFS+ formatted RAID and found that I don't have one file in the search results. There is nothing different on the file (permissions, special characters etc). Does anybody have an idea what could be wrong? Corrupted index? Thanks Robert __

Partially opaque window with opaque views

2010-10-05 Thread Trygve Inda
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? My NSWindow subclass looks like: [self setOpaque:NO]; [self setHasShadow: YES]; [self setLevel:NSFlo

NSOutlineView multi cell type binding query

2010-10-05 Thread jonat...@mugginsoft.com
Morning My NSOutlineView binds its NSTableColumn instances to NSTextFieldCells using NSValueBinding. Some cells are required to contain NSPopUpButtonCell instances so the cell type is manipulated in - outlineView:dataCellForTableColumn:item: NSPopUpButtonCell doesn't support value binding so t

Re: Partially opaque window with opaque views

2010-10-05 Thread Matt Gough
Yes, but you should leave the window's alpha at 1.0. Off top of my head, it goes something like this: Create a subclass of NSView and set that class as the class for the contentView of the window (in IB) Change that class's drawRect to : - (void)drawRect:(NSRect)rect { // Clear the drawin

Unable to play a .mp3 file directly using QTMovie

2010-10-05 Thread Devarshi Kulshreshtha
Hi all, I am trying to play a .mp3 file on click of a button using this code: NSString *audioFilePath=[[audioInputTextField stringValue] stringByAddingPercentEscapesUsingEncoding:NSUTF8Strin

Re: Confused about floats

2010-10-05 Thread Gregory Weston
Amy Heavey wrote: > I've got two float values (x and y) that I'm using to change the > coordinates of a drawing action that is being looped through. I can > add a value to x and it draws the next image along, but I want to test > the value of x and if it is out of bounds I want to reset it t

Checking for nil-return

2010-10-05 Thread Remco Poelstra
Hi, I'm cleaning up my code and I'm wondering about constructs like the next one: [NSNumber numberWithUnsignedChar:i] The documentation does not say it can return nil on failure, but does that mean it simply will never fail? What if there is no memory left? Kind regards, Remco Poelstra

Re: Checking for nil-return

2010-10-05 Thread Dave DeLong
Then you have much bigger problems. Sent from my iPhone On Oct 5, 2010, at 8:07 AM, Remco Poelstra wrote: > What if there is no memory left? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comme

Re: Checking for nil-return

2010-10-05 Thread Remco Poelstra
Op 5-10-2010 16:11, Dave DeLong schreef: Then you have much bigger problems. I already thought so :). But I noticed that [NSArray arrayWithCapacity] also never returns nil. But I can create a very large array, and I can make it bigger with addObjects:atIndexes: and that function returns void

Re: Checking for nil-return

2010-10-05 Thread Matt Gough
On 5 Oct 2010, at 15:18:06, Remco Poelstra wrote: > Op 5-10-2010 16:11, Dave DeLong schreef: >> Then you have much bigger problems. > > I already thought so :). But I noticed that [NSArray arrayWithCapacity] also > never returns nil. But I can create a very large array, and I can make it > big

Re: Checking for nil-return

2010-10-05 Thread Remco Poelstra
Op 5-10-2010 16:23, Matt Gough schreef: On 5 Oct 2010, at 15:18:06, Remco Poelstra wrote: Op 5-10-2010 16:11, Dave DeLong schreef: Then you have much bigger problems. I already thought so :). But I noticed that [NSArray arrayWithCapacity] also never returns nil. But I can create a very lar

Re: How to get selected text in a WebView

2010-10-05 Thread Gerriet M. Denkmann
On 5 Oct 2010, at 17:56, "Gary L. Wade" wrote: > Was there a problem with what dr.text or [dr toString] returned after your > first line? There was not (and now that I tried it: there is not) - but there was (and is) a problem with the documentation: Xcode only shows me the "DOMRange Addition

RE: Confused about floats

2010-10-05 Thread Shawn Bakhtiar
Also if x is a float, make sure you use the proper type cast, or values, ie ( x = x + 120.00) or (x = y + (double)z , where x and y are double and z is an int). Remember int, float, double, are C types, and typecasting rules should be in effect. > From: gwes...@mac.com > Date: Tue, 5 Oct

Re: Confused about floats

2010-10-05 Thread Scott Ribe
On Oct 5, 2010, at 8:51 AM, Shawn Bakhtiar wrote: > Also if x is a float, make sure you use the proper type cast, or values, ie > ( x = x + 120.00) or (x = y + (double)z , where x and y are double and z is > an int). That is *completely* unnecessary and pointless. -- Scott Ribe scott_r...@e

RE: Confused about floats

2010-10-05 Thread Shawn Bakhtiar
Eh? Did you just call typecasting "*completely* unnecessary and pointless"... Can you please explain? I have plenty of C code, in *.c files that would disagree with you. You may be correct in that in Objective-C this may no longer be an issue, as the compiler does your work for you, but th

Re: Confused about floats

2010-10-05 Thread Matt Neuburg
On Tue, 5 Oct 2010 10:17:31 +0100, Amy Heavey said: >//select all images for kit > NSArray* kitImages = [kit >valueForKeyPath:@"kitItems.kitItemProduct.productImage"]; > >//set coordinates to x,y -> 0,0 to start >float x = 0; >float y = 0; >//for each image >NSEnume

Re: Confused about floats

2010-10-05 Thread Kyle Sluder
On Tue, Oct 5, 2010 at 8:16 AM, Shawn Bakhtiar wrote: > > > Eh? > > Did you just call typecasting  "*completely* unnecessary and pointless"... No, he called the specific casting you were performing unnecessary and pointless, which it is. The arithmetic conversion rules say that the integer liter

Re: Confused about floats

2010-10-05 Thread Kyle Sluder
On Tue, Oct 5, 2010 at 8:20 AM, Kyle Sluder wrote: > The arithmetic conversion rules say that the integer literals will be > promoted to the appropriate floating point type. So this is perfectly > fine and does exactly what you expect: P.S. The promotion doesn't only apply to literals but to othe

Re: Confused about floats

2010-10-05 Thread Scott Ribe
On Oct 5, 2010, at 9:16 AM, Shawn Bakhtiar wrote: > Did you just call typecasting "*completely* unnecessary and pointless"... No, I called typecasting an int type to a floating type, in order to add it to a floating type, unnecessary and pointless. > You may be correct in that in Objective-C t

Re: Confused about floats

2010-10-05 Thread Velocityboy
Both C and Objective-C support implicit casting for the primitive types. float f = 100.0f; f += 100; will give the expected result, because the compiler will see (float) + (int) and cast the int to a float automatically. The conversion rules are part of the ANSI C standard and apply in Objectiv

Re: Unable to play a .mp3 file directly using QTMovie

2010-10-05 Thread Nick Zitzmann
On Oct 5, 2010, at 6:23 AM, Devarshi Kulshreshtha wrote: > I am trying to play a .mp3 file on click of a button using this code: > > NSString > > *audioFilePath=[[audioInputTextField stringV

Re: Confused about floats

2010-10-05 Thread Corbin Dunn
On Oct 5, 2010, at 2:17 AM, Amy Heavey wrote: > I've got two float values (x and y) that I'm using to change the coordinates > of a drawing action that is being looped through. I can add a value to x and > it draws the next image along, but I want to test the value of x and if it is > out of b

RE: Confused about floats

2010-10-05 Thread Shawn Bakhtiar
:*S Yes... I see the point. Correct. For a constant value this is true, in the instance of x = x + 1 (which I see where the error was), where x is a float this makes no difference. However, for clarity of the OP, x = x + y where y is an int, should be typecast correctly as x = x + (float)y

Re: Confused about floats

2010-10-05 Thread Amy Heavey
Thanks for all the help everyone, I'll take a look at it all, and release where I need to! Many Thanks Amy On 5 Oct 2010, at 4:17PM, Matt Neuburg wrote: On Tue, 5 Oct 2010 10:17:31 +0100, Amy Heavey > said: //select all images for kit NSArray* kitImages = [kit valueForKeyPath:@"kitI

Re: Confused about floats

2010-10-05 Thread Velocityboy
You can, but again this is just being explicit - the compiler bases promotion decisions on type alone, not whether or not an expression is a constant or a variable. The one important thing to remember is that promotion of assignment is applied *after* the RHS is evaluated, i.e. float f = 1 /

Re: Confused about floats

2010-10-05 Thread Scott Ribe
On Oct 5, 2010, at 9:32 AM, Shawn Bakhtiar wrote: > However, for clarity of the OP, x = x + y where y is an int, should be > typecast correctly as x = x + (float)y Why? The two are exactly equivalent. Now if you want to do so as a stylistic preference, that's fine, but there's no "should" abo

JDBC from Cocoa or the like

2010-10-05 Thread colors
Is there a framework, or set of APIs or samples available from Apple or others to do SQL server accesses? I have looked at easyDB, but its license makes it a non-starter. I have also looked at freetds, but it does not look like it is ready for prime time (let along particularly good in the Mac

Re: JDBC from Cocoa or the like

2010-10-05 Thread Kyle Sluder
On Tue, Oct 5, 2010 at 9:03 AM, colors wrote: > Is there a framework, or set of APIs or samples available from Apple or > others to do SQL server accesses?  I have looked at easyDB, but its license > makes it a non-starter.  I have also looked at freetds, but it does not look > like it is ready

Re: Checking for nil-return

2010-10-05 Thread Dave Keck
> Because it throws exceptions if anything bad happens at runtime (i.e out of > memory, invalid parameters etc) If memory truly becomes exhausted (as opposed to attempting to allocate a huge object), you'll crash due to a stack overflow since the code path of throwing an exception allocates objec

Re: Checking for nil-return

2010-10-05 Thread Greg Parker
On Oct 5, 2010, at 7:07 AM, Remco Poelstra wrote: > I'm cleaning up my code and I'm wondering about constructs like the next one: > [NSNumber numberWithUnsignedChar:i] > The documentation does not say it can return nil on failure, but does that > mean it simply will never fail? What if there is no

Re: JDBC from Cocoa or the like

2010-10-05 Thread Alex Kac
I saw this ODBC framework for iOS. Maybe that helps as well: http://www.prlog.org/10938886-open-database-connectivity-odbc-arrives-for-apple-ipad-iphone-and-ipod-touch.html One problem I've always had with the N-tier arch is that of customer security. Many companies simply won't use an app that d

Re: Confused about floats

2010-10-05 Thread Amy Heavey
Got it working, Part of my issue seemed to be my logic. 300 is the bounds of my target image, and I have planned it so images fit inside this, so x would end up being 300. In a stupid moment, I set the if statement to run if x>300, which initially it wouldn't be as it would actually equal 3

Re: Confused about floats

2010-10-05 Thread Scott Ribe
On Oct 5, 2010, at 11:18 AM, Amy Heavey wrote: > I changed it to > 299 and voila it worked. I did also have to (is the term > cast?) the 299 to a float. Yes, the term is "cast". No you didn't need to cast 299 to a float. It's not wrong to do so, just unnecessary. (And, if you care, you could

Re: Confused about floats

2010-10-05 Thread Matt Neuburg
On 10/5/10 10:18 AM, thus spake "Amy Heavey" : >I'm googling Fast Enumeration, but I'm compiling for 10.5, > > Fast enumeration is present in 10.5. m. -- matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/ pantes anthropoi tou eidenai oregontai phusei Among the 2007 MacTech Top 2

Disable NSSavePanel's New Folder button dynamically?

2010-10-05 Thread Kevin Wojniak
I'm assuming the answer is no, as I've looked over the documentation, but just incase I missed something: is there a way to prevent NSSavePanel's "New Folder" button from being enabled on the fly? For certain volumes, I don't want them to be chosen (which I can already do), but I also don't wan

Re: Disable NSSavePanel's New Folder button dynamically?

2010-10-05 Thread Sherm Pendley
On Tue, Oct 5, 2010 at 2:17 PM, Kevin Wojniak wrote: > I'm assuming the answer is no, as I've looked over the documentation, but > just incase I missed something: is there a way to prevent NSSavePanel's "New > Folder" button from being enabled on the fly? [thePanel setCanCreateDirectories:NO];

Re: Disable NSSavePanel's New Folder button dynamically?

2010-10-05 Thread Kevin Wojniak
You know, I thought I was using that method all this time, but it seems I was using setCanChooseDirectories: instead, and even my email indicated that. It's been a long morning ;-) Thanks. On Oct 5, 2010, at 11:35 AM, Sherm Pendley wrote: > On Tue, Oct 5, 2010 at 2:17 PM, Kevin Wojniak wrote

Problem with MakeKeyandOrderFront

2010-10-05 Thread Amy Heavey
My app has a secondary view that appears when I click a button (to do another task) it works fine most of the time. It's a core data app that uses an xml file store. I've started adding data so there's now maybe 1000 instances of an entity in it, and I've not started adding other entities o

Re: Instantly delete a directory without recursion?

2010-10-05 Thread Michael Watson
You should /always/ perform I/O on a secondary thread whenever possible. Every I/O you perform on the UI thread is an opportunity for hangs or unresponsiveness. Grand Central Dispatch is your friend here. -- michael On 04 Oct, 2010, at 05:54, Guillem Palou wrote: > I don't think so, > > If t

Re: Problem with MakeKeyandOrderFront

2010-10-05 Thread Ken Thomases
On Oct 5, 2010, at 1:55 PM, Amy Heavey wrote: > Now when I click the button the focus goes from the main window but the > second window doesn't appear. If I move the data file it works fine. Have I > just overloaded it already? Even if all I do is open the app and go to the > second tab and cli

Re: Instantly delete a directory without recursion?

2010-10-05 Thread Shawn Erickson
On Tue, Oct 5, 2010 at 12:48 PM, Michael Watson wrote: > You should /always/ perform I/O on a secondary thread whenever possible. > Every I/O you perform on the UI thread is an opportunity for hangs or > unresponsiveness. Grand Central Dispatch is your friend here. Maybe better said in an "you

Re: Problem with MakeKeyandOrderFront

2010-10-05 Thread Amy Gibbs
I'll give that a go however it works fine in Xcode and by itself with a blank/new data file Sent from my iPhone On 5 Oct 2010, at 20:59, Ken Thomases wrote: > On Oct 5, 2010, at 1:55 PM, Amy Heavey wrote: > >> Now when I click the button the focus goes from the main window but the >> second

NSImage is Caching

2010-10-05 Thread Chris Tracewell
I have an NSImageView that accepts an image drop then sizes the image and ftp's it to a web server. The image view is bound to myObject.myImage property which set by a window controller calling its loadMyImage every time the window opens... -(void)loadMyImage { NSImage *theImag

Re: NSImage is Caching

2010-10-05 Thread Jonathon Kuo
You're missing a [theImage release] at the end of your method. On Oct 5, 2010, at 2:46 PM, Chris Tracewell wrote: > I have an NSImageView that accepts an image drop then sizes the image and > ftp's it to a web server. The image view is bound to myObject.myImage > property which set by a window

Re: NSImage is Caching

2010-10-05 Thread Chris Tracewell
Shoulda said I'm using GC On Oct 5, 2010, at 2:56 PM, Jonathon Kuo wrote: > You're missing a [theImage release] at the end of your method. > > On Oct 5, 2010, at 2:46 PM, Chris Tracewell wrote: > >> I have an NSImageView that accepts an image drop then sizes the image and >> ftp's it to a web

Re: NSOutlineView multi cell type binding query

2010-10-05 Thread Quincey Morris
On Oct 5, 2010, at 03:53, jonat...@mugginsoft.com wrote: > However it appears that the binding machinery causes the NSPopUpButtonCell > selection to be reset after the user has interacted with the control. > > I therefore have to resync the NSPopUpButtonCell selection to the model in - > outlin

Re: NSOutlineView multi cell type binding query

2010-10-05 Thread jonat...@mugginsoft.com
On 5 Oct 2010, at 23:03, Quincey Morris wrote: > On Oct 5, 2010, at 03:53, jonat...@mugginsoft.com wrote: > >> However it appears that the binding machinery causes the NSPopUpButtonCell >> selection to be reset after the user has interacted with the control. >> >> I therefore have to resync th

Re: NSOutlineView multi cell type binding query

2010-10-05 Thread Quincey Morris
On Oct 5, 2010, at 15:36, jonat...@mugginsoft.com wrote: > I have a separate NSPopUpButtonCell that I recycle and configure as and when > required. > The issue is that when the NSPopUpButtonCell is selected and the user selects > an item from the popup NSMenu the user's selection is reset. > ie:

Problem connecting to Oracle with app run from XCode

2010-10-05 Thread Timothy Mowlem
Hello, I am trying to get OCILib (http://orclib.sourceforge.net/), a free Oracle library, running on MacOSX. I have built the library from source and successfully run a test class via the terminal containing the example code in the OCILib documentation. As an experiment I have created a Cocoa a

Re: NSOutlineView multi cell type binding query

2010-10-05 Thread Corbin Dunn
On Oct 5, 2010, at 3:36 PM, jonat...@mugginsoft.com wrote: > > On 5 Oct 2010, at 23:03, Quincey Morris wrote: > >> On Oct 5, 2010, at 03:53, jonat...@mugginsoft.com wrote: >> >>> However it appears that the binding machinery causes the NSPopUpButtonCell >>> selection to be reset after the use

Re: Problem with MakeKeyandOrderFront

2010-10-05 Thread Amy Heavey
nothing in the main console app. I only have this problem using the large data file I've created. I've been adding data to the app and now this just won't work. If I move the xml file or the app it's fine. It's fine running in xcode too. I think I'll have to move to an sqllite store and sta