Re: positioning two UILabels with auto layout problem

2013-06-20 Thread Robert Vojta
Hi, or you can use visual format, which is much shorter … NSDictionary *viewsDictionary = NSDictionaryOfVariableBindings( _firstLabel, _secondLabel ); [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@V:[_firstLabel(=16)]-16-[_secondLabel(=16)]

Detect a Retina display

2013-06-20 Thread Thierry Cantet
Hello ! I have a quick question concerning Retina displays. My software uses OpenGL for displaying the pixels. However, on a Retina screen, OpenGL behaves strangely. There is a fix (

Re: Detect a Retina display

2013-06-20 Thread Scott Ribe
On Jun 20, 2013, at 7:49 AM, Thierry Cantet wrote: Hello ! I have a quick question concerning Retina displays. My software uses OpenGL for displaying the pixels. However, on a Retina screen, OpenGL behaves strangely. There is a fix (

Re: Detect a Retina display

2013-06-20 Thread Richard Heard
No retina devices can run 10.6, therefore you can safely assume 1.0. This means you can use a runtime check for the selector, and if its not available default to a 1.0 multiple eg: - (NSRect)backingBounds { if ([self respondsToSelector:@selector(convertRectToBacking:)]){

Re: Detect a Retina display

2013-06-20 Thread Scott Ribe
On Jun 20, 2013, at 9:11 AM, Thierry Cantet wrote: I have tried your solution, however it does not work. I have these messages when I try to build with the base SDK set to 10.6 : (Warning)Instance method '-convertRectToBacking:' not found (return type defaults to 'id') (Error)No

Re: Detect a Retina display

2013-06-20 Thread Sandy McGuffog
What you need is to set base SDK to most recent (10.8), and set deployment target to 10.6 Sandy On Jun 20, 2013, at 5:11 PM, Thierry Cantet thierry.can...@tvpaint.fr wrote: Hello Richard, I have tried your solution, however it does not work. I have these messages when I try to build

Re: Detect a Retina display

2013-06-20 Thread Thierry Cantet
Hello Richard, I have tried your solution, however it does not work. I have these messages when I try to build with the base SDK set to 10.6 : (Warning)Instance method '-convertRectToBacking:' not found (return type defaults to 'id') (Error)No viable conversion from 'id' to 'NSRect'

iOS 6, VoIP, and -viewDidLoad

2013-06-20 Thread Michael Crawford
When iOS automatically restarts a VoIP app that has crashed or been removed by the watchdog for some reason, does -viewDidLoad run when the app is automatically restarted? I ask because when this type of restart occurs, it appears to happen silently, without presenting the restarted app's

Re: iOS 6, VoIP, and -viewDidLoad

2013-06-20 Thread Michael Crawford
On 6/20/13, Michael Crawford michaelacrawf...@me.com wrote: Michael A. Crawford? Did you at one time work for Apple? Did you at one time get a lot of phone calls and emails meant for me? I had long grown weary of pointing out to callers to look for our middle initials in the corporate phone

Re: iOS 6, VoIP, and -viewDidLoad

2013-06-20 Thread Fritz Anderson
On 20 Jun 2013, at 11:20 AM, Michael Crawford michaelacrawf...@me.com wrote: When iOS automatically restarts a VoIP app that has crashed or been removed by the watchdog for some reason, does -viewDidLoad run when the app is automatically restarted? I ask because when this type of restart

Re: iOS 6, VoIP, and -viewDidLoad

2013-06-20 Thread Michael Crawford
On 6/20/13, Michael Crawford michaelacrawf...@me.com wrote: I am trying to trigger this behavior by allocating huge amounts of memory on a timer and then leaking it on purpose but so far, instead of getting a memory warning and then subsequently having the app evicted due to memory pressure,

Looking for a good starting point to create a shared data resource between iOS apps

2013-06-20 Thread Alex Zavatone
I've reviewed the AppPrefs source on developer.apple.com and am interested in creating a small set of shared data accessible for all apps on our iOS devices. With this in mind, it would be nice to have a little app that has a preference pane that contains some specifics, but have these items

Re: Looking for a good starting point to create a shared data resource between iOS apps

2013-06-20 Thread Ben Kennedy
On 2013-06-20, at 10:37 am, Alex Zavatone z...@mac.com wrote: I've reviewed the AppPrefs source on developer.apple.com and am interested in creating a small set of shared data accessible for all apps on our iOS devices. I have resorted to Keychain Services for achieving this kind of thing

Re: iOS 6, VoIP, and -viewDidLoad

2013-06-20 Thread Michael Crawford
Thanks for the suggestion. I found that -viewDidLoad does indeed get called even thought the app does not come to the foreground. This is a good thing as far as I'm concerned. No doubt Apple figured a lot of apps would break if they started an app and -viewDidLoad was never invoked.

Re: Looking for a good starting point to create a shared data resource between iOS apps

2013-06-20 Thread Michael Crawford
Do you have to be able to get at the data when you're not connected to the Internet? If not, you could store it on an HTTP server. Do shared memory segments work on iOS? I would expect not because of the sandbox, but maybe they do. Do localhost (127.0.0.1) TCP sockets work between two

NSDocument and Large File Import?

2013-06-20 Thread Karl Moskowski
I’m creating a document-based OS X app. The document itself will be a package, with most of the its properties archived in a plist (via NSFileWrapper). However, the document package will also contain a potentially — probably, even — large asset file that’s too big to keep in memory. The first

Re: Looking for a good starting point to create a shared data resource between iOS apps

2013-06-20 Thread Jens Alfke
On Jun 20, 2013, at 11:01 AM, Michael Crawford mdcrawf...@gmail.com wrote: Do localhost (127.0.0.1) TCP sockets work between two different apps? Yes, and there are systems like Audiobus (http://audiob.us) that use it for live audio streaming between apps. The tricky part, I think, is keeping

Re: NSDocument and Large File Import?

2013-06-20 Thread Jens Alfke
On Jun 20, 2013, at 12:06 PM, Karl Moskowski kmoskow...@me.com wrote: My problem arises in the creation phase. After the new NSDocument object is instantiated (in either -init or -initWithType:error:), but before the document is saved, I don’t have an on-disk location to which to import, as

Re: NSDocument and Large File Import?

2013-06-20 Thread Karl Moskowski
On Jun 20, 2013, at 3:44 PM, Jens Alfke j...@mooseyard.com wrote: Yup, it’s an untitled document so it doesn’t have a persistent manifestation yet. A typical solution for your problem is to create a temporary directory somewhere (using the APIs for that purpose) and treat that as the

Re: NSDocument and Large File Import?

2013-06-20 Thread Quincey Morris
On Jun 20, 2013, at 12:06 , Karl Moskowski kmoskow...@me.com wrote: I’m creating a document-based OS X app. The document itself will be a package, with most of the its properties archived in a plist (via NSFileWrapper). However, the document package will also contain a potentially —

Re: NSDocument and Large File Import?

2013-06-20 Thread Karl Moskowski
On Jun 20, 2013, at 3:53 PM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: On Jun 20, 2013, at 12:06 , Karl Moskowski kmoskow...@me.com wrote: I’m creating a document-based OS X app. The document itself will be a package, with most of the its properties archived in a plist

Re: NSDocument and Large File Import?

2013-06-20 Thread Jens Alfke
On Jun 20, 2013, at 12:52 PM, Karl Moskowski kmoskow...@me.com wrote: If we have to do that level of manual work, I think our preferred direction will be to go the Xcode-style route, and ask for a save location early. However, I’ll ask my colleagues for their opinions. IMHO it’s nicer to

Re: NSDocument and Large File Import?

2013-06-20 Thread Quincey Morris
On Jun 20, 2013, at 13:07 , Karl Moskowski kmoskow...@me.com wrote: In fact, I think that will almost always be the case, so the link-to-an-external asset approach may not be practical. Anyway, would that approach work with Sandbox restrictions? What about potential iCloud sync in the

UIDocument + NSFileWrapper crashes on opening

2013-06-20 Thread Markus Spoettl
Hello everyone, I have an iOS 6 app that uses UIDocument to implement loading and saving of my app's data. The document data is loaded from and saved to a NSFileWrapper (representing a file package containing many files and folders), handed from and to the document in -loadFromContents:::

Re: UIDocument + NSFileWrapper crashes on opening

2013-06-20 Thread Markus Spoettl
Seems the log didn't make it in the initial post, not sure why. On 6/20/13 11:01 PM, Markus Spoettl wrote: I'm pasting the console output of a typical session from the time the app is started via Springboard until it crashes/vanishes. Maybe it contains a clue I don't see. Jun 20 20:52:08

Re: UIDocument + NSFileWrapper crashes on opening

2013-06-20 Thread Luke the Hiesterman
Probably exactly as you said. Try overriding -readFromURL:error: to implement incremental reading. Luke On Jun 20, 2013, at 2:01 PM, Markus Spoettl ms_li...@shiftoption.com wrote: Hello everyone, I have an iOS 6 app that uses UIDocument to implement loading and saving of my app's data.

Re: NSDocument and Large File Import?

2013-06-20 Thread Karl Moskowski
On Jun 20, 2013, at 4:30 PM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: On Jun 20, 2013, at 4:07 PM, Karl Moskowski kmoskow...@me.com wrote: In fact, I think that will almost always be the case, so the link-to-an-external asset approach may not be practical. Anyway, would

Re: Detect a Retina display

2013-06-20 Thread Lee Ann Rucker
And if that's not possible, make an informal protocol (aka interface on NSObject), just so the compiler knows what the method looks like: @interface NSObject (RemoveWhenUpgradingSDKs) // or NSView, NSScreen, NSWindow if you prefer narrowing it down to just the class you care about -

Re: UIDocument + NSFileWrapper crashes on opening

2013-06-20 Thread Markus Spoettl
On 6/20/13 11:16 PM, Luke the Hiesterman wrote: Probably exactly as you said. Try overriding -readFromURL:error: to implement incremental reading. OK, but isn't NSFileWrapper supposed to facilitate exactly that by providing sub-wrappers instead of actual data of contained files/folders,

Re: NSDocument and Large File Import?

2013-06-20 Thread Quincey Morris
On Jun 20, 2013, at 14:22 , Karl Moskowski kmoskow...@me.com wrote: So, when importing the asset upon new document creation, actually import it to a temp directory, then upon save of the document, hard-link to the temp asset (via NSFileManager methods)? How would you delete the original hard

Re: UIDocument + NSFileWrapper crashes on opening

2013-06-20 Thread Quincey Morris
On Jun 20, 2013, at 14:37 , Markus Spoettl ms_li...@shiftoption.com wrote: OK, but isn't NSFileWrapper supposed to facilitate exactly that by providing sub-wrappers instead of actual data of contained files/folders, which can be read on demand when needed? No, NSFileWrapper provides *lazy*

Re: UIDocument + NSFileWrapper crashes on opening

2013-06-20 Thread Luke the Hiesterman
By default, UIDocument does eager reading. You can override that in -readFromURL:error:. Luke On Jun 20, 2013, at 2:37 PM, Markus Spoettl ms_li...@shiftoption.com wrote: On 6/20/13 11:16 PM, Luke the Hiesterman wrote: Probably exactly as you said. Try overriding -readFromURL:error: to

Re: NSDocument and Large File Import?

2013-06-20 Thread Mike Abdullah
On 20 Jun 2013, at 20:52, Karl Moskowski kmoskow...@me.com wrote: On Jun 20, 2013, at 3:44 PM, Jens Alfke j...@mooseyard.com wrote: Yup, it’s an untitled document so it doesn’t have a persistent manifestation yet. A typical solution for your problem is to create a temporary directory

Re: NSDocument and Large File Import?

2013-06-20 Thread Quincey Morris
On Jun 20, 2013, at 15:12 , Mike Abdullah mabdul...@karelia.com wrote: There should be no need to do this. If you need a location on disk for the document, just trigger an autosave so that the system effectively creates a temp location for you to use (-[NSDocument autosavedContentsFileURL])

UIScrollView challenge: allow zoom out to see full content

2013-06-20 Thread Rick Mann
I have a basic UIScrollView working with pinch zoom and pan under autolayout. There are still issues, including very jumpy zoom, and I still need to find the right way to add some subviews that need to stick to the image as it zooms. Another challenge is this: allowing the user to zoom out far

Re: NSDocument and Large File Import?

2013-06-20 Thread Karl Moskowski
On Jun 20, 2013, at 5:41 PM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: On Jun 20, 2013, at 14:22 , Karl Moskowski kmoskow...@me.com wrote: So, when importing the asset upon new document creation, actually import it to a temp directory, then upon save of the document,

Re: UIScrollView challenge: allow zoom out to see full content

2013-06-20 Thread Rick Mann
Bah, the idea of making the image match the aspect ratio doesn't work because it doesn't support changing ratios (e.g. rotation). On Jun 20, 2013, at 16:11 , Rick Mann rm...@latencyzero.com wrote: I have a basic UIScrollView working with pinch zoom and pan under autolayout. There are still

Re: UIDocument + NSFileWrapper crashes on opening

2013-06-20 Thread Markus Spoettl
You just saved me days of work. Thanks very much! Regards Markus On 6/20/13 11:52 PM, Luke the Hiesterman wrote: By default, UIDocument does eager reading. You can override that in -readFromURL:error:. Luke On Jun 20, 2013, at 2:37 PM, Markus Spoettl ms_li...@shiftoption.com wrote: On

Re: UIDocument + NSFileWrapper crashes on opening

2013-06-20 Thread Markus Spoettl
On 6/20/13 11:52 PM, Quincey Morris wrote: OK, but isn't NSFileWrapper supposed to facilitate exactly that by providing sub-wrappers instead of actual data of contained files/folders, which can be read on demand when needed? No, NSFileWrapper provides *lazy* loading, in the sense that you