Re: How to get iOS version at runtime?

2014-07-18 Thread Gerriet M. Denkmann
On 19 Jul 2014, at 10:36, Roland King wrote: > >> On 19 Jul 2014, at 11:05 am, Gerriet M. Denkmann >> wrote: >> >> >> On 18 Jul 2014, at 22:24, Roland King wrote: >> 2. these Notifications have two rects in their userInfo: UIKeyboardFrameEnd and UIKeyboardFrameBegin. In 7.

Re: How to get iOS version at runtime?

2014-07-18 Thread Roland King
> On 19 Jul 2014, at 11:05 am, Gerriet M. Denkmann wrote: > > > On 18 Jul 2014, at 22:24, Roland King wrote: > >>> 2. these Notifications have two rects in their userInfo: UIKeyboardFrameEnd >>> and UIKeyboardFrameBegin. >>> In 7.1.2 these are always in the portrait orientation. To be usable

Re: How to get iOS version at runtime?

2014-07-18 Thread Gerriet M. Denkmann
On 18 Jul 2014, at 22:24, Roland King wrote: >> 2. these Notifications have two rects in their userInfo: UIKeyboardFrameEnd >> and UIKeyboardFrameBegin. >> In 7.1.2 these are always in the portrait orientation. To be usable one has >> to rotate them to the actual orientation. >> In 8.0 they ar

Getting all source or destination instances during core data migration

2014-07-18 Thread Rick Mann
According to the documentation, passing nil for the last argument to -sourceInstancesForEntityMappingNamed:destinationInstances: or -destinationInstancesForEntityMappingNamed:sourceInstances: is supposed to return all the instances. When I call these in -createDestinationInstancesForSourceInsta

[Solved][Xcode 6 beta3][Swift] NSDocument addWindowController failing inexplicably

2014-07-18 Thread Philip Shaw
On 19 Jul 2014, at 1:50 , Bavarious wrote: > On 18 Jul 2014, at 13:10, Philip Shaw wrote: > >> I'm writing a document-based app in Swift, with a custom view controller >> class, and thus had to implement my own version of makeWindowControllers. >> However, for some reason the call to self.ad

Is it wrong to create relationships in -createDestinationInstancesForSourceInstance:…?

2014-07-18 Thread Rick Mann
Is it wrong to create relationships in -createDestinationInstancesForSourceInstance:…? In some cases, doing so is straightforward, but in others I need to wait until -createRelationshipsForDestinationInstance:…. I'm just wondering if it's wrong to create relationships in the first phase. -- R

Re: Another -[NSOutlineView autosaveExpandedItems] bug

2014-07-18 Thread Bill Cheeseman
On Jul 18, 2014, at 3:12 PM, Ken Thomases wrote: > Is there a reason you didn't just directly enumerate the objects in the > collection? Constructing an index set for all of the items, enumerating > that, and then looking up the items by the index seems cumbersome. > >[[self sourceListCo

Re: Another -[NSOutlineView autosaveExpandedItems] bug

2014-07-18 Thread Bill Cheeseman
On Jul 18, 2014, at 3:12 PM, Ken Thomases wrote: > Setting aside the NSOutlineView bug you're describing, there are issues with > your code: > > On Jul 18, 2014, at 1:19 PM, Bill Cheeseman wrote: > >> - (IBAction)expandAllRows:(id)sender { >> AWRSourceListOutlineView *outlineView = [self s

Re: Another -[NSOutlineView autosaveExpandedItems] bug

2014-07-18 Thread Ken Thomases
Setting aside the NSOutlineView bug you're describing, there are issues with your code: On Jul 18, 2014, at 1:19 PM, Bill Cheeseman wrote: > - (IBAction)expandAllRows:(id)sender { >AWRSourceListOutlineView *outlineView = [self sourceListOutlineView]; >NSIndexSet *topLevelItemIndexes = [

Another -[NSOutlineView autosaveExpandedItems] bug

