UITableViewController

2017-06-28 Thread Gerriet M. Denkmann
I have (iOS 10.3) a UIViewController which contains:

Other Stuff
UITableView

Now I want to add a UIRefreshControl to my TableView.
The documentation says: that UIRefreshControl “is specifically designed for use 
in a table view that’s managed by a table view controller, using it in a 
different context can result in undefined behavior.”

Ok, so I removed my TableView from the scene and tried to drag a 
UITableViewController into its place.
But Xcode would not allow this.

So: must a UITableViewController the only (or the top) thing in a scene?
Or am I just doing something wrong?

B.t.w.: I tried before to have UITableViewController as the controller in my 
scene - but could not make it move down to allow for “Other Stuff” on top; so I 
changed it to UIViewController.

Gerriet.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: UITableViewController

2017-06-28 Thread Quincey Morris
On Jun 28, 2017, at 00:21 , Gerriet M. Denkmann  wrote:
> 
> Ok, so I removed my TableView from the scene and tried to drag a 
> UITableViewController into its place.
> But Xcode would not allow this.
> 
> So: must a UITableViewController the only (or the top) thing in a scene?
> Or am I just doing something wrong?

The trick is to use a container view. This is an item in IB’s object palette. 
Drag the container view into the place where the table view was, then drag a 
table view controller onto the storyboard, then control drag from the container 
view to the table view controller to create the embedding segue. That should be 
all it takes.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: UITableViewController

2017-06-28 Thread Gerriet M. Denkmann

> On 28 Jun 2017, at 14:37, Quincey Morris 
>  wrote:
> 
> On Jun 28, 2017, at 00:21 , Gerriet M. Denkmann  wrote:
>> 
>> Ok, so I removed my TableView from the scene and tried to drag a 
>> UITableViewController into its place.
>> But Xcode would not allow this.
>> 
>> So: must a UITableViewController the only (or the top) thing in a scene?
>> Or am I just doing something wrong?
> 
> The trick is to use a container view. This is an item in IB’s object palette. 
> Drag the container view into the place where the table view was, then drag a 
> table view controller onto the storyboard, then control drag from the 
> container view to the table view controller to create the embedding segue. 
> That should be all it takes.

I did just that.

I have a Master View Controller Scene with a MasterViewController ← 
UIViewController (which previously had a TableView, now has a UIView, called 
“Container View” ); it now also has:
containerView → Container View, and:
Show segue to “Table View Controller”

And a new: Table View Controller Scene
This has: Presenting Segues: Show → Container View viewDidLoad:

Looks good, but crashes: 
*** Terminating app due to uncaught exception ‘NSUnknownKeyException’, reason: 
‘[ setValue:forUndefinedKey:]: this class 
is not key value coding-compliant for the key containerView.'

What does this mean? 
Probably that some class needs an IBOutlet UIView * containerView.
But which class? UIStoryboardShowSegueTemplate?

I am rather confused and don’t know what to try next.


Kind regards,

Gerriet.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Is cloning the same as copying in APFS?

2017-06-28 Thread Alastair Houghton
On 27 Jun 2017, at 22:45, Rick Mann  wrote:
> 
> Agreed. Thanks for the code, and for showing the other techniques. In my 
> case, I still have to support HFS+, and I want to do that with hard links. I 
> wish there was an API to clone-or-hardlink, but I can do that.

Perhaps worth emphasising here, since you mention hard links, that the 
difference between hard links and clones is that clones are copy-on-write.  
i.e. if you hard link a file, and then change the data, *all of the linked 
copies will change too*.

I’m sure that’s not an issue in your application, but if someone later happens 
across this thread and thinks “What a great idea!”, mentioning that the two are 
only equivalent for the read-only case might avoid some pain.

Kind regards,

Alastair.

--
http://alastairs-place.net

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Is cloning the same as copying in APFS?

2017-06-28 Thread Rick Mann
Yeah, our data is immutable, so hard Link’s work fine. 

-- 
Rick Mann
rm...@latencyzero.com

