iPad animations are backwards for some orintations.

2010-05-25 Thread Scott Andrew
So i have an app that I want to use the curl up UIView animation transition in. however when the iPad his held in either the upside down portrait or upside down landscape (button on right) the transitions are backwards. All controls on the views move however.

Re: Creating a PDFSelection...

2010-05-25 Thread Matthew Weinstein
Actually, I don't need the tiff; I just need the rectangle! People have to be able to sketch the rectangle over the pdf, and then my program stores and restores those rectangles (with some additional information). On May 25, 2010, at 9:15 PM, Antonio Nunes wrote: > On 26 May 2010, at 03:01, Ma

Re: reformat drive to HFS via API

2010-05-25 Thread John Johnson
The DiskManagement.framework is a private framework. Short of creating your own API using low-level disk access, diskutil may be your best bet. > I would like to be able to reformat a flash drive from control application, > but it appears that there is no public API that allows this kind access.

Re: IKImageView Question

2010-05-25 Thread Scott Anguish
Another solution for conversion is using -CGImage on NSBitmapImageRep. On May 24, 2010, at 5:53 PM, Brian Postow wrote: > > On May 24, 2010, at 5:36 PM, wrote: > >> I've been trying a few tests with IKImageView to view an EPS file with >> zooming capabilities. Some code that Apple provide

Re: Creating a PDFSelection...

2010-05-25 Thread Antonio Nunes
On 26 May 2010, at 03:01, Matthew Weinstein wrote: > The PDFSelection class as far as I can tell basically supports what in > Preview.app is the "text" tool on the toolbar. The selection tool in > Preview.app selects an arbitrary rectangle, even if there's no text behind > the image. > > So,

Re: IKImageView Question

2010-05-25 Thread Scott Anguish
On May 24, 2010, at 5:53 PM, Brian Postow wrote: > > Yeah, If you look further down in the documentation, you'll see that there IS > no setImage: NSImage. I've been through this with Apple. Officially, this is > a bug IN THE DOCUMENTATION. Any setImage: NSImage method that exists is > undocum

Re: UITabBar as a UISegmentedControl???

2010-05-25 Thread Luke the Hiesterman
While this may be possible, it doesn't sound like a good idea. The big question it raises is why do you want to do this? As you have of course observed, we already have UISegmentedControls. What are you trying to accomplish? Luke On May 25, 2010, at 6:23 PM, Alejandro Marcos Aragón wrote: > Hi

Re: Creating a PDFSelection...

2010-05-25 Thread Matthew Weinstein
António, that's exactly what I needed. But it leads to my next question. The PDFSelection class as far as I can tell basically supports what in Preview.app is the "text" tool on the toolbar. The selection tool in Preview.app selects an arbitrary rectangle, even if there's no text behind the

Re: set custom formatter in IB

2010-05-25 Thread Keary Suska
On May 25, 2010, at 4:14 PM, Rainer Standke wrote: > I am trying to associate a custom formatter with a text filed in IB. Having > no luck with with either dragging out of 'Classes' or instantiating and then > dragging out of the .xib window. > > Do I have to do this programmatically? You may

Re: reformat drive to HFS via API

2010-05-25 Thread Jens Alfke
On May 25, 2010, at 12:44 PM, r c wrote: > I would like to be able to reformat a flash drive from control application, > but it appears that there is no public API that allows this kind access. Am > I missing something in the documentation? Or do I do something like call out > to diskutil to

Re: -[NSMutableSet randomObject]

2010-05-25 Thread Jens Alfke
On May 25, 2010, at 9:49 AM, Michael A. Crawford wrote: >// If the array is empty, throw an exception. The caller should know > better. >// If there is only one, return object zero every time. >// If there are only two, alternate with every access. >// If there are three or more

UITabBar as a UISegmentedControl???

2010-05-25 Thread Alejandro Marcos Aragón
Hi all, Is it possible to use a UITabBar as a UISegmentedControl object? I mean, instead of changing a view when the user selects an item in the uiTabBar, send an event that tells the index of the item that was pressed and therefore execute an action. Then deselect the whole UITabBar. Any sugg

Re: Deallocation while key value observers still registered

