Re: NSPrivateQueueConcurrencyType working outside of performBlock

2015-07-28 Thread Dave Fernandes
“Setter methods on queue-based managed object contexts are thread-safe. You can invoke these methods directly on any thread” https://developer.apple.com/library/mac/documentation/Cocoa/Reference/CoreDataFramework/Classes/NSManagedObjectContext_Class/index.html > On Jul 28, 2015, at 11:49 PM, Tr

Re: NSPrivateQueueConcurrencyType working outside of performBlock

2015-07-28 Thread Trygve Inda
> >> On 28 Jul 2015, at 9:12 pm, Trygve Inda wrote: >> >> I gather that when using NSPrivateQueueConcurrencyType, all operations (a >> fetch for example) have to be done within a performBlock call. >> > > ... > >> Then later, this context is used outside a performBlock: >> >> >> NSArray *ma

Re: Best way to have KVC-compliant enum property in Swift 2?

2015-07-28 Thread Quincey Morris
On Jul 28, 2015, at 18:07 , Rick Mann wrote: > >dynamic var thumbnailURL: NSURL? >dynamic var numFiles: NSNumber? >dynamic var filesDownloaded : NSNumber? >dynamic var downloadState : NSNumber? = > DownloadState.notDownloaded.rawV

iOS 8.4: Converting a URL into a PHAsset

2015-07-28 Thread Carl Hoefs
I'm trying to get an NSURL into PHAsset form, but I keep coming up with null. PHAsset fetchAssetsWithALAssetURLs: takes an NSArray of NSURLs: "An array of NSURL objects, each an asset URL previously retrieved from an ALAsset object." Apparently, this is not a simple array of NSURL objects. How c

Re: Best way to have KVC-compliant enum property in Swift 2?