2014-07-18 Thread Bill Cheeseman
I have found and reported another bug in the -[NSOutlineView autosaveExpandedItems] mechanism. Here is a brief summary of my bug report #17728176: Summary: In NSOutlineView, setting autosaveExpandedItems to YES is supposed to cause the outline to remember the expanded/collapsed state of its row

Re: showing app windows at launch prior to NSDocument tasks

2014-07-18 Thread edward taffel
On Jul 17, 2014, at 9:57 PM, Graham Cox wrote: >> >> (have you actually gotten similar to work?) > > Yes, the scheme I've outlined is exactly how it works in my own app. I would > share the code with you, but it's not my IP to give away unfortunately. ofc: an erstwhile colleague used to say:

Re: [Xcode 6 beta3][Swift] NSDocument addWindowController failing inexplicably

2014-07-18 Thread Bavarious
On 18 Jul 2014, at 13:10, Philip Shaw wrote: > I'm writing a document-based app in Swift, with a custom view controller > class, and thus had to implement my own version of makeWindowControllers. > However, for some reason the call to self.addWindowControllers does nothing > at all. I tried st

[Xcode 6 beta3][Swift] NSDocument addWindowController failing inexplicably

2014-07-18 Thread Philip Shaw
I'm writing a document-based app in Swift, with a custom view controller class, and thus had to implement my own version of makeWindowControllers. However, for some reason the call to self.addWindowControllers does nothing at all. I tried stepping into it in the debugger, but that just stepped o

[Solved] rotate UI subview (CFAffline Transform)

2014-07-18 Thread 2551
Thanks Steve and Cody You were both correct that what was happening was that the subsequent translation was cancelling the rotation. All I needed to do was store the rotation as a CGFloat on the object and then call the rotation again after the move. Thanks again. signature.asc Descripti

Re: How to get iOS version at runtime?

2014-07-18 Thread Roland King
> > In an ideal world this would probably be true. > And I certainly could wait until all bugs have been fixed by Apple. > But I am kind of impatient. ok > > > 2. these Notifications have two rects in their userInfo: UIKeyboardFrameEnd > and UIKeyboardFrameBegin. > In 7.1.2 these are

Re: How do I temporary retain self, under ARC?