2010-05-25 Thread Roland King
Sean McBride wrote: On Wed, 26 May 2010 03:08:31 +1000, Gideon King said: Glad you've tracked it down. Just a comment though: my understanding is that calling removeObserver from dealloc is, in general, discouraged. See here for some reasoning:

Re: Layer-hosting views and layer-backed scroll views

2010-05-25 Thread Kyle Sluder
On Mon, May 24, 2010 at 2:24 PM, Kyle Sluder wrote: > At this point, I don't think there's anything further I can do to work > around this bug. Well, Tim Wood gave me the idea to call -_updateLayerGeometryFromView in an override of -viewWillDraw. This does the trick, and avoids the single frame f

Re: -[NSMutableSet randomObject]

2010-05-25 Thread Ricky Sharp
On May 25, 2010, at 11:49 AM, Michael A. Crawford wrote: >// If the array is empty, throw an exception. The caller should know > better. >// If there is only one, return object zero every time. >// If there are only two, alternate with every access. >// If there are three or mor

set custom formatter in IB

2010-05-25 Thread Rainer Standke
Hello, I am trying to associate a custom formatter with a text filed in IB. Having no luck with with either dragging out of 'Classes' or instantiating and then dragging out of the .xib window. Do I have to do this programmatically? Thanks, Rainer _

Re: window level

2010-05-25 Thread Matt Neuburg
On Tue, 25 May 2010 17:34:37 +0800, XiaoGang Li said: > For my application, there is a button in the modal window, if user >click this button, I will open the helper book through NSHelperManager. >Unfortunately, the helper window is ordered in the back of the modal window, >I think this is no

Re: NSOutlineView Assert

2010-05-25 Thread Corbin Dunn
Break on objc_exception_throw and repeat the error that hits it. That should point you to your problem. --corbin On May 25, 2010, at 12:46 PM, Tony Romano wrote: > Does anyone have info on this assert: > *** Assertion failure in -[MacOutlineView > _expandItemEntry:expandChildren:startLevel:],

NSOutlineView Assert

2010-05-25 Thread Tony Romano
Does anyone have info on this assert: *** Assertion failure in -[MacOutlineView _expandItemEntry:expandChildren:startLevel:], /SourceCache/AppKit/AppKit-1038.29/TableView.subproj/NSOutlineView.m:969 The MacOutlineView is my class and I get this on occasion post a drag/drop. If I can get some

reformat drive to HFS via API

2010-05-25 Thread r c
I would like to be able to reformat a flash drive from control application, but it appears that there is no public API that allows this kind access. Am I missing something in the documentation? Or do I do something like call out to diskutil to make it happen? Rich Collyer

Re: Crash trying to unarchive webview from IB document

2010-05-25 Thread Laurent Daudelin
On May 25, 2010, at 12:13, Sherm Pendley wrote: > On Tue, May 25, 2010 at 3:10 PM, Laurent Daudelin > wrote: >> I was doing a little demo to a colleague this morning and built a simple app >> consisting of a text field and a web view in IB. I was able to run the thing >> from IB but when I trie

Re: Crash trying to unarchive webview from IB document

2010-05-25 Thread Nick Zitzmann
On 25 maj 2010, at 13.10, Laurent Daudelin wrote: > I was doing a little demo to a colleague this morning and built a simple app > consisting of a text field and a web view in IB. I was able to run the thing > from IB but when I tried to compile it as release and launch it, it would > crash wi

Re: Crash trying to unarchive webview from IB document

2010-05-25 Thread Sherm Pendley
On Tue, May 25, 2010 at 3:10 PM, Laurent Daudelin wrote: > I was doing a little demo to a colleague this morning and built a simple app > consisting of a text field and a web view in IB. I was able to run the thing > from IB but when I tried to compile it as release and launch it, it would > cr

Re: Deallocation while key value observers still registered

2010-05-25 Thread Sean McBride
On Wed, 26 May 2010 03:08:31 +1000, Gideon King said: >I have found the problem. In awakeFromNib, I have several calls like this: > >[self addObserver:self forKeyPath:@"thingy" >options:NSKeyValueObservingOptionInitial|NSKeyValueObservingOptionNew >context:NULL]; > >And in the dealloc method, I ha

Crash trying to unarchive webview from IB document

