Re: Preventing View Update in NSTableView

2011-04-14 Thread Peter Lübke
Am 14.04.2011 um 04:20 schrieb Graham Cox: On 14/04/2011, at 10:13 AM, Peter Lübke wrote: I'd like to temporarily 'freeze' the cells in the table view while the data displayed in those cells are changed so they are not continuously redrawn. When the changes are completed, they should be

[ANN] Swipe Conference Australia, September 2011

2011-04-14 Thread Mark Aufflick
In case you missed the hype on twitter, Swipe Conferenceis Australia's first and only iOS & Mac Developer Conference, to be held on 5-6 September this year in Melbourne, Australia. [image: swipe.png] Learn about the latest framework

Make text field set value even if apparently unchanged

2011-04-14 Thread Jonathan Taylor
I haven't managed to work out how to get the behaviour I want from my interface, and I'm hoping somebody can help me out. It may be that I am misusing my interface elements, but any suggestions would be welcome. What I believe I want is for the appropriate setXXX method to be called when I pres

Re: Make text field set value even if apparently unchanged

2011-04-14 Thread Mike Abdullah
Bindings will not do this for you. Instead, hook your controller up to the text field's action, which will be sent every time the user hits return. On 14 Apr 2011, at 13:24, Jonathan Taylor wrote: > I haven't managed to work out how to get the behaviour I want from my > interface, and I'm hopin

Lockless thread-safe accessor using blocks: how to?