> On Jun 28, 2017, at 02:43, Alastair Houghton  
> wrote:
> 
>> On 27 Jun 2017, at 22:45, Rick Mann  wrote:
>> 
>> Agreed. Thanks for the code, and for showing the other techniques. In my 
>> case, I still have to support HFS+, and I want to do that with hard links. I 
>> wish there was an API to clone-or-hardlink, but I can do that.
> 
> Perhaps worth emphasising here, since you mention hard links, that the 
> difference between hard links and clones is that clones are copy-on-write.  
> i.e. if you hard link a file, and then change the data, *all of the linked 
> copies will change too*.
> 
> I’m sure that’s not an issue in your application, but if someone later 
> happens across this thread and thinks “What a great idea!”, mentioning that 
> the two are only equivalent for the read-only case might avoid some pain.
> 
> Kind regards,
> 
> Alastair.
> 
> --
> http://alastairs-place.net
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: file encription/decriptoin iOS

2017-06-28 Thread Jean-Daniel

> Le 27 juin 2017 à 04:25, Sandor Szatmari  a 
> écrit :
> 
> This is an interesting thread.  The OP's original question made me think of 
> the functionality Apple recently (how recently I'm not sure) added to the iOS 
> Notes app.  It allows you to selectively 'encrypt' (password protect) a note. 
>  This functionality allows you to pass your phone to someone to let them read 
> a note and not worry about them skipping to your note with all your 'secret 
> info'.  Also, if someone got your phone in an unlocked state, (it could 
> happen I guess) they couldn't trust a Mac and browse to plain text files.  

Notes are sync with iCloud and can be read on a Mac where this is far more 
common to share a session.

> I must say at this point I whole heartedly agree with all the warnings for 
> implementing encryption schemes.  But is there not also a valid use case 
> here?  Unless I'm misunderstanding things, Apple seemed to think so.
> 
> Sandor
> 
>> On Jun 26, 2017, at 13:59, Jens Alfke > > wrote:
>> 
>> 
>>> On Jun 26, 2017, at 9:50 AM, Alex Zavatone  wrote:
>>> 
>>> You can use the iExplore app to look in the Documents folder of any device 
>>> you attach to your Mac. 
>> 
>> But you can only attach a device to your Mac if the device is unlocked, 
>> since you have to OK the “Do you trust this computer?” alert.
>> As recent court cases have shown, unlocking an iOS device against the 
>> owner’s will is nearly impossible.
>> 
>>> Also, data protection SUCKS because it locks the files if the app goes in 
>>> to the background, basically suspending any file based background 
>>> operations like sql db updates. 
>> 
>> It does this by default, but you can alter those settings if you need 
>> background access to certain files, basically trading some security for 
>> greater access.
>> 
>>> Thanks to the help of Chris Thorman, I was able to update an AES256 hmac 
>>> method to work with UTF-8 char sets.  We use this for data security over 
>>> http.
>> 
>> It’s much easier to just enable SSL/TLS on the HTTP server. (Though I 
>> realize there are cases where you don’t have control over the server, or 
>> circumstances prevent deploying HTTPS.)
>> 
>>> Now, it might be overkill or just bad design, but we use a CoreData db with 
>>> transformable property and encrypt the data stored. 
>> 
>> How do you store the encryption key? That’s often the downfall; even if you 
>> put it in the Keychain, it can be accessed by an attacker if your app’s 
>> files are accessible (unless you add TouchID authentication to it.)
>> 
>> (Also, I hope you’re using a different IV for each record you encrypt. Sorry 
>> to be a broken record about this, but it’s important.)
>> 
>> —Jens
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/admin.szatmari.net%40gmail.com
>>  
>> 
>> 
>> This email sent to admin.szatmari@gmail.com 
>> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com 
> )
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com 
> 
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/mailing%40xenonium.com 
> 
> 
> This email sent to mail...@xenonium.com 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: file encription/decriptoin iOS

2017-06-28 Thread Sandor Szatmari
I thought there were both local and iCloud Notes, no?

Sandor

> On Jun 28, 2017, at 09:14, Jean-Daniel  wrote:
> 
> 
>> Le 27 juin 2017 à 04:25, Sandor Szatmari  a 
>> écrit :
>> 
>> This is an interesting thread.  The OP's original question made me think of 
>> the functionality Apple recently (how recently I'm not sure) added to the 
>> iOS Notes app.  It allows you to selectively 'encrypt' (password protect) a 
>> note.  This functionality allows you to pass your phone to someone to let 
>> them read a note and not worry about them skipping to your note with all 
>> your 'secret info'.  Also, if someone got your phone in an unlocked state, 
>> (it could happen I guess) they couldn't trust a Mac and browse to plain text 
>> files.  
> 
> Notes are sync with iCloud and can be read on a Mac where this is far more 
> common to share a session.
> 
>> I must say at this point I whole heartedly agree with all the warnings for 
>> implementing encryption schemes.  But is there not also a valid use case 
>> here?  Unless I'm misunderstanding things, Apple seemed to think so.
>> 
>> Sandor
>> 
 On Jun 26, 2017, at 13:59, Jens Alfke  wrote:
 
 
 On Jun 26, 2017, at 9:50 AM, Alex Zavatone  wrote:
 
 You can use the iExplore app to look in the Documents folder of any device 
 you attach to your Mac. 
>>> 
>>> But you can only attach a device to your Mac if the device is unlocked, 
>>> since you have to OK the “Do you trust this computer?” alert.
>>> As recent court cases have shown, unlocking an iOS device against the 
>>> owner’s will is nearly impossible.
>>> 
 Also, data protection SUCKS because it locks the files if the app goes in 
 to the background, basically suspending any file based background 
 operations like sql db updates. 
>>> 
>>> It does this by default, but you can alter those settings if you need 
>>> background access to certain files, basically trading some security for 
>>> greater access.
>>> 
 Thanks to the help of Chris Thorman, I was able to update an AES256 hmac 
 method to work with UTF-8 char sets.  We use this for data security over 
 http.
>>> 
>>> It’s much easier to just enable SSL/TLS on the HTTP server. (Though I 
>>> realize there are cases where you don’t have control over the server, or 
>>> circumstances prevent deploying HTTPS.)
>>> 
 Now, it might be overkill or just bad design, but we use a CoreData db 
 with transformable property and encrypt the data stored. 
>>> 
>>> How do you store the encryption key? That’s often the downfall; even if you 
>>> put it in the Keychain, it can be accessed by an attacker if your app’s 
>>> files are accessible (unless you add TouchID authentication to it.)
>>> 
>>> (Also, I hope you’re using a different IV for each record you encrypt. 
>>> Sorry to be a broken record about this, but it’s important.)
>>> 
>>> —Jens
>>> ___
>>> 
>>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>> 
>>> Please do not post admin requests or moderator comments to the list.
>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>> 
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/cocoa-dev/admin.szatmari.net%40gmail.com
>>> 
>>> This email sent to admin.szatmari@gmail.com
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/mailing%40xenonium.com
>> 
>> This email sent to mail...@xenonium.com
> 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: file encription/decriptoin iOS

2017-06-28 Thread Jens Alfke

> On Jun 28, 2017, at 6:33 AM, Sandor Szatmari  
> wrote:
> 
> I thought there were both local and iCloud Notes, no?

Not sure what you’re asking, but: Anything saved to iCloud goes through 
end-to-end encryption, so there’s no way to read it on the iCloud servers 
without using keys stored on your device (derived from your iCloud password.) 
So again, it’s not necessary to add any extra encryption.

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: UITableViewController

2017-06-28 Thread Quincey Morris
On Jun 28, 2017, at 01:38 , Gerriet M. Denkmann  wrote:
> 
> I did just that.

Not quite …

> I have a Master View Controller Scene with a MasterViewController ← 
> UIViewController (which previously had a TableView, now has a UIView, called 
> “Container View” ); it now also has:
> containerView → Container View, and:
> Show segue to “Table View Controller”
> 
> And a new: Table View Controller Scene
> This has: Presenting Segues: Show → Container View viewDidLoad:

You don’t want a “show” segue, you want an “embed” segue. I just ran through 
the process in a fresh project, and:

— When I dragged a container view into the main view, IB automatically game me 
an embedded (plain) view controller.

— I deleted this embedded controller.

— I dragged a new table view controller onto the canvas.

— I control dragged from the container view to the table view controller, and 
chose “embed” for the segue.

That runs just fine.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: file encription/decriptoin iOS

2017-06-28 Thread Dave Fernandes

> On Jun 28, 2017, at 12:17 PM, Jens Alfke  wrote:
> 
> 
>> On Jun 28, 2017, at 6:33 AM, Sandor Szatmari  
>> wrote:
>> 
>> I thought there were both local and iCloud Notes, no?
> 
> Not sure what you’re asking, but: Anything saved to iCloud goes through 
> end-to-end encryption, so there’s no way to read it on the iCloud servers 
> without using keys stored on your device (derived from your iCloud password.) 
> So again, it’s not necessary to add any extra encryption.
> 
> —Jens
> ___

I didn’t realize this, and went to the iOS Security Guide to get more details, 
but I am left more confused than when I started. The Security Guide has this to 
say (CloudKit works the same way):

iCloud Drive

iCloud Drive adds account-based keys to protect documents stored in iCloud. As 
with existing iCloud services, it chunks and encrypts file contents and stores 
the encrypted chunks using third-party services. However, the file content keys 
are wrapped by record keys stored with the iCloud Drive metadata. These record 
keys are in turn protected by the user’s iCloud Drive service key, which is 
then stored with the user’s iCloud account. Users get access to their iCloud 
documents metadata by having authenticated with iCloud, but must also possess 
the iCloud Drive service key to expose protected parts of iCloud Drive storage. 


So everything is protected by the iCloud Drive service key, but what does 
“which is then stored with the user’s iCloud account” mean? Is it stored on the 
device or in iCloud? That makes all the difference.

- Dave
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: file encription/decriptoin iOS

2017-06-28 Thread Jens Alfke

> On Jun 28, 2017, at 8:04 PM, Dave Fernandes  
> wrote:
> 
> So everything is protected by the iCloud Drive service key, but what does 
> “which is then stored with the user’s iCloud account” mean? Is it stored on 
> the device or in iCloud? That makes all the difference.

I agree it’s vague. The way I read it is that the service key is stored with 
other account data in iCloud, but the account data is itself encrypted via the 
user’s passphrase (which is not known to Apple.)

If the service key were stored locally, that would beg the question of how it 
gets from one device to another. You have to be able to access everything from 
a new device by logging into iCloud, so any secrets have to be stored online. 
But by encrypting them using the passphrase, Apple prevents anyone else 
(including themselves) from reading them.

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: UITableViewController

2017-06-28 Thread Gerriet M. Denkmann

> On 29 Jun 2017, at 00:48, Quincey Morris 
>  wrote:
> 
> On Jun 28, 2017, at 01:38 , Gerriet M. Denkmann  wrote:
>> 
>> I did just that.
> 
> Not quite …
> 
>> I have a Master View Controller Scene with a MasterViewController ← 
>> UIViewController (which previously had a TableView, now has a UIView, called 
>> “Container View” ); it now also has:
>> containerView → Container View, and:
>> Show segue to “Table View Controller”
>> 
>> And a new: Table View Controller Scene
>> This has: Presenting Segues: Show → Container View viewDidLoad:
> 
> You don’t want a “show” segue, you want an “embed” segue. I just ran through 
> the process in a fresh project, and:
> 
> — When I dragged a container view into the main view, IB automatically game 
> me an embedded (plain) view controller.
> 
> — I deleted this embedded controller.
> 
> — I dragged a new table view controller onto the canvas.
> 
> — I control dragged from the container view to the table view controller, and 
> chose “embed” for the segue.
> 
> That runs just fine.

Indeed. Following your instructions again (this time making sure to use an 
“embed” segue) there is no crash.
But also no table view.

I had to do two more steps:

1. give the segue an identifier, like: “EmbedSegueToTableViewController”

2. in the UITableViewController which formerly did have a UITableView and now 
has the container view:

- (void)viewDidLoad 
{
…
[ self performSegueWithIdentifier: @“EmbedSegueToTableViewController” 
sender: self ];
}

Now everything seems perfect.

Thanks a lot for your help - I never would have figured this out on my own. 
Very much appreciated!


Kind regards,

Gerriet.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: UITableViewController

2017-06-28 Thread Quincey Morris
On Jun 28, 2017, at 22:02 , Gerriet M. Denkmann  wrote:
> 
> I had to do two more steps:
> 
> 1. give the segue an identifier, like: “EmbedSegueToTableViewController”
> 
> 2. in the UITableViewController which formerly did have a UITableView and now 
> has the container view:
> 
> - (void)viewDidLoad 
> {
>   …
>   [ self performSegueWithIdentifier: @“EmbedSegueToTableViewController” 
> sender: self ];
> }

That’s bizarre, and shouldn’t be necessary. I just tried my test project again 
to make sure, and the table view appears without needing to do this.

Are you sure this wasn’t a timing problem, where you expected the table view to 
exist before the loading process got to it? I can’t think of any other 
explanation.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com