2010-05-25 Thread Laurent Daudelin
I was doing a little demo to a colleague this morning and built a simple app consisting of a text field and a web view in IB. I was able to run the thing from IB but when I tried to compile it as release and launch it, it would crash with an exception: *** -[NSKeyedUnarchiver decodeObjectForKey

Re: -[NSMutableSet randomObject]

2010-05-25 Thread Thomas Davie
If this is indeed the desired effect, you're much better off writing a - (NSArray *)arrayByRandomlyOrderingObjects in an NSArray category, and then calling [[mySet allObjects] arrayByRandomlyOrderingObjects];. Bob On 25 May 2010, at 17:54, Dave DeLong wrote: > Ah, I see; you don't want to pro

Re: Custom View Binding, Arrays, and observeValueForKeyPath (solved)

2010-05-25 Thread Mazen M. Abdel-Rahman
Thanks everyone for your help on this, I found out my problem was how I was overriding -bind:toObject:withKeyPath:options:. In my implementation when adding a view as an observer I neglected to add NSKeyValueObservingOptionOld to the options. Once I did that I was able to see the old values

Re: Error 134100 - Core Data models incompatible

2010-05-25 Thread Fritz Anderson
Seriously. I refer you to your original message: On 25 May 2010, at 12:43 PM, Brad Gibbs wrote: iPhone OS 4.0 beta 2 You asked about the behavior of an operating system. The operating system you asked about was iPhone OS 4.0. Answering a question about iPhone OS 4.0 requires discussion o

Re: Error 134100 - Core Data models incompatible

2010-05-25 Thread Brad Gibbs
Seriously? I let people know which versions of the OSes I was running, but I don't see how this problem has anything to do with an NDA, unless it's a bug in the dev tools. Core Data for the iPhone OS has been available for many moons now, and, for all intents and purposes, this appears to

Creating a PDFSelection...

2010-05-25 Thread Matthew Weinstein
Dear progammers, Thanks for all the help! Onto the next problem... Users need to be able to select sections of a pdfView, and I need to be able to save and analyze the selections (e.g., do they overlap). I also need to be able to restore the selections later. So the question is, can I use PDFSe

Re: Deallocation while key value observers still registered

2010-05-25 Thread Gideon King
I have found the problem. In awakeFromNib, I have several calls like this: [self addObserver:self forKeyPath:@"thingy" options:NSKeyValueObservingOptionInitial|NSKeyValueObservingOptionNew context:NULL]; And in the dealloc method, I have: [self removeObserver:self forKeyPath:@"thingy"]; for a

Re: -[NSMutableSet randomObject]

2010-05-25 Thread Dave DeLong
Since an NSSet is, by definition, unordered, the allObjects method is not guaranteed to return the same ordering of objects every time. However, once you have the array, you could easily order it yourself using sortedArrayUsing(Selector/Comparator/Descriptors):. And I've used this code (or rea

Re: -[NSMutableSet randomObject]

2010-05-25 Thread John Joyce
Implementation should probably include various options for what kind of pseudo randomness is desired. On May 25, 2010, at 11:52 AM, Dave DeLong wrote: > What about something like: > > @implementation NSSet (Random) > > - (id) randomObject { > NSArray * allObjects = [self allObjects]; > if ([

Re: Create an NSImage using pixel (RGB) data

2010-05-25 Thread Simon Raisin
This is what I came up with - I hope it helps someone. #import typedef struct { unsigned char red; unsigned char green; unsigned char blue; } HL_RGB; int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSSize ima

Re: Deallocation while key value observers still registered

2010-05-25 Thread Simon ONeill
Hi, I had something perhaps similar. (But have no solution, only possible further information to add). I believe that registration came in my case from InterfaceBuilder, where I had used the keyed values as entries in various textFields, using IB setup bindings in an NSPanel. (Snow Leopard).

Create an NSImage using pixel (RGB) data

2010-05-25 Thread Simon Raisin
Hi, I would like to create an new NSImage (of a specified size) by modifying its pixel data directly. I'm assuming that I have to create/provide a representation then call [rep bitmapData], but I've been unable to come up with a working solution thus far. Does anyone know of an example I might l

Re: -[NSMutableSet randomObject]

2010-05-25 Thread Michael A. Crawford
Hey, not bad. Does the -allObjects method always return the same sequence? Did you just cobble this up or is this running in a system somewhere? It doesn't do everything I want but it is definitely the better part of the 80/20 rule. -Michael On May 25, 2010, at 12:52 PM, Dave DeLong wrote:

Re: -[NSMutableSet randomObject]

2010-05-25 Thread Dave DeLong
Ah, I see; you don't want to provide the same object twice in a row. If that's the case, is it really "random"? ;) Dave On May 25, 2010, at 10:52 AM, Dave DeLong wrote: > What about something like: > > @implementation NSSet (Random) > > - (id) randomObject { > NSArray * allObjects = [self

Re: -[NSMutableSet randomObject]

2010-05-25 Thread Dave DeLong
What about something like: @implementation NSSet (Random) - (id) randomObject { NSArray * allObjects = [self allObjects]; if ([allObjects count] == 0) { @throw ...; } return [allObjects objectAtIndex:(arc4random() % [allObjects count])]; } @end On May 25, 2010, at 10:49 AM, Michael A. Cra

-[NSMutableSet randomObject]

2010-05-25 Thread Michael A. Crawford
I'd like to extend Apple implementation of NSMutableSet to include a randomObject method. The purpose of this method is self-explanatory and its potential use is I'm sure obvious to most of you. For my first idea I thought about simply adding a category to NSMutableSet but any obvious implemen

Re: Deallocation while key value observers still registered

2010-05-25 Thread Kyle Sluder
On Tue, May 25, 2010 at 9:08 AM, aglee wrote: > I had an idea for a perverse hack to deal with the problem in Leopard, which > was to to override release and do the deregistering there if the retainCount > is 1, thus sneaking in the deregistering just before dealloc but no sooner. I believe this

Re: Deallocation while key value observers still registered

2010-05-25 Thread aglee
On May 25, 2010, at 10:54 AM, Kyle Sluder wrote: This sounds off& you're deregistering obeservers in your observee's -dealloc? In general this would sound off to me too, on the principle that observees normally don't know who their observers are. �It�only makes sense to me if the observee adde

Re: Deallocation while key value observers still registered

2010-05-25 Thread Kyle Sluder
On Tue, May 25, 2010 at 6:14 AM, Gideon King wrote: > An instance 0x11d0ce4b0 of class NMGeneralPrintAccessoryController was > deallocated while key value observers were still registered with it. > Observation info was leaked, and may even become mistakenly attached to some > other object. Set

Re: Deallocation while key value observers still registered

2010-05-25 Thread Roland King
That's not it then, in Snow Leopard there was a change so that message was only emitted at the end of the dealloc() method instead of at the start which allowed you to deregister your observers in dealloc() and not get this error. In Leopard and in (I think still in) iPhone OS you get the messag

View manipulation problem

2010-05-25 Thread ico
Hi All, I have a little iPhone app which has the following UI: 1. 2 buttons, use to manipulate my model object. 2. 2 switches, let's call them infoSwitch and optionSwitch respectively 3. A custom view, its subview includes 4 UILabel, those labels are used to display infomation of my model object.

Re: Deallocation while key value observers still registered

2010-05-25 Thread Gideon King
10.6.3 On 25/05/2010, at 11:17 PM, Roland King wrote: > what version of what operating system are you using? > > On 25-May-2010, at 9:14 PM, Gideon King wrote: > >> Hi, I'm getting the message: >> >> An instance 0x11d0ce4b0 of class NMGeneralPrintAccessoryController was >> deallocated while

Re: Deallocation while key value observers still registered

2010-05-25 Thread Roland King
what version of what operating system are you using? On 25-May-2010, at 9:14 PM, Gideon King wrote: > Hi, I'm getting the message: > > An instance 0x11d0ce4b0 of class NMGeneralPrintAccessoryController was > deallocated while key value observers were still registered with it. > Observation in

Deallocation while key value observers still registered

2010-05-25 Thread Gideon King
Hi, I'm getting the message: An instance 0x11d0ce4b0 of class NMGeneralPrintAccessoryController was deallocated while key value observers were still registered with it. Observation info was leaked, and may even become mistakenly attached to some other object. Set a breakpoint on NSKVODeallocate

window level

2010-05-25 Thread XiaoGang Li
Hello, List, Question about the window level. I will be so appreciated for any comments. There are three kinds of windows in my application: one modal window, the window launched by NSHelperManager, and the font or color panel. For my application, there is a button in the mod