2014-07-18 Thread Sean McBride
On Thu, 17 Jul 2014 20:01:09 -0700, Jens Alfke said: >Every once in a while I run into a bug in my code that’s triggered by >self getting dealloced in the middle of a method. It’s usually something like > - (void) someMethod { > doSomeStuff; > [self.delegate objec

Re: How to get iOS version at runtime?

2014-07-18 Thread Gerriet M. Denkmann
On 18 Jul 2014, at 20:30, Roland King wrote: > >> On 18 Jul 2014, at 3:40 pm, Gerriet M. Denkmann wrote: >> >> How to get iOS version at runtime? >> >> Like: >> >> BOOL isRunningOnDeviceOrSimulatorInVersion8 = ??? >> >> I seem to have asked this question before (about OS X) and was told to

Re: How to get iOS version at runtime?

2014-07-18 Thread Gerriet M. Denkmann
On 18 Jul 2014, at 20:14, Julius Oklamcak wrote: > [[UIDevice currentDevice] systemVersion] returns a string, i.e. "7.1.2". > > if ([[[UIDevice currentDevice] systemVersion] compare:@"8.0" > options:NSNumericSearch] == NSOrderedDescending) > // older than 8.0 > else > // 8.0 and new

Re: How do I temporary retain self, under ARC?

2014-07-18 Thread Andy Lee
And of course the second I hit Send I realized the do {} idea doesn't work. Imagine if it was some variable other than self that you might *deliberately* use to indicate when the loop should terminate. --Andy --Andy > On Jul 18, 2014, at 10:07 AM, Andy Lee wrote: > > You could even eliminat

Re: How do I temporary retain self, under ARC?

2014-07-18 Thread Andy Lee
You could even eliminate the (admittedly negligible) cost of setting keepAlive = nil by changing the if(keepAlive) to if(!keepAlive). Along the lines of avoiding a message send, I wonder if this would work: do { // ... } while (!self); --Andy > On Jul 18, 2014, at 9:41 AM, Gerd Knops wrot

Re: rotate UI subview (CFAffline Transform)

2014-07-18 Thread Steve Christensen
On Jul 18, 2014, at 4:51 AM, 2551 <2551p...@gmail.com> wrote: > I have a problem which I can't find anyone else asking after hours of > searches through stackexchange and the like. > > In a UIView, I'm rotating a subview with a Gesture recognizer that calls this > selector: > > - (IBAction)ro

Re: rotate UI subview (CFAffline Transform)

2014-07-18 Thread Cody Garvin
Transforms are meant to be tiered / layered. In other words, if you do another transform via a pan or rotation, it’s going to reset. If your view was already scaled (matrix has been edited), doing a Make transform (ex: CGAffineTransformMakeRotation) would reset it. Transforms manipulate the lay

Re: How do I temporary retain self, under ARC?

2014-07-18 Thread Gerd Knops
That's similar to what I have used. Initially it started out simply as id keepAlive=self; ... keepAlive=nil; but a few Xcode versions ago the static analyzer started complaining that it wasn't really doing anything. So that last line became if(keepAlive) { k

Re: How to get iOS version at runtime?

2014-07-18 Thread Roland King
> On 18 Jul 2014, at 3:40 pm, Gerriet M. Denkmann wrote: > > How to get iOS version at runtime? > > Like: > > BOOL isRunningOnDeviceOrSimulatorInVersion8 = ??? > > I seem to have asked this question before (about OS X) and was told to use > either NSAppKitVersionNumber or NSFoundationVersion

RE: How to get iOS version at runtime?

2014-07-18 Thread Julius Oklamcak
[[UIDevice currentDevice] systemVersion] returns a string, i.e. "7.1.2". if ([[[UIDevice currentDevice] systemVersion] compare:@"8.0" options:NSNumericSearch] == NSOrderedDescending) // older than 8.0 else // 8.0 and newer -Original Message- From: cocoa-dev-bounces+juliuso

rotate UI subview (CFAffline Transform)

2014-07-18 Thread 2551
I have a problem which I can't find anyone else asking after hours of searches through stackexchange and the like. In a UIView, I'm rotating a subview with a Gesture recognizer that calls this selector: - (IBAction)rotateShape:(UIRotationGestureRecognizer *)gesture { gesture.view.transform

Re: Trying to custom-migrate core data

2014-07-18 Thread Rick Mann
Turns out, my model version for the older store had gotten modified. I restored that, but then I had to re-create the mapping file. After that, automatic migration picked it up and tried to use my policies! Onward and upward… On Jul 18, 2014, at 02:59 , Rick Mann wrote: > I'm trying to do a cu

Trying to custom-migrate core data

2014-07-18 Thread Rick Mann
I'm trying to do a custom core data migration, but I'm running into an issue getting the model for the older data: NSDictionary* metadata = [NSPersistentStoreCoordinator metadataForPersistentStoreOfType: NSSQLiteStoreType URL: storeURL error: &err]; NSManagedObjectModel* sourceModel = [N

How to get iOS version at runtime?

2014-07-18 Thread Gerriet M. Denkmann
How to get iOS version at runtime? Like: BOOL isRunningOnDeviceOrSimulatorInVersion8 = ??? I seem to have asked this question before (about OS X) and was told to use either NSAppKitVersionNumber or NSFoundationVersionNumber. iOS obviously has no NSAppKitVersionNumber, but I cannot find a UIKi

Re: iBeacons - can 100 different devices be active and seen by one device?

2014-07-18 Thread Ben Kennedy
We did almost exactly what David's describing at the NSNorth conference this spring. There were about a hundred attendees, and everyone was given an iBeacon that belonged to someone else; using the accompanying conference app, which employed a crude proximity meter (based on RSSI level), we had