Re: Work with AddressBook without blocking the main thread

2015-04-25 Thread Peter Tomaselli
Yup, that’s my problem exactly. You explained it much better than I could! To be honest, I don’t have a real good reason for not using the main thread at the moment—it seems fine, performance-wise, for what I am doing. But I was interested in hearing if there was a more performant approach I

Re: Work with AddressBook without blocking the main thread

2015-04-25 Thread Quincey Morris
On Apr 25, 2015, at 17:54 , Peter Tomaselli peter.tomase...@icloud.com wrote: I don’t have a real good reason for not using the main thread at the moment—it seems fine, performance-wise, for what I am doing. The point of these restrictions on ABAddressBook is that it’s *already* an

Re: Stupid ! and ?

2015-04-25 Thread Jens Alfke
On Apr 25, 2015, at 7:59 AM, William Squires wsqui...@satx.rr.com wrote: 1) Explicitly state that object references must be tested for nil before use (like C,C++, etc…), Because it’s extremely unsafe and leads to crashes or heap corruption, and at worst, catastrophic security holes. If

Drag and Drop from Photos

2015-04-25 Thread Graham Cox
I’d like a user to be able to directly drag and drop an image from Photos into my app. Currently the drag is rejected, though I’m registering for all of the usual types - NSURLs, Filenames, Images, etc. How can I find out what drag flavours I need to support to enable this? The Finder accepts

Work with AddressBook without blocking the main thread

2015-04-25 Thread Peter Tomaselli
Hi there. I’m writing my first iPhone application and trying to figure out how to best work—asynchronously—with the AddressBook API. I’m building against iOS 8. I’m not experienced with Cocoa, but based on the docs, as well as seemingly-credible SO answers (particularly this one[0]), my

Re: Work with AddressBook without blocking the main thread