2015-07-28 Thread Charles Srstka
> On Jul 28, 2015, at 8:57 PM, Charles Srstka wrote: > > func valueForKey(key: String) -> AnyObject? { > > func setValue(value: AnyObject?, forKey key: String) { D’oh — I forgot to put “override” in front of these. Old Objective-C habits die hard. Sorry about that. Charles _

Re: Best way to have KVC-compliant enum property in Swift 2?

2015-07-28 Thread Charles Srstka
> On Jul 28, 2015, at 8:07 PM, Rick Mann wrote: > > I'd like to have a Swift enum that lays out a set of states, and a property > of that type on an object that is KVObservable (i.e. dynamic). I don't think > this is possible. What I settled on was this: > > class > Model : MPObject > { >e

Best way to have KVC-compliant enum property in Swift 2?

2015-07-28 Thread Rick Mann
I'd like to have a Swift enum that lays out a set of states, and a property of that type on an object that is KVObservable (i.e. dynamic). I don't think this is possible. What I settled on was this: class Model : MPObject { enum DownloadState : NSNumber { case notDownloaded

Re: Codesigning issues

2015-07-28 Thread Graham Cox
I’m not 100% sure if it’s related, but one user sent this to me which appeared to coincide with the launch failure: 7/28/15 4:41:01.467 PM CoreServicesUIAgent[8607]: Error -60005 creating authorization 7/28/15 4:41:11.624 PM CoreServicesUIAgent[8607]: An uncaught exception was raised 7/28/15 4

Re: NSPrivateQueueConcurrencyType working outside of performBlock

2015-07-28 Thread Roland King
>> > > performBlockAndWait might work. In my completion handler I have basically: > > Context = [self createPrivateContect]; > > For (I = 1; I < something ; i++) > { >...do stuff with completetion data from URL... > >...do stuff with the context... > > } > > So I need to make sure th

Re: NSPrivateQueueConcurrencyType working outside of performBlock

2015-07-28 Thread Trygve Inda
> >> On Jul 28, 2015, at 10:14 AM, Trygve Inda wrote: >> On 28 Jul 2015, at 9:12 pm, Trygve Inda wrote: I gather that when using NSPrivateQueueConcurrencyType, all operations (a fetch for example) have to be done within a performBlock call. >>> >>> ... >>> >>>

Re: Obj-c to Swift conversion question

2015-07-28 Thread Eric E. Dolecki
Yes, thanks. I ended up with this (yes, I like to use Void): func keyboardWillShow(notification:NSNotification) -> Void { let userInfo = notification.userInfo! let keyboardEndFrame = (userInfo[UIKeyboardFrameEndUserInfoKey] as! NSValue).CGRectValue() let animDuratio

Re: Issues with WKWebView: "Requestor is not a platform binary"

2015-07-28 Thread Jens Alfke
Also FYI, it’s a lot simpler to serve content to a WebView by implementing an NSURLProtocol, than by embedding an entire web server. (And it doesn’t open any sockets, so you avoid this problem.) I’m sure there’s sample code somewhere showing how to do this, but I don’t have any pointers to it.

Re: Obj-c to Swift conversion question

2015-07-28 Thread Jean-Daniel Dupas
> Le 28 juil. 2015 à 16:03, Eric E. Dolecki a écrit : > > The more I stretch to Swift goals, the more I learn. However I've come upon > a little thing where I am translating code into Swift and quickly stumbled. > > *Obj-C:* > NSValue *keyboardEndFrameValue = [[notification userInfo] > objectFo

Obj-c to Swift conversion question

2015-07-28 Thread Eric E. Dolecki
The more I stretch to Swift goals, the more I learn. However I've come upon a little thing where I am translating code into Swift and quickly stumbled. *Obj-C:* NSValue *keyboardEndFrameValue = [[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey]; *Swift (the closest I've come):*

Re: NSPrivateQueueConcurrencyType working outside of performBlock

2015-07-28 Thread Roland King
> On 28 Jul 2015, at 10:14 pm, Trygve Inda wrote: > >> >>> On 28 Jul 2015, at 9:12 pm, Trygve Inda wrote: >>> >>> I gather that when using NSPrivateQueueConcurrencyType, all operations (a >>> fetch for example) have to be done within a performBlock call. >>> >> >> ... >> >>> Then later, th

Re: NSPrivateQueueConcurrencyType working outside of performBlock

2015-07-28 Thread Dave Fernandes
Depending on what you are doing, you could either put doSomething and doSomethingElse inside the performBlock, or you could use performBlockAndWait > On Jul 28, 2015, at 10:14 AM, Trygve Inda wrote: > > > If I do use performBlock and have to do several things: > > This code is sitting inside

Re: NSPrivateQueueConcurrencyType working outside of performBlock

2015-07-28 Thread davelist
> On Jul 28, 2015, at 10:14 AM, Trygve Inda wrote: > >>> >>> On 28 Jul 2015, at 9:12 pm, Trygve Inda wrote: >>> >>> I gather that when using NSPrivateQueueConcurrencyType, all operations (a >>> fetch for example) have to be done within a performBlock call. >>> >> >> ... >> >>> Then later,

Re: NSPrivateQueueConcurrencyType working outside of performBlock

2015-07-28 Thread Trygve Inda
> >> On 28 Jul 2015, at 9:12 pm, Trygve Inda wrote: >> >> I gather that when using NSPrivateQueueConcurrencyType, all operations (a >> fetch for example) have to be done within a performBlock call. >> > > ... > >> Then later, this context is used outside a performBlock: >> >> >> NSArray *ma

Re: NSPrivateQueueConcurrencyType working outside of performBlock

2015-07-28 Thread davelist
> On Jul 28, 2015, at 10:01 AM, Roland King wrote: > > >> On 28 Jul 2015, at 9:12 pm, Trygve Inda wrote: >> >> I gather that when using NSPrivateQueueConcurrencyType, all operations (a >> fetch for example) have to be done within a performBlock call. >> > > ... > >> Then later, this contex

Re: NSPrivateQueueConcurrencyType working outside of performBlock

2015-07-28 Thread Roland King
> On 28 Jul 2015, at 9:12 pm, Trygve Inda wrote: > > I gather that when using NSPrivateQueueConcurrencyType, all operations (a > fetch for example) have to be done within a performBlock call. > ... > Then later, this context is used outside a performBlock: > > > NSArray *matchingQuakes = [t

NSPrivateQueueConcurrencyType working outside of performBlock

2015-07-28 Thread Trygve Inda
I gather that when using NSPrivateQueueConcurrencyType, all operations (a fetch for example) have to be done within a performBlock call. Apple has sample code here: https://developer.apple.com/library/mac/samplecode/Earthquakes/History/Histo ry.html#//apple_ref/doc/uid/TP40014547-RevisionHistory-

Change window.rootViewController at runtime

2015-07-28 Thread Diederik Meijer
Dear list, I am working on an iOS app that uses a UISplitViewController. As per the client’s requirements, a UIViewController should be loaded before the UISplitViewController loads. This “preceding” UIViewController - let’s call it the Home Screen - allows the user to select from a small numb