Re: How to get the dispatch queue for the current thread's runloop?

2012-01-27 Thread Shane Stanley
On 28/01/2012, at 1:41 PM, Ken Thomases wrote: > Believe it or not, this also works: > >[(id)^{ ... code here ... } performSelector:@selector(invoke) > withObject:nil afterDelay:5.0]; > > That is, you can target performSelector:withObject:afterDelay: at a block, > itself, rather than some

Trying to customize UITableViewCell with IB but having odd exception

2012-01-27 Thread James West
In two classes, I've subclassed UITableViewCell in order to do some major customization. I'd like to use a Xib file to keep the amount of UI layout code to a minimum. I'm coming across an odd exception: if (!cell) { if (indexPath.row == 0) { cell = [[[SearchCellTop alloc]

Blocks and Methods...

2012-01-27 Thread R
I'm writing code in for iOS 5 Ok, in my async com class, I'm receiving a block in one method and want to execute it in the another method. I've concluded that I need to place the block in a property. The only way that has worked is via copy. Is this the conventional way to save a block? Th

NSRuleEditor templates?

2012-01-27 Thread Erik Stainsby
Hello list, Forgive me if this has been asked and answered, but what does one do in XC4.2 to create the requisite rule editor templates? I find nothing useful in the docs on this topic, and the only example code used IB 3.0 to do this task. Help? Erik

Re: Recently Opened in Doc

2012-01-27 Thread James Merkel
On 27 Jan 2012 10:20:37 Brad Stone wrote: > I'd like to > 1) change the menu titles of the recently opened documents listed in the dock > menu > > if I can't do that I'd like to > > 2) remove the list of recently opened documents all together. > > I haven't been able to find a way to do this.

Re: How to get the dispatch queue for the current thread's runloop?

2012-01-27 Thread Ken Thomases
On Jan 27, 2012, at 2:14 PM, Jens Alfke wrote: > I'm really used to using -performSelector:withObject:afterDelay: to make > something happen later. But I'd much rather use a block than a target/action. > I can't find any API for this, however. Am I missing something? What I want > is basically

Re: How to get the dispatch queue for the current thread's runloop?

2012-01-27 Thread Dave Keck
Hi Jens, My understanding is that dispatch queues are tied to threads that are managed by the system and are separate from run loops. It's therefore non-sensical to ask for a runloop's queue. Regardless though, I think a better solution for you is a category on NSTimer. I use something like the f

Re: How to get the dispatch queue for the current thread's runloop?

2012-01-27 Thread Kyle Sluder
On Fri, Jan 27, 2012 at 3:52 PM, Jens Alfke wrote: > I think you've got it backwards. You're assuming I've got a dispatch queue > and want to know the thread. But what I've actually got is a thread and I > want a dispatch queue that will run on that thread (in synchrony with the > runloop.) This

Re: How to get the dispatch queue for the current thread's runloop?

2012-01-27 Thread Jens Alfke
On Jan 27, 2012, at 2:52 PM, Kyle Sluder wrote: > My understanding is that you should treat the thread pool owned by a > dispatch queue as private. That means you probably shouldn't be > running an NSRunLoop on a dispatch worker thread. > If you need a thread (including cases where you need to ru

Re: How to get the dispatch queue for the current thread's runloop?

2012-01-27 Thread Jens Alfke
On Jan 27, 2012, at 2:50 PM, Wade Tregaskis wrote: >> It looks like I should just call dispatch_async, but I'm unsure which >> dispatch queue to use. dispatch_get_main_queue only works for the main >> thread. Can I use dispatch_get_current_queue? I'm unsure of what this does >> when called on

Re: How to get the dispatch queue for the current thread's runloop?

2012-01-27 Thread Kyle Sluder
On Fri, Jan 27, 2012 at 12:14 PM, Jens Alfke wrote: > I'm really used to using -performSelector:withObject:afterDelay: to make > something happen later. But I'd much rather use a block than a target/action. > I can't find any API for this, however. Am I missing something? What I want > is basic

Re: How to get the dispatch queue for the current thread's runloop?

2012-01-27 Thread Wade Tregaskis
> It looks like I should just call dispatch_async, but I'm unsure which > dispatch queue to use. dispatch_get_main_queue only works for the main > thread. Can I use dispatch_get_current_queue? I'm unsure of what this does > when called on a background thread. The API docs say "If the call is mad

Re: How to get the dispatch queue for the current thread's runloop?

2012-01-27 Thread Jens Alfke
On Jan 27, 2012, at 2:23 PM, Dave Fernandes wrote: > dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), > ^{}); I want the block to run on the thread that's making this call. The global queue's not going to do that. —Jens ___

Re: Full-Height Toolbar Item

2012-01-27 Thread Preston Sumner
On Jan 26, 2012, at 5:28 PM, Mark Alldritt wrote: > Hi Everyone, > > I'm looking for a way to make a view-based Toolbar Item that occupies the > full height of the toolbar (i.e. including the space normally reserved for > the toolbar item's label). Xcode 4 does this for its "status" display, a

Re: How to get the dispatch queue for the current thread's runloop?

2012-01-27 Thread Conrad Shultz
On 1/27/12 12:14 PM, Jens Alfke wrote: > I'm really used to using -performSelector:withObject:afterDelay: to > make something happen later. But I'd much rather use a block than a > target/action. I can't find any API for this, however. Am I missing > something? What I want is basically like Perform

Re: How to get the dispatch queue for the current thread's runloop?

2012-01-27 Thread Dave Fernandes
This works: dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{}); On 2012-01-27, at 3:14 PM, Jens Alfke wrote: > I'm really used to using -performSelector:withObject:afterDelay: to make > something happen later. But I'd much rather use a block than a target/action.

Re: How to get the dispatch queue for the current thread's runloop?

2012-01-27 Thread Marco Tabini
On 2012-01-27, at 2:14 PM, Jens Alfke wrote: > I'm really used to using -performSelector:withObject:afterDelay: to make > something happen later. But I'd much rather use a block than a target/action. > I can't find any API for this, however. Am I missing something? What I want > is basically li

How to get the dispatch queue for the current thread's runloop?

2012-01-27 Thread Jens Alfke
I'm really used to using -performSelector:withObject:afterDelay: to make something happen later. But I'd much rather use a block than a target/action. I can't find any API for this, however. Am I missing something? What I want is basically like PerformBlockAfterDelay(^{ …code here…}, 5.0

Re: Full-Height Toolbar Item

2012-01-27 Thread David Catmull
On Jan 27, 2012, at 12:27 PM, Jens Alfke wrote: > The good news is that these APIs often become public in later OS releases, > especially if developers file bugs clamoring for them (hint hint). Done: bug 10766939. -- David Catmull uncom...@uncommonplace.com __

Re: Full-Height Toolbar Item

2012-01-27 Thread Jens Alfke
On Jan 27, 2012, at 8:51 AM, David Catmull wrote: > I've looked into this too, and haven't found an answer yet. According to this > article, Xcode used to use a floating window trick: > http://stackoverflow.com/questions/6169255/is-it-possible-to-draw-in-the-label-area-of-nstoolbar > ..but it do

Re: afterDelay not working?

2012-01-27 Thread Jens Alfke
On Jan 26, 2012, at 9:51 PM, Dave Keck wrote: > I imagine your run loop isn't being allowed to run in the default mode > (NSDefaultRunLoopMode). ... > Perhaps this occurring while the user's dragging something around in your > view? Good point. Another case where this can bite you is while you'

Re: Full-Height Toolbar Item

2012-01-27 Thread John Pannell
Hi Mark- I have an app that has such an appearance… http://www.positivespinmedia.com/BombSquad/screenshots.html There's a couple ways to go about it… in a different project, I used NSToolbar, but disabled customization for it and set it to display "Icon-only" (no labels). [toolbar setAllowsUse

Re: Full-Height Toolbar Item

2012-01-27 Thread David Catmull
On Jan 26, 2012, at 9:03 PM, Mark Alldritt wrote: > I'm looking for a way to make a view-based Toolbar Item that occupies the > full height of the toolbar (i.e. including the space normally reserved for > the toolbar item's label). Xcode 4 does this for its "status" display, and I > have a sim

Re: How to open CMYK TIF in Cocoa?

2012-01-27 Thread Todd Freese
I stand corrected as I have learned a lot more about this. They are premultiplied. Even though I got my feature working using libTiff, I like Jens idea of just walking thru the alpha data and manually setting the values. This would save having yet another lib linked in and seems to be a cleaner

Re: How to open CMYK TIF in Cocoa?

2012-01-27 Thread Fritz Anderson
Are the pixels "not there," or are they premultiplied? — F On 26 Jan 2012, at 8:21 PM, Todd Freese wrote: > The issue is that it only loads the pixels that are allowed by the alpha. > Almost no graphic program does this. It should load

Recently Opened in Doc

2012-01-27 Thread Brad Stone
I'd like to 1) change the menu titles of the recently opened documents listed in the dock menu if I can't do that I'd like to 2) remove the list of recently opened documents all together. I haven't been able to find a way to do this. Can someone provide guidance? Thanks ___

Re: boundingRectWithSize problem?

2012-01-27 Thread Tony Pollard
Good thought Tim, but for some reason it doesn't work in this case (both on 10.6 & 10.7). As you would expect, it is size/font sensitive so I can get the same failure result (for the sample text given) with Times-Roman 11 point. Of the various text samples, it's only 1 in 10,000 or so that do

CoreData, and design of document model

2012-01-27 Thread David Mirabito
Hi, I have the beginnings of a Document-based App, with CoreData. I don't expect to get the model 100% perfect from day-1 but neither do I want to begin with fundamentally incorrect approach. Let's say my model looks something like this: System -> various metadata properties (name, comments,