2015-04-25 Thread Peter Tomaselli
Thanks for the reply. Well, now you’ve got me doubting myself. This is for iOS. Isn’t the C API the only option on that platform? I am planning on doing some work with the address book that doesn’t seem to be directly supported in the API (basically, I want to display all the email addresses

Re: Stupid ! and ?

2015-04-25 Thread Marco S Hyman
On Apr 25, 2015, at 7:59 AM, William Squires wsqui...@satx.rr.com wrote: Where I'm running into problems is this line of code: func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) - UITableViewCell { var cell =

Re: Work with AddressBook without blocking the main thread

2015-04-25 Thread Quincey Morris
On Apr 25, 2015, at 17:06 , Peter Tomaselli peter.tomase...@icloud.com wrote: The crux of my problem is that, according to the docs, ABAddressBookRequestAccessWithCompletion’s completion handler “is called on an arbitrary queue”. However, ABAddressBookRequestAccessWithCompletion accepts as

Re: Work with AddressBook without blocking the main thread

2015-04-25 Thread Roland King
Also, the post served to bring dispatch_get_current_queue() to my attention, which seems quite handy. Don’t get too excited on that score, it was deprecated 2 OS revisions ago despite there being some legitimate use cases for it. My bug report on that got closed with the “not changing

Re: Drag and Drop from Photos

2015-04-25 Thread Ken Thomases
On Apr 25, 2015, at 8:37 PM, Graham Cox graham@bigpond.com wrote: I’d like a user to be able to directly drag and drop an image from Photos into my app. Currently the drag is rejected, though I’m registering for all of the usual types - NSURLs, Filenames, Images, etc. How can I find out

Re: Drag and Drop from Photos

2015-04-25 Thread Ken Thomases
On Apr 25, 2015, at 10:25 PM, Graham Cox graham@bigpond.com wrote: Thanks Ken, that’s helpful. You're welcome. … I see the following on the pasteboard: drag content: ( dyn.ah62d4rv4gu8yc6durvwwa3xmrvw1gkdusm1044pxqyuha2pxsvw0e55bsmwca7d3sbwu, Apple files promise pasteboard

Re: Work with AddressBook without blocking the main thread

2015-04-25 Thread Quincey Morris
On Apr 25, 2015, at 18:51 , Peter Tomaselli peter.tomase...@icloud.com wrote: This is for iOS. Isn’t the C API the only option on that platform? Yes, by the time I got there I didn’t notice that it was OS X only. I realize I was wrong, too, to call the address book API asynchronous. When you

Re: Drag and Drop from Photos

2015-04-25 Thread Steve Mills
On Apr 25, 2015, at 23:33:10, Ken Thomases k...@codeweavers.com wrote: Promised files are strange and problematic in a couple of ways. First, the destination specifies where the files are to be created. The source only supplies file names (no path). Ken has explained it very nicely. I

Re: Work with AddressBook without blocking the main thread

2015-04-25 Thread Peter Tomaselli
Ha, great link! It was fun reading about the possible pitfalls here. Database corruption simply by reading improperly? Yikes! Also, the post served to bring dispatch_get_current_queue() to my attention, which seems quite handy. This fella does not mention how he handles the whole “the

Re: Drag and Drop from Photos

2015-04-25 Thread Roland King
However, when I do this, I get an empty array for the returnd URLs. This is true even if I just ask for all URLs unfiltered (nil options dictionary). The headers don’t have any info about what do to if the URL is only promised - I had thought that from the receiver’s point of view that

Re: Drag and Drop from Photos

2015-04-25 Thread Graham Cox
Thanks Ken, that’s helpful. One problem I’m having is that my app is still largely using legacy approaches to receiving drags based on PBoard types. I’m taking this opportunity to bring it up to date. So, I’m now registering my view to receive public.data and public.content. It’s no longer

Re: Work with AddressBook without blocking the main thread

2015-04-25 Thread Roland King
I had trouble believing there was an API left which was really thread-tied - until I convinced myself that this one really is. I wonder why, underlying SQL implementation perhaps? In the course of hunting around I found a blog entry here

Re: Try to open an app from a screensaver

2015-04-25 Thread Stephane Sudre
On Sat, Apr 25, 2015 at 12:40 AM, Juanjo Conti jjco...@carouselapps.com wrote: I'm developing a screensaver. I want to achieve the following: then the user hits the key 's', stop the screensaver and open a program. Handling the key stroke is done, and I'm launching the program as: (the

Display a UIAlertView after dismissing an action sheet?

2015-04-25 Thread Michael Crawford
My iOS App includes some simple file management, that enables the user to save the state of their game as well as to exchange the game states with other people. I have a sheet that looks like this: Title: File Management Destructive Option: Delete File Open Save I also specify a

Re: Display a UIAlertView after dismissing an action sheet?

2015-04-25 Thread Mike Abdullah
On 25 Apr 2015, at 15:06, Michael Crawford mdcrawf...@gmail.com wrote: On 4/25/15, Roland King r...@rols.org wrote: There are delegate methods for UIActionSheet and UIAlertView which tell you when the animation has finished. xxx:didDismissWithButtonIndex: You Da Man. I am closer to

Re: Display a UIAlertView after dismissing an action sheet?

2015-04-25 Thread Roland King
On 25 Apr 2015, at 21:30, Michael Crawford mdcrawf...@gmail.com wrote: On 4/25/15, Mike Abdullah mabdul...@karelia.com wrote: Apple's APIs here are deliberately asynchronous. You need to make your code handle that properly. Don't try to force it to be synchronous. Some things need to be

Re: Try to open an app from a screensaver

2015-04-25 Thread Uli Kusterer
I don’t have a certain solution, but a few things I’d try to see if anything works better or exposes behaviour that explains this issue: The log message sounds like the actively OS prevents any application except screen saver and the login window from coming to front at this moment. It sounds

Stupid ! and ?

2015-04-25 Thread William Squires
Okay, I still don't get why Swift has this stupid ! and ? syntax. Why not just: 1) Explicitly state that object references must be tested for nil before use (like C,C++, etc...), or 2) Use the ObjC behavior that sending a message to nil does nothing (unless the message returns something other

Re: Display a UIAlertView after dismissing an action sheet?

2015-04-25 Thread Michael Crawford
I was running on an iPad. When I switched to the iPad 2 simulator, I could enable Guard Malloc. With guard malloc an assert is tripped over a retain count that, at that point, should be 1. I expect I have an errant pointer elsewhere in my code. I know how to track such things down. I'm not

Re: Display a UIAlertView after dismissing an action sheet?

2015-04-25 Thread Roland King
I think the problem is that I need to be certain that the action sheet is all the way dismissed before I show the alert. I think that's what all the stuff about runloops was in my previous question, that didn't make sense to anyone. I got that from Erica Sadun's iPhone Developer's

Re: Display a UIAlertView after dismissing an action sheet?

2015-04-25 Thread Michael Crawford
On 4/25/15, Roland King r...@rols.org wrote: There are delegate methods for UIActionSheet and UIAlertView which tell you when the animation has finished. xxx:didDismissWithButtonIndex: You Da Man. I am closer to understanding why this is not working. my call to [alertView show] returns

Re: Display a UIAlertView after dismissing an action sheet?

2015-04-25 Thread Mike Abdullah
On 25 Apr 2015, at 15:30, Michael Crawford mdcrawf...@gmail.com wrote: On 4/25/15, Mike Abdullah mabdul...@karelia.com wrote: Apple's APIs here are deliberately asynchronous. You need to make your code handle that properly. Don't try to force it to be synchronous. Some things need to be

Re: Display a UIAlertView after dismissing an action sheet?

2015-04-25 Thread Michael Crawford
On 4/25/15, Mike Abdullah mabdul...@karelia.com wrote: Apple's APIs here are deliberately asynchronous. You need to make your code handle that properly. Don't try to force it to be synchronous. Some things need to be synchronous though. If I'm saving a file, I don't want to do anything else

Re: Stupid ! and ?

2015-04-25 Thread Jonathan Hull
On Apr 25, 2015, at 7:59 AM, William Squires wsqui...@satx.rr.com wrote: Where I'm running into problems is this line of code: func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) - UITableViewCell { var cell =

Re: Stupid ! and ?

2015-04-25 Thread dangerwillrobinsondanger
Sent from my iPhone On 2015/04/25, at 23:59, William Squires wsqui...@satx.rr.com wrote: Okay, I still don't get why Swift has this stupid ! and ? syntax. Why not just: 1) Explicitly state that object references must be tested for nil before use (like C,C++, etc...), or This is what