2011-04-14 Thread WT
Hi all, I've started to use GCD in my projects and I found myself using a certain pattern that I now realize isn't actually thread safe. The goal is to write a thread-safe lazy accessor without using locks, @synchronized, or an atomic property. At first I thought that - (SomeObjType) foo {

Re: Make text field set value even if apparently unchanged

2011-04-14 Thread Jonathan Taylor
On 14 Apr 2011, at 13:45, Mike Abdullah wrote: > > Bindings will not do this for you. Instead, hook your controller up to the > text field's action, which will be sent every time the user hits return. Thanks very much, that's working nicely. Requires a few more outlets etc to be set up, but I g

Re: Lockless thread-safe accessor using blocks: how to?

2011-04-14 Thread Jonathan Taylor
I am afraid I am not completely sure what you mean by your first problem, but hopefully my answer to your second one sidesteps your concern there. In answer to your second (once I had parsed out the two different uses of the word "block" in what you said!)... > The second problem is that the pa

Re: isDeletableFileAtPath: returns YES for locked files???

2011-04-14 Thread Vera Tkachenko
> Is it normal that NSFileManager's isDeletableFileAtPath: returns YES for a > locked file? Based on the result it returns, when I try to send it a > removeItemAtPath:error:, it fails and the error localized description is > '„This is a test.docx‰ couldn‚t be removed because you don‚t have perm

Cocoa witch's broom

2011-04-14 Thread Rodrigo Zanatta Silva
Hi. I am starting a project that will be a program to learn. My idea is use every single function of Cocoa framework to show any behavior. For newbie like me, same time is difficult read the Apple docs and know what the function exact do, and what object I have to use in same cases. Ok, but firstl

Re: Lockless thread-safe accessor using blocks: how to?

2011-04-14 Thread WT
Hi Jonathan, thanks for replying. On Apr 14, 2011, at 11:12 AM, Jonathan Taylor wrote: > I am afraid I am not completely sure what you mean by your first problem, That's ok. As I said, it's easy to fix. I don't want to get sidetracked here by going through it in detail. If you'd like to discus

Re: Cocoa witch's broom

2011-04-14 Thread Allyn Bauer
I'm not sure creating a program to use every method in Cocoa is such a great idea. What you should probably do instead is pick a small simple idea and implement it. Perhaps you can make an app that lists the native trees of Brazil and their diseases. :) Allyn On Apr 14, 2011, at 9:28 AM, Rodri

Re: Lockless thread-safe accessor using blocks: how to?

2011-04-14 Thread Jonathan Taylor
Hi WT, >> If I understand you correctly, what you're saying about your variable >> "__block SomeObjType foo" is not true. Regardless of the __block qualifier, >> foo is effectively a stack-based variable, so two simultaneously-executing >> threads have their own independent instance of that var

Re: Cocoa witch's broom

2011-04-14 Thread Jeff Kelley
Agreed. You wouldn’t go to the hardware store and try to build something using every product they carried. As for the English, Wikipedia has an article for “Witch’s Broom” in English, so I would go with the first (“Cocoa Witch’s Broom”). Not that I would build the app. Jeff Kelley On Thu, Apr 1

Re: Lockless thread-safe accessor using blocks: how to?

2011-04-14 Thread David Duncan
On Apr 14, 2011, at 9:19 AM, Jonathan Taylor wrote: > Hi WT, > >>> If I understand you correctly, what you're saying about your variable >>> "__block SomeObjType foo" is not true. Regardless of the __block qualifier, >>> foo is effectively a stack-based variable, so two simultaneously-executing

Re: Lockless thread-safe accessor using blocks: how to?

2011-04-14 Thread WT
On Apr 14, 2011, at 1:19 PM, Jonathan Taylor wrote: > I tested this out before replying as I wasn't 100% certain. It may be that we > have misunderstood each other somehow, but the following code (in a clean new > project) was what I used to confirm to myself that two concurrently-executing > t

Re: Lockless thread-safe accessor using blocks: how to?

2011-04-14 Thread Dave Zarzycki
On Apr 14, 2011, at 6:20 AM, WT wrote: > Hi all, > > I've started to use GCD in my projects and I found myself using a certain > pattern that I now realize isn't actually thread safe. The goal is to write a > thread-safe lazy accessor without using locks, @synchronized, or an atomic > propert

Re: Lockless thread-safe accessor using blocks: how to?

2011-04-14 Thread WT
Hi David, thanks for pitching in. On Apr 14, 2011, at 1:40 PM, David Duncan wrote: >> I tested this out before replying as I wasn't 100% certain. It may be that >> we have misunderstood each other somehow, but the following code (in a clean >> new project) was what I used to confirm to myself

Re: Lockless thread-safe accessor using blocks: how to?

2011-04-14 Thread David Duncan
On Apr 14, 2011, at 10:02 AM, WT wrote: > I looked at dispatch_once() at one point, but I'm still confused by how it > works. dispatch_once uses a predicate (just a flag) to determine if it should run the block or not. If that flag is false, then it sets the flag to true and executes the block

Re: Cocoa witch's broom

2011-04-14 Thread Rodrigo Zanatta Silva
Lol, this will be a open source project. I will not do this alone and not do in one day. Like I say, there are function in same objects that you will only understand what it do if you use it and you will lose a lot of time in this trial and error. Exist even difficult function to implement. I star

Re: Lockless thread-safe accessor using blocks: how to?

2011-04-14 Thread WT
Hi Dave, thanks for replying. I must say some of what you said went above my head. :) On Apr 14, 2011, at 2:02 PM, Dave Zarzycki wrote: >> The first is that if the method gets invoked already in the queue's >> automatic thread, there will be a deadlock. That's easy to fix, by wrapping >> the d

Re: Lockless thread-safe accessor using blocks: how to?

2011-04-14 Thread WT
On Apr 14, 2011, at 2:09 PM, David Duncan wrote: > On Apr 14, 2011, at 10:02 AM, WT wrote: > >> I looked at dispatch_once() at one point, but I'm still confused by how it >> works. > > dispatch_once uses a predicate (just a flag) to determine if it should run > the block or not. If that flag i

Re: Lockless thread-safe accessor using blocks: how to?

2011-04-14 Thread Dave Zarzycki
On Apr 14, 2011, at 10:11 AM, WT wrote: > Hi Dave, > > thanks for replying. I must say some of what you said went above my head. :) > > On Apr 14, 2011, at 2:02 PM, Dave Zarzycki wrote: > >>> The first is that if the method gets invoked already in the queue's >>> automatic thread, there will

Re: Lockless thread-safe accessor using blocks: how to?

2011-04-14 Thread David Duncan
On Apr 14, 2011, at 10:26 AM, WT wrote: > On Apr 14, 2011, at 2:09 PM, David Duncan wrote: > >> On Apr 14, 2011, at 10:02 AM, WT wrote: >> >>> I looked at dispatch_once() at one point, but I'm still confused by how it >>> works. >> >> dispatch_once uses a predicate (just a flag) to determine i

Re: Cocoa witch's broom

2011-04-14 Thread Dan Treiman
This sounds like a very interesting project. For inspiration/an example of something similar, I'd recommend taking a look at Philippe Mougin's F-Script. ( http://www.fscript.org/ ) Its a scripting system that lets you explore and manipulate cocoa objects interactively. It also is a very good l

Re: Cocoa witch's broom

2011-04-14 Thread Mike Abdullah
On 14 Apr 2011, at 18:11, Rodrigo Zanatta Silva wrote: > Lol, this will be a open source project. I will not do this alone and not do > in one day. Like I say, there are function in same objects that you will > only understand what it do if you use it and you will lose a lot of time in > this tri

Anybody using NSFileManager here?

2011-04-14 Thread Laurent Daudelin
Just wondering. I've been using it more lately and after posting a few questions over the last couple of weeks, I've been surprised by the lack of response, which might explain while it is so buggy. So, anybody on the list using NSFileManager for serious stuff besides me? -Laurent. -- Laurent

Re: Anybody using NSFileManager here?

2011-04-14 Thread Fritz Anderson
On 14 Apr 2011, at 12:51 PM, Laurent Daudelin wrote: > So, anybody on the list using NSFileManager for serious stuff besides me? Constantly, though for undemanding, synchronous tasks: Existence, deletion, creation, properties, rename, move, standard directory paths. I almost never use the POSIX

Re: Anybody using NSFileManager here?

2011-04-14 Thread Laurent Daudelin
On Apr 14, 2011, at 11:18, Fritz Anderson wrote: > On 14 Apr 2011, at 12:51 PM, Laurent Daudelin wrote: > >> So, anybody on the list using NSFileManager for serious stuff besides me? > > Constantly, though for undemanding, synchronous tasks: Existence, deletion, > creation, properties, rename,

Re: isDeletableFileAtPath: returns YES for locked files???

2011-04-14 Thread Sean McBride
On Wed, 13 Apr 2011 16:33:19 -0700, Laurent Daudelin said: >Is it normal that NSFileManager's isDeletableFileAtPath: returns YES for >a locked file? Based on the result it returns, when I try to send it a >removeItemAtPath:error:, it fails and the error localized description is >'“This is a test.d

Re: Anybody using NSFileManager here?

2011-04-14 Thread Mike Abdullah
On 14 Apr 2011, at 19:26, Laurent Daudelin wrote: > On Apr 14, 2011, at 11:18, Fritz Anderson wrote: > >> On 14 Apr 2011, at 12:51 PM, Laurent Daudelin wrote: >> > Is it normal that NSFileManager's isDeletableFileAtPath: returns YES for a > locked file? Based on the result it returns, when I t

Re: Anybody using NSFileManager here?

2011-04-14 Thread Gary L. Wade
The documentation sounds more like it's a convenience method for checking the Unix permissions for deleting the file rather than the HFS locked setting. If you want to consider another non-HFS-aware issue in NSFileManager, the file size info you get from the relevant message only returns the size

Re: Lockless thread-safe accessor using blocks: how to?

2011-04-14 Thread WT
Thanks to everyone who responded. Two things are clear: there is no one-size-fits-all answer here, and I need to do a more detailed analysis of the needs in my project. WT___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: Preventing View Update in NSTableView

2011-04-14 Thread Quincey Morris
On Apr 14, 2011, at 00:42, Peter Lübke wrote: > This is of course true if the changes are made in the main thread. > I should have mentioned that I'm changing the data in separate worker threads. > > Actually, it's possible that there are several worker threads changing data > of different table

Re: Cocoa witch's broom

2011-04-14 Thread Rodrigo Zanatta Silva
lol, bad english.. I mean use it. Use it is rare too? You can do a dynamic format to create a string. 2011/4/14 Mike Abdullah > > On 14 Apr 2011, at 18:11, Rodrigo Zanatta Silva wrote: > > > Lol, this will be a open source project. I will not do this alone and not > do > > in one day. Like I sa

Re: MPMoviePlayerController

2011-04-14 Thread Jeffrey Walton
On Wed, Apr 13, 2011 at 12:15 PM, Jeffrey Walton wrote: > Hi All, > > I'm trying to play a M4V acquired from iTunes [1]. The movie is local > and was transferred into my sandbox using iTunes via file sharing. > > Working from a Hillegass example ('Playing Movie Files', p. 294), the > player appear

Re: Anybody using NSFileManager here?

2011-04-14 Thread Laurent Daudelin
On Apr 14, 2011, at 11:38, Mike Abdullah wrote: > > On 14 Apr 2011, at 19:26, Laurent Daudelin wrote: > >> On Apr 14, 2011, at 11:18, Fritz Anderson wrote: >> >>> On 14 Apr 2011, at 12:51 PM, Laurent Daudelin wrote: >>> >> Is it normal that NSFileManager's isDeletableFileAtPath: returns YES fo

Re: Anybody using NSFileManager here?

2011-04-14 Thread Laurent Daudelin
On Apr 14, 2011, at 11:44, Gary L. Wade wrote: > The documentation sounds more like it's a convenience method for checking > the Unix permissions for deleting the file rather than the HFS locked > setting. If you want to consider another non-HFS-aware issue in > NSFileManager, the file size info

Re: Cocoa witch's broom

2011-04-14 Thread Shawn Erickson
On Thu, Apr 14, 2011 at 11:52 AM, Rodrigo Zanatta Silva wrote: > lol, bad english.. I mean use it. > > Use it is rare too? You can do a dynamic format to create a string. Using format strings to create human viewed strings is very common and in fact the best way to create such strings when consid

Re: Anybody using NSFileManager here?

2011-04-14 Thread Quincey Morris
On Apr 14, 2011, at 12:35, Laurent Daudelin wrote: > In my app, I want to provide file operation but try to restrict them if > they're going to fail. I still handle the failures in my code but I feel it's > a better user experience that they know in advance, for example, that a file > is locked

Re: UIViewControllers being reloaded on didReceiveMemoryWarning... ?

2011-04-14 Thread Martin Linklater
Thanks for the help guys. That makes a lot of sense now. On 14 Apr 2011, at 01:53, Matt Neuburg wrote: > On Wed, 13 Apr 2011 16:42:40 -0700, Chris Parker said: >>> 2011-04-14 00:03:09.640 CRDev[18309:307] InGameViewController >>> implementation of -viewDidUnload caused the view to be reloaded.

Re: Anybody using NSFileManager here?

2011-04-14 Thread Laurent Daudelin
On Apr 14, 2011, at 13:16, Quincey Morris wrote: > On Apr 14, 2011, at 12:35, Laurent Daudelin wrote: > >> In my app, I want to provide file operation but try to restrict them if >> they're going to fail. I still handle the failures in my code but I feel >> it's a better user experience that th

Re: Anybody using NSFileManager here?

2011-04-14 Thread Quincey Morris
On Apr 14, 2011, at 13:26, Laurent Daudelin wrote: > it seems to me that if a file is locked, it's pretty obvious it can't be > deleted Sure it can. Unlock it and delete it. I'm only half joking here. My point is there are a lot of definitions of deletability: -- "Ideal" deletability, which w

Adding custom view in IB

2011-04-14 Thread Luc Van Bogaert
Hi, I know how to subclass NSView to create a custom view, and add it to a window as a subview using interface builder. But when I want to control my custom view with a viewcontroller object, both contained in a seperate nib file, I'm getting a bit confused about how I can use IB to do the sam

Re: Lockless thread-safe accessor using blocks: how to?

2011-04-14 Thread Jason Harris
On Apr 14, 2011, at 7:44 PM, David Duncan wrote: > On Apr 14, 2011, at 10:26 AM, WT wrote: > >> On Apr 14, 2011, at 2:09 PM, David Duncan wrote: >> >>> On Apr 14, 2011, at 10:02 AM, WT wrote: >>> I looked at dispatch_once() at one point, but I'm still confused by how it works. >>>

Re: Preventing View Update in NSTableView

2011-04-14 Thread Peter Lübke
Silly me! The data model objects *do *set some of their bound ivars when performing the task in question on the background thread (writing to files, sending apple events ...). I was using a data source before, so this was no problem. I just rewrote my code to use bindings / NSArrayControlle

NSBrowser Drag and Drop Issue !!

2011-04-14 Thread Naresh Kongara
HI All, I implemented drag and drop in NSBrowser, through which I can drag items from other views or windows of the applications. The drag and drop in NSBrowser is implemented through its delegate methods. Everything is going fine except I'm getting the following exception while dropping, after

Re: Lockless thread-safe accessor using blocks: how to?

2011-04-14 Thread Ken Thomases
On Apr 14, 2011, at 4:40 PM, Jason Harris wrote: > On Apr 14, 2011, at 7:44 PM, David Duncan wrote: > >> The lifetime of the predicate needs to match that of the initialization done >> by the block. If the block's initialization is done for an instance >> variable, then the predicate should als

renaming directories and moving files into them (NSFileManager)

2011-04-14 Thread Scott Anguish
OK, before anyone asks... I’m working on a tool for my own use, and so I don’t want to bug people at work about it. Thus, I bug you. :-) I’m perplexed by this one. I’m trying something stupidly simple, and I’m getting really odd results. I have an app that sorts a bunch of files and sticks the

Re: renaming directories and moving files into them (NSFileManager)

2011-04-14 Thread Ken Thomases
On Apr 15, 2011, at 12:47 AM, Scott Anguish wrote: > I have an app that sorts a bunch of files and sticks them in a newly made > directories. When it finds a file that identifies WhereFroms (via spotlight, > from a downloaded file) I want it to rename that directory and then copy the > rest of

Print Sheet: not changing when printinfo changed.

2011-04-14 Thread Kevin Bracey
Hi, this is a query for the Print Sheet wizards. I have a print job, that has 2 different report views, I have a custom AccessoryView that toggles the views, all working well. One report is best viewed in Landscape while the other in Portrait. Now I can change this via setOrientation, when togg

Re: renaming directories and moving files into them (NSFileManager)

2011-04-14 Thread Scott Anguish
On Apr 15, 2011, at 2:05 AM, Ken Thomases wrote: > On Apr 15, 2011, at 12:47 AM, Scott Anguish wrote: > >> I have an app that sorts a bunch of files and sticks them in a newly made >> directories. When it finds a file that identifies WhereFroms (via spotlight, >> from a downloaded file) I want

Searchable Cocoa and Carbon APIs?

2011-04-14 Thread li...@mgreg.com
Hi All, Probably been asked a million times before, but I'm looking for Apple's searchable Cocoa and Carbon APIs. In the past, I could enter something like "double click" in the search and it would return a reference to something like "GetDblTime()". Now about 80% of my searches return nothin

Looking to brush up on XCode from the desktop (a.k.a. non-iOS) perspective.

2011-04-14 Thread li...@mgreg.com
Hi All, It's been a while since my last foray into the world of Xcode programming. That said, I've recently purchased XCode 4 and am looking for some up-to-date casts, tutorials, information to brush up. One catch: I would appreciate something that is not completely (or even partially for th