Strange UIWebView issue after upgrading to Xcode8

2016-09-19 Thread Diederik Meijer
Dear list,

In my app I have a horizontal UIStackView that has three UIViews, each of which 
has a UIWebView.

The UIStackView is embedded in a UIScrollView. The scrollView’s frame equals 
the viewController’s view’s frame, its content size is three times the 
viewController’s view’s width.

This operates as an infinite carousel for text content.

The whole view hierarchy is created in IB and uses auto layout. Platform is 
iOS, source code used Objective-C and Swift 2.3.

The problem I have is that when the user rotates the device, the UIWebViews 
embedded in the UIStackView don’t fill their entire size.

A part of the right hand side of the UIWebViews is not used/filled by the 
UIWebView, instead it is revealing the UIWebView’s superView.

The size of this unused part increases with every subsequent rotation.

I have tested the frame size width for both the UIWebView and its scrollView in 
the didRotateFromInterfaceOrientation function, those numbers are fine and 
stable, they don’t change no matter how many times I rotate the device. This 
suggests that auto layout is working as expected.

So while both these width parameters keep returning 634.5 for landscape 
orientation and 447.5 for portrait orientation, the webView’s visible content 
size is shrinking a little bit with every rotation.

I have tried various suggestions found on Stackoverflow, even adding a viewport 
metatag with the correct width before reloading the web view’s content after 
each rotation.

None of these seem to fix this issue.

Has anybody here run into this issue and are there any pointers towards a 
solution?


Many thanks,



Diederik


___

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: Fade when changing window's rootViewController possible?

2015-11-25 Thread Ten Horses | Diederik Meijer
Please ignore, managed to solve this 10 minutes after hitting send…



On 7 nov. 2015, at 22:30, Diederik Meijer <diede...@tenhorses.com> wrote:

> Dear list,
> 
> Is it possible to change an iOS app window’s rootViewController at runtime 
> and have a fade animation between the two states happen?
> 
> Obviously there is no modal or push presentation, the view is just replaced 
> by a new one. For this reason a fade between the two would be nice.
> 
> This is for iOS 8 and up, coding in Objective-C.
> 
> 
> Many thanks,
> 
> 
> 
> Diederik
> 
> 
> 
> ___
> 
> 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/diederik%40tenhorses.com
> 
> This email sent to diede...@tenhorses.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

SOLVED: Fade when changing window's rootViewController possible?

2015-11-09 Thread Diederik Meijer
This has probably changed then in iOS 8 or 9. It used to be 
splitViewControllers MUST be root and could not be presented modally, see third 
paragraph on this page:

https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewControllerCatalog/Chapters/SplitViewControllers.html

"A split view controller must always be the root of any interface you create.”


Anyway, if it can be presented modally now, then, obviously, I don’t have a 
problem anymore, which is sweet!

I set the subject to SOLVED, that should flag it to others as to require no 
more attention.

Thanks again,



Diederik



> Op 9 nov. 2015, om 18:40 heeft David Duncan <david.dun...@apple.com> het 
> volgende geschreven:
> 
>> 
>> On Nov 7, 2015, at 11:31 PM, Diederik Meijer <diede...@tenhorses.com 
>> <mailto:diede...@tenhorses.com>> wrote:
>> 
>> Thank you David,
>> 
>> I forgot to mention that one of them is a UISplitViewController and - unless 
>> this has changed - that one can not be presented modally.
> 
> I’m not aware of any particular reason why a split view controller could not 
> be presented modally. Alternatively you could present the other view 
> controller with no animation and then dismiss it when you want to reveal the 
> split view controller.
> 
>> It is for this reason that I want to switch the window’s rootViewController. 
>> Otherwise, a plain presentViewController would definitely make a lot more 
>> sense :-)
>> 
>> This is what I actually found briefly after sending the question (method 
>> edited for my app’s specifics and original code found not in a separate 
>> method).
>> 
>> Method added to appDelegate:
>> 
>> -(void)switchWindowRootVCTo:(NSString *)newVCString {
>> id newVC = nil;
>> if ([newVCString isEqual:@"UISplitViewController"]) newVC = self.svc;
>> else if ([newVCString isEqual:@"THWelcomeVC"]) newVC = self.wvc;
>> self.window.rootViewController = newVC;
>> [UIView transitionWithView:self.window 
>>  duration:0.50
>>  options:UIViewAnimationOptionTransitionCrossDissolve 
>> animations:^{ 
>>  self.window.rootViewController = newVC; 
>>  }
>>  completion:nil];
>> }
>> 
>> So both the old and the new root VC are properties of the appDelegate 
>> (self.svc and self.wvc respectively) and they are both initialized in 
>> applicationDidiFinishLaunching.
>> 
>> Each of them can call the above method of the app delegate and trigger the 
>> switch.
>> 
>> 
>> Best regards,
>> 
>> 
>> 
>> Diederik
>> 
>> 
>> 
>>> Op 8 nov. 2015, om 04:36 heeft David Duncan <david.dun...@apple.com 
>>> <mailto:david.dun...@apple.com>> het volgende geschreven:
>>> 
>>>> 
>>>> On Nov 7, 2015, at 1:30 PM, Diederik Meijer <diede...@tenhorses.com 
>>>> <mailto:diede...@tenhorses.com>> wrote:
>>>> 
>>>> Dear list,
>>>> 
>>>> Is it possible to change an iOS app window’s rootViewController at runtime 
>>>> and have a fade animation between the two states happen?
>>> 
>>> Not trivially, but you can do this trivially by presenting your 
>>> “replacement” view controller modally, which is also the more supported 
>>> path (by far).
>>> 
>>>> 
>>>> Obviously there is no modal or push presentation, the view is just 
>>>> replaced by a new one. For this reason a fade between the two would be 
>>>> nice.
>>>> 
>>>> This is for iOS 8 and up, coding in Objective-C.
>>>> 
>>>> 
>>>> Many thanks,
>>>> 
>>>> 
>>>> 
>>>> Diederik
>>>> 
>>>> 
>>>> 
>>>> ___
>>>> 
>>>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com 
>>>> <mailto: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 
>>>> <http://lists.apple.com/>
>>>> 
>>>> Help/Unsubscribe/Update your Subscription:
>>>> https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com 
>>>> <https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com>
>>>> 
>>>> This email sent to david.dun...@apple.com <mailto:david.dun...@apple.com>
>>> 
>>> --
>>> David Duncan
>> 
> 
> --
> David Duncan

___

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

Fade when changing window's rootViewController possible?

2015-11-07 Thread Diederik Meijer
Dear list,

Is it possible to change an iOS app window’s rootViewController at runtime and 
have a fade animation between the two states happen?

Obviously there is no modal or push presentation, the view is just replaced by 
a new one. For this reason a fade between the two would be nice.

This is for iOS 8 and up, coding in Objective-C.


Many thanks,



Diederik



___

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: Fade when changing window's rootViewController possible?

2015-11-07 Thread Diederik Meijer
Thank you David,

I forgot to mention that one of them is a UISplitViewController and - unless 
this has changed - that one can not be presented modally. It is for this reason 
that I want to switch the window’s rootViewController. Otherwise, a plain 
presentViewController would definitely make a lot more sense :-)

This is what I actually found briefly after sending the question (method edited 
for my app’s specifics and original code found not in a separate method).

Method added to appDelegate:

-(void)switchWindowRootVCTo:(NSString *)newVCString {
id newVC = nil;
if ([newVCString isEqual:@"UISplitViewController"]) newVC = self.svc;
else if ([newVCString isEqual:@"THWelcomeVC"]) newVC = self.wvc;
self.window.rootViewController = newVC;
[UIView transitionWithView:self.window 
duration:0.50
options:UIViewAnimationOptionTransitionCrossDissolve 
animations:^{ 
self.window.rootViewController = newVC; 
}
completion:nil];
}

So both the old and the new root VC are properties of the appDelegate (self.svc 
and self.wvc respectively) and they are both initialized in 
applicationDidiFinishLaunching.

Each of them can call the above method of the app delegate and trigger the 
switch.


Best regards,



Diederik



> Op 8 nov. 2015, om 04:36 heeft David Duncan <david.dun...@apple.com> het 
> volgende geschreven:
> 
>> 
>> On Nov 7, 2015, at 1:30 PM, Diederik Meijer <diede...@tenhorses.com 
>> <mailto:diede...@tenhorses.com>> wrote:
>> 
>> Dear list,
>> 
>> Is it possible to change an iOS app window’s rootViewController at runtime 
>> and have a fade animation between the two states happen?
> 
> Not trivially, but you can do this trivially by presenting your “replacement” 
> view controller modally, which is also the more supported path (by far).
> 
>> 
>> Obviously there is no modal or push presentation, the view is just replaced 
>> by a new one. For this reason a fade between the two would be nice.
>> 
>> This is for iOS 8 and up, coding in Objective-C.
>> 
>> 
>> Many thanks,
>> 
>> 
>> 
>> Diederik
>> 
>> 
>> 
>> ___
>> 
>> 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/david.duncan%40apple.com 
>> <https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com>
>> 
>> This email sent to david.dun...@apple.com <mailto:david.dun...@apple.com>
> 
> --
> David Duncan

___

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

Background fetch with localNotification

2015-09-01 Thread Diederik Meijer
Hi list,

I have added backgroundFetch to my app.

If new data is available, I have the app store it to disk and then inform the 
user with a localNotification by calling:

[[UIApplication sharedApplication] 
presentLocalNotificationNow:notification]

What I’m not sure off is whether I need to place this call inside a 
dispatch_async(dispatch_get_main_queue(), ^ { }) block, or not?

This being in the background, it seems sensible to do so? On the other hand, 
since the notification is handed by iOS, not by the app itself, this may be 
superfluous?

Additional question: since this uses presentLocalNotificationNow, is there 
still any need to call cancelAllLocalNotifications in order to ensure the 
notification is only fired once?


Thank you,




Diederik



___

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

Change window's rootViewController at runtime

2015-07-29 Thread Diederik Meijer
Did my message below get posted yesterday? I see no replies and did get a weird 
spam response.



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 number of content packages, the selection is used 
to populate the UISplitViewControllers’s view controllers.

Obviously, the Home Screen must be loaded before or at the same time the 
splitview becomes visible, the splitview must not be visible before the Home 
Screen becomes visible.

In a previous project I worked around this by calling presentViewController in 
the UISplitViewController’s viewController that populates the splitview’s 
detail section, setting animated to NO.

However, this triggers warnings that indicate that the presenting 
viewController tries to present a viewController while a presentation is in 
progress. This indicates the system wants to be done with loading the splitView 
and laying out is subviews, before one of its subviews can call 
presentViewController to load the Home Screen.

In a current project I am taking a different approach, as follows:

At application launch both the UISplitViewController and the “preceding” 
UIViewController are both instantiated as properties of the AppDelegate and the 
“preceding” UIViewController is initially set as the app delegate window’s 
rootViewController. The app now launches immediately into the Home Screen, not 
being called from any other ViewController.

After user selection, a method is called in the app delegate that replaces the 
window’s rootViewController, setting it to the UISplitViewController. At the 
same time, the UISplitViewController’s ViewControllers in master and detail get 
the information needed to get the data they need to populate their views.

This works fine and I get no warnings or errors.

However, since it is the first time I am taking this approach I would like to 
double check if I am overlooking any issues. In short, is this approach 
acceptable? Or are there any risks to it?


Many thanks,




Diederik
___

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

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 number of content packages, the selection is used 
to populate the UISplitViewControllers’s view controllers.

Obviously, the Home Screen must be loaded before or at the same time the 
splitview becomes visible, the splitview must not be visible before the Home 
Screen becomes visible.

In a previous project I worked around this by calling presentViewController in 
the UISplitViewController’s viewController that populates the splitview’s 
detail section, setting animated to NO.

However, this triggers warnings that indicate that the presenting 
viewController tries to present a viewController while a presentation is in 
progress.

In a current project I am taking another approach, as follows:

At application launch both the UISplitViewController and the “preceding” 
UIViewController are both instantiated as properties of the AppDelegate and the 
“preceding” UIViewController is initially set as the app delegate window’s 
rootViewController. The app now launches immediately into the Home Screen, not 
being called from any other ViewController.

After user selection, a method is called in the app delegate that replaces the 
window’s rootViewController, setting it to the UISplitViewController. At the 
same time, the UISplitViewController’s ViewControllers in master and detail get 
the information needed to update their data.

This works fine and I get no warnings or errors.

However, since it is the first time I am taking this approach I would like to 
double check if I am overlooking any issues. In short, is this approach 
acceptable?


Many thanks,




Diederik


___

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: Avoid staircasing by creating keyPath dynamically possible?

2015-03-07 Thread Diederik Meijer
Thanks Ken, but this does not seem to traverse down into n nested levels, 
correct? The loop goes through the nodeTree's first level children only (pardon 
the bad semantics here)

The aim is to add text sections to the appropriate items array, which can 
either be a chapter, a chapter's section or a chapter's section's subsection 
and so on... It is a multilevel table of contents

This is why I need to expand the keyPath, so as to reach the appropriate nested 
level...

But thanks for your thoughts, highly appreciated!



Sent from my iPhone

 On 07 Mar 2015, at 12:36, Ken Thomases k...@codeweavers.com wrote:
 
 On Mar 7, 2015, at 5:02 AM, Diederik Meijer diede...@tenhorses.com wrote:
 
 This is part of XML parsing with NSXMLParser, is there any way to avoid this 
 type of staircasing by constructing a keyPath dynamically?
 
   if (self.nestingLevel == 1) { [[[self.rootparser nodeTree] 
 lastObject][@items] addObject:dict]; }
   if (self.nestingLevel == 2) { self.rootparser nodeTree] 
 lastObject][@items] lastObject][@items] addObject:dict]; }
   if (self.nestingLevel == 3) { [self.rootparser nodeTree] 
 lastObject][@items] lastObject][@items] lastObject][@items] 
 addObject:dict]; }
   if (self.nestingLevel == 4) { [[self.rootparser nodeTree] 
 lastObject][@items] lastObject][@items] lastObject][@items] 
 lastObject][@items] addObject:dict]; }
 
 As you can see the action is always the same: addObject:dict
 
 But depending on the level of nesting, lastObject][@items”] needs to be 
 added multiple times to the self.rootparser’s nodeTree property.
 
 Is there any way to use a loop that runs for self.nestingLevel times and 
 adds the extra levels to the keyPath just as many times as needed and then 
 use that to access the noteTree at the exact right level?
 
 No.  Key paths can't index into arrays.  However, you can just use a simply 
 for loop.  Something like:
 
 NSMutableArray* array = [[self.rootparser nodeTree] lastObject][@items];
 for (int i = 1; i  self.nestingLevel; i++)
array = array.lastObject[@items];
 [array addObject:dict];
 
 Regards,
 Ken
 
 

___

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

Avoid staircasing by creating keyPath dynamically possible?

2015-03-07 Thread Diederik Meijer
Hi all,

This is part of XML parsing with NSXMLParser, is there any way to avoid this 
type of staircasing by constructing a keyPath dynamically?

if (self.nestingLevel == 1) { [[[self.rootparser nodeTree] 
lastObject][@items] addObject:dict]; }
if (self.nestingLevel == 2) { self.rootparser nodeTree] 
lastObject][@items] lastObject][@items] addObject:dict]; }
if (self.nestingLevel == 3) { [self.rootparser nodeTree] 
lastObject][@items] lastObject][@items] lastObject][@items] 
addObject:dict]; }
if (self.nestingLevel == 4) { [[self.rootparser nodeTree] 
lastObject][@items] lastObject][@items] lastObject][@items] 
lastObject][@items] addObject:dict]; }

As you can see the action is always the same: addObject:dict

But depending on the level of nesting, lastObject][@items”] needs to be added 
multiple times to the self.rootparser’s nodeTree property.

Is there any way to use a loop that runs for self.nestingLevel times and adds 
the extra levels to the keyPath just as many times as needed and then use that 
to access the noteTree at the exact right level?

Although the above code works fine, I would much rather be able to use an 
abstract (variable) number of nesting levels, instead of the hardcoded 4 I am 
using now.

Any thoughts would be appreciated, thanks!


Best,

Diederik



___

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: Avoid staircasing by creating keyPath dynamically possible?

2015-03-07 Thread Diederik Meijer
Sorry, yes I see now!! Will try that out and let you know!



Sent from my iPhone

 On 07 Mar 2015, at 13:43, Ken Thomases k...@codeweavers.com wrote:
 
 On Mar 7, 2015, at 6:34 AM, Diederik Meijer diede...@tenhorses.com wrote:
 
 On 07 Mar 2015, at 12:36, Ken Thomases k...@codeweavers.com wrote:
 
 On Mar 7, 2015, at 5:02 AM, Diederik Meijer diede...@tenhorses.com wrote:
 
 This is part of XML parsing with NSXMLParser, is there any way to avoid 
 this type of staircasing by constructing a keyPath dynamically?
 
 if (self.nestingLevel == 1) { [[[self.rootparser nodeTree] 
 lastObject][@items] addObject:dict]; }
 if (self.nestingLevel == 2) { self.rootparser nodeTree] 
 lastObject][@items] lastObject][@items] addObject:dict]; }
 if (self.nestingLevel == 3) { [self.rootparser nodeTree] 
 lastObject][@items] lastObject][@items] lastObject][@items] 
 addObject:dict]; }
 if (self.nestingLevel == 4) { [[self.rootparser nodeTree] 
 lastObject][@items] lastObject][@items] lastObject][@items] 
 lastObject][@items] addObject:dict]; }
 
 As you can see the action is always the same: addObject:dict
 
 But depending on the level of nesting, lastObject][@items”] needs to be 
 added multiple times to the self.rootparser’s nodeTree property.
 
 Is there any way to use a loop that runs for self.nestingLevel times and 
 adds the extra levels to the keyPath just as many times as needed and then 
 use that to access the noteTree at the exact right level?
 
 No.  Key paths can't index into arrays.  However, you can just use a simply 
 for loop.  Something like:
 
 NSMutableArray* array = [[self.rootparser nodeTree] lastObject][@items];
 for (int i = 1; i  self.nestingLevel; i++)
  array = array.lastObject[@items];
 [array addObject:dict];
 
 
 Thanks Ken, but this does not seem to traverse down into n nested levels, 
 correct?
 
 It does traverse down.  It's just like your code, except generalized.
 
 The loop goes through the nodeTree's first level children only (pardon the 
 bad semantics here)
 
 Each time through the loop, it reassigns the array variable.  So, the next 
 time through the loop, it's accessing a deeper level of the tree.
 
 Regards,
 Ken
 
 

___

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: UIPicker

2015-01-19 Thread Diederik Meijer | Ten Horses
I think you can call selectRow: inComponent: animated: in viewWillAppear to 
achieve an initial selection




Op 19 Jan 2015, om 21:58 heeft Alex Zavatone z...@mac.com het volgende 
geschreven:

 iOS UIPicker first display issues.
 
 Hi.  Some of our users are having problems with the UIPicker when its 
 initially displayed.
 
 Since the UIPicker displays with an item in the row already, many users 
 instantly think that value displayed is the one selected and immediately 
 dismiss the picker view.
 
 I've tried to call selectRow: inComponent: animated: and didSelectRow: 
 inComponent: on the pickerView after I've allocated it, but these fail to 
 actually select the row.
 
 Within didSelectRow: inComponent: is where I'm handling what is selected.
 
 When is the proper time to declare which row to show as selected?  
 
 As it is now, I'm thinking of resorting to the dismissal of pickerView and 
 checking to see if the selectedRowInComponent is equal to nil.
 
 Any advice on the proper location in the creation of the UIPicker to assign 
 this is appreciated.
 
 Thanks,
 Alex
 
 Sent from my iPad. Please pardon typos.
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: Trouble getting ISO-8859-1 encoded feed to parse and display

2014-11-24 Thread Diederik Meijer | Ten Horses


Verstuurd vanaf mijn iPhone

 Op 24 nov. 2014 om 04:13 heeft Keary Suska cocoa-...@esoteritech.com het 
 volgende geschreven:
 
 On Nov 23, 2014, at 11:06 AM, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 I am having trouble getting useful data from this url on some, but not all, 
 iOS devices:https://www.taxpublications.deloitte.co.uk/tis/dtp.nsf/pub1.xml
 
 The feed has this opening tag: ?xml version=1.0 encoding=ISO-8859-1 ?
 
 When I just pull in the feed’s contents using a NSURLConnection, it will 
 show up on some, but not all, devices.
 
 When I try to log the response data, by creating a string that I init with 
 the downloaded data and NSUTF8StringEncoding, the log will show a null 
 string. So putting the downloaded data into a string using UTF8 doesn’t work.
 
   NSString *dataString = [[NSString alloc] initWithData:self.dataContainer 
 encoding:NSUTF8StringEncoding];
 
 The above code is wrong in your case. The second parameter must be the 
 encoding that the characters are currently in, not the encoding you want 
 NSString is--at least outwardly--encoding-agnostic. It doesn't care what you 
 feed into it, it will always spit out UTF8 unless you specify otherwise.

Agreed

 
 Still, in that case, some devices will show the parsed feed, some won’t.
 
 Separating the erros in your debugging attempts vs what might actually be 
 happening is more useful at the moment.

Agreed, but I have no clear errors

 
 I tried converting the data into NSISOLatin1 and then putting it back into 
 NSData using UTF8, as below, but that doesn’t help.
 
 This would be entirely pointless, as the XML parser shouldn't care what 
 character encoding is used, as long as it is declared. UTF8 is magical for 
 the parser.
 
 -(void)connectionDidFinishLoading:(NSURLConnection *)connection {
   NSString *dataString = [[NSString alloc] initWithData:self.dataContainer 
 encoding:NSISOLatin1StringEncoding];
 
 This line is the proper way to convert the data into a string. You can then 
 NSLog() with impunity. I would also include the data length, just to make 
 sure that a nil result is not due to empty or nil data.
 

Will try this, thanks


   [self setDataContainer:[[dataString 
 dataUsingEncoding:NSUTF8StringEncoding] mutableCopy]];
   self.xmlItems = [NSMutableArray array];
   NSXMLParser *parser = [[NSXMLParser alloc] 
 initWithData:self.dataContainer];
   [parser setDelegate:self];
   [parser parse];
 }
 
 
 I validated the feed’s XML and got no errors..
 
 HTH,
 
 Keary Suska
 Esoteritech, Inc.
 
 
 

___

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: Trouble getting ISO-8859-1 encoded feed to parse and display

2014-11-24 Thread Diederik Meijer | Ten Horses


Verstuurd vanaf mijn iPhone

 Op 24 nov. 2014 om 05:15 heeft Jens Alfke j...@mooseyard.com het volgende 
 geschreven:
 
 
 On Nov 23, 2014, at 1:06 PM, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 When I just pull in the feed’s contents using a NSURLConnection, it will 
 show up on some, but not all, devices.
 
 What does show up mean in this case? Is there an error? If so, what is it?

It means that sometimes the feed is parsed into an NSArray of NSDictionairies 
that is datasource to a UITableView which loads fine, while in other cases no 
data gets shown in the TVC, it stays empty

I get no errors, but no results from the parser either. I haven't tested 
against didStartElement, because it seems clear that no data goes into the 
parser. NSJSONSeriliazation would throw a 'data is nil' error if it were JSON, 
NSXMLParser doesn't seem to do that

Can this be a special characters, you should escape some of them issue?

 
 When I try to log the response data, by creating a string that I init with 
 the downloaded data and NSUTF8StringEncoding, the log will show a null 
 string. So putting the downloaded data into a string using UTF8 doesn’t work.
 
 UTF-8 is a completely different encoding.
 
 I validated the feed’s XML and got no errors..
 
 It's valid XML, but it's got some problems as an RSS feed; take a look at
   
 http://feedvalidator.org/check.cgi?url=https%3A%2F%2Fwww.taxpublications.deloitte.co.uk%2Ftis%2Fdtp.nsf%2Fpub1.xml
 These are mostly minor, like nonstandard extra elements, but it's also got 
 problems with its date formatting, and also the server reports the 
 Content-Type is ASCII while the XML says it's ISO-8859-1.
 
 If NSXMLParser is having trouble with the encoding, one problem I've seen 
 before is documents that claim to be ISO-8859-1 while actually being 
 WinLatin, which is a superset with extra characters defined. (The Cocoa 
 encoding name for this is NSWindowsCP1252StringEncoding, IIRC.)
 

Thanks, will try that

 (I spent four years of my life immersed in RSS feed parsing, and acquired a 
 solid contempt for the ability of the average web developer to construct a 
 valid feed. You would not believe how many messed-up feeds there are in the 
 real world.)
 
 —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: Trouble getting ISO-8859-1 encoded feed to parse and display

2014-11-24 Thread Diederik Meijer | Ten Horses
Op 24 Nov 2014, om 19:01 heeft Jens Alfke j...@mooseyard.com het volgende 
geschreven:

 
 On Nov 24, 2014, at 9:30 AM, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 I get no errors, but no results from the parser either. I haven't tested 
 against didStartElement, because it seems clear that no data goes into the 
 parser.
 
 Did you implement these delegate methods:
 - (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError;
 - (void)parser:(NSXMLParser *)parser validationErrorOccurred:(NSError 
 *)validationError;
 ?

I have now (see below), doesn’t show me anything in the simulator, will test on 
one of the erring devices tomorrow, by the way, both of the following lines log 
the data content out just fine:

NSString *dataString = [[NSString alloc] initWithData:self.dataContainer 
encoding:NSISOLatin1StringEncoding];
NSString *dataString = [[NSString alloc] initWithData:self.dataContainer 
encoding:NSWindowsCP1252StringEncoding];


 
 I'm pretty sure that NSXMLParser wouldn't fail without returning any sort of 
 error. If it does, you should file a bug report with Apple once you have a 
 reproducible case.
 
 —Jens
 



- (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError {
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@PARSE ERROR IN 
CHANNEL message:[parseError localizedDescription] delegate:nil 
cancelButtonTitle:@OK otherButtonTitles:nil, nil];
[av show];
NSLog(@ERROR IN CHANNEL: %@, [parseError localizedDescription]);
}

- (void)parser:(NSXMLParser *)parser validationErrorOccurred:(NSError 
*)validationError {
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@VALIDATION ERROR IN 
CHANNEL message:[validationError localizedDescription] delegate:nil 
cancelButtonTitle:@OK otherButtonTitles:nil, nil];
[av show];
NSLog(@ERROR IN CHANNEL: %@, [validationError localizedDescription]);
}

___

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

Trouble getting ISO-8859-1 encoded feed to parse and display

2014-11-23 Thread Diederik Meijer | Ten Horses
Hi list,

I am having trouble getting useful data from this url on some, but not all, iOS 
devices: https://www.taxpublications.deloitte.co.uk/tis/dtp.nsf/pub1.xml

The feed has this opening tag: ?xml version=1.0 encoding=ISO-8859-1 ?

When I just pull in the feed’s contents using a NSURLConnection, it will show 
up on some, but not all, devices.

When I try to log the response data, by creating a string that I init with the 
downloaded data and NSUTF8StringEncoding, the log will show a null string. So 
putting the downloaded data into a string using UTF8 doesn’t work.

NSString *dataString = [[NSString alloc] initWithData:self.dataContainer 
encoding:NSUTF8StringEncoding];


Still, in that case, some devices will show the parsed feed, some won’t.

I tried converting the data into NSISOLatin1 and then putting it back into 
NSData using UTF8, as below, but that doesn’t help.

-(void)connectionDidFinishLoading:(NSURLConnection *)connection {
NSString *dataString = [[NSString alloc] initWithData:self.dataContainer 
encoding:NSISOLatin1StringEncoding];
[self setDataContainer:[[dataString dataUsingEncoding:NSUTF8StringEncoding] 
mutableCopy]];
self.xmlItems = [NSMutableArray array];
NSXMLParser *parser = [[NSXMLParser alloc] initWithData:self.dataContainer];
[parser setDelegate:self];
[parser parse];
}


I validated the feed’s XML and got no errors..

Anybody out there with experience in solving this?


Many thanks!



Diederik
___

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

UIWebView not scaling page (iOS8)

2014-10-08 Thread Diederik Meijer | Ten Horses
Hi list,

I have a UIWebView inside a UITableViewCell that simply won’t scale the page to 
fit on iOS8. I have set it to scale pages to fit in IB and have also tried 
setting it in code, but it simply won’t do it.

The UIWebView depicts a JPG image located at a web location.

I had no trouble with this on iOS7.

It may be bad practise to stuff a web view inside a tableViewCell, I am not 
sure. But it should still be able to scale the page to fit into it, shouldn’t 
it?


Many thanks,


Diederik
___

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: return string that is the difference between two other strings

2014-09-21 Thread Diederik Meijer | Ten Horses
I do a lot of text data mining and need similar functions a lot. I would start 
on a word by word level, to have whatever it returns be more meaningfull

Verstuurd vanaf mijn iPhone

 Op 20 sep. 2014 om 19:43 heeft Scott Ribe scott_r...@elevated-dev.com het 
 volgende geschreven:
 
 On Sep 20, 2014, at 11:13 AM, 2551 2551p...@gmail.com wrote:
 
 For example:
 
  NSString *mary = @mary had a little lamb, a little lamb she had;
   NSString *scary = @mary had a little lamb, a little naughty fella of a 
 lamb she had for sure;
   NSString *isDifferent = [self getDifference:mary and: scary];
   NSLog(@%@, isDifferent);
 
 The method I posted below produces the difference that I want (naughty 
 fella of a for sure). But I want to know if there's a more orthodox and 
 robust solution.
 
 That's not even remotely close to a definition of what you mean. What about:
 
 @mary had a little lamb, a little naughty lamb she had
 
 vs
 
 @mary had a little lamb, a little fella of a lamb she had for sure
 
 ?
 
 Or:
 
 @mary had a little lamb, a naughty little lamb she had
 
 vs
 
 @mary had a big lamb, a little fella of a lamb she had for sure
 
 There is no simple definition of the difference between two strings, and I 
 don't think it's a basic need at all.
 
 -- 
 Scott Ribe
 scott_r...@elevated-dev.com
 http://www.elevated-dev.com/
 (303) 722-0567 voice
 
 
 
 
 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: return string that is the difference between two other strings

2014-09-21 Thread Diederik Meijer | Ten Horses
Meaning I would compare words and their index in an array of words created from 
the two strings. The first mismatch is easily found, but the tricky part is 
finding the last one. Here a context driven comparison may help. Instead of 
comparing word N in both strings, you compare words N and N-1, taking into 
consideration the number of extra words found in previous iterations. I have 
not tested this specific case, but can tell you context driven may help. All 
depends on whether you need the actual difference returned. If not, life is 
easy :-)

Verstuurd vanaf mijn iPhone

 Op 21 sep. 2014 om 08:24 heeft Diederik Meijer | Ten Horses 
 diede...@tenhorses.com het volgende geschreven:
 
 I do a lot of text data mining and need similar functions a lot. I would 
 start on a word by word level, to have whatever it returns be more meaningfull
 
 Verstuurd vanaf mijn iPhone
 
 Op 20 sep. 2014 om 19:43 heeft Scott Ribe scott_r...@elevated-dev.com het 
 volgende geschreven:
 
 On Sep 20, 2014, at 11:13 AM, 2551 2551p...@gmail.com wrote:
 
 For example:
 
 NSString *mary = @mary had a little lamb, a little lamb she had;
  NSString *scary = @mary had a little lamb, a little naughty fella of a 
 lamb she had for sure;
  NSString *isDifferent = [self getDifference:mary and: scary];
  NSLog(@%@, isDifferent);
 
 The method I posted below produces the difference that I want (naughty 
 fella of a for sure). But I want to know if there's a more orthodox and 
 robust solution.
 
 That's not even remotely close to a definition of what you mean. What about:
 
 @mary had a little lamb, a little naughty lamb she had
 
 vs
 
 @mary had a little lamb, a little fella of a lamb she had for sure
 
 ?
 
 Or:
 
 @mary had a little lamb, a naughty little lamb she had
 
 vs
 
 @mary had a big lamb, a little fella of a lamb she had for sure
 
 There is no simple definition of the difference between two strings, and I 
 don't think it's a basic need at all.
 
 -- 
 Scott Ribe
 scott_r...@elevated-dev.com
 http://www.elevated-dev.com/
 (303) 722-0567 voice
 
 
 
 
 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: return string that is the difference between two other strings

2014-09-21 Thread Diederik Meijer | Ten Horses
Note that there are two differences, I would want to know: where string A says 
this, string B says that. So you have both this and 'that for a 
difference. A lot of times, pre-optimizing your strings helps, meaning you 
first take out punctuation (mostly comma's) and remember where to put them back 
in. Also splitting may sometimes need NSRegularExpression instead of 
ComponentsSeparatedByString to be better. In general pre-optimizing is a 
necessity. In my experience, customizing a workplan between pre-optimizing and 
comparison/search based on the actual content gives the best results. It's more 
time-consuming though...

Verstuurd vanaf mijn iPhone

 Op 21 sep. 2014 om 08:42 heeft 2551 2551p...@gmail.com het volgende 
 geschreven:
 
 
 On 21 Sep 2014, at 13:38, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 Meaning I would compare words and their index in an array of words created 
 from the two strings.
 
 Thanks, Diederik. That's exactly the approach I took by using 
 NSMutableArray's -removeObject. 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: Changing app screenshots after submission

2014-09-18 Thread Diederik Meijer | Ten Horses
Has been like this for about 15 months, before that you could change at will




Op 18 Sep 2014, om 19:25 heeft Rick Mann rm...@latencyzero.com het volgende 
geschreven:

 I learned yesterday that you can't change the screenshots in the App Store 
 after your app is approved. Has this always been the case? It seems ludicrous 
 that I have to submit a new binary to change the screenshots (but that's 
 exactly what iTunesConnect support told me).
 
 
 -- 
 Rick Mann
 rm...@latencyzero.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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: NSUserDefaults not sticking

2014-09-09 Thread Diederik Meijer | Ten Horses
Are you calling synchronise too when you're writing?

[[NSUserDefault standardUserDefaults] synchronise]



Verstuurd vanaf mijn iPhone

 Op 10 sep. 2014 om 07:43 heeft Rick C. rickcort...@gmail.com het volgende 
 geschreven:
 
 Thanks for the help.  So I have double-checked and the info in question that 
 is not sticking is NSString/NSData being written:
 
 [[NSUserDefaults standardUserDefaults] setObject:stringObject 
 forKey:@“MyStringKey”];
 [[NSUserDefaults standardUserDefaults] setObject:dataObject 
 forKey:@“MyDataKey”];
 
 Then being read:
 
 NSString *myStringObject = [[NSUserDefaults standardUserDefaults] 
 stringForKey:@“MyStringKey];
 NSData *myDataObject = [[NSUserDefaults standardUserDefaults] 
 dataForKey:@“MyDataKey”];
 
 I am not manipulating my .plist in any other way only using NSUserDefaults.  
 I am aware of the caching issues that started in Mavericks, but if we can’t 
 read/write using NSUserDefaults how else can we do it?  Also, when I say not 
 sticking this could be from day to day so I would expect the cache to be 
 updated in that amount of time.  What else can I do here or what am I doing 
 wrong???
 
 
 
 On Sep 9, 2014, at 2:08 PM, Graham Cox graham@bigpond.com wrote:
 
 
 On 9 Sep 2014, at 3:36 pm, Rick C. rickcort...@gmail.com wrote:
 
 I write some data to my .plist using standard NSUserDefaults
 
 
 Are you writing the .plist file, or are you using the NSUserDefaults object 
 exclusively? From 10.9 the .plist isn't updated by NSUserDefaults, so values 
 there can be very much out of date, because the defaults system caches its 
 contents.
 
 You can't rely on the plist being an accurate representation of what the 
 user defaults actually contains.
 
 --Graham
 
 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: Resolve alternative TLD

2014-07-04 Thread Diederik Meijer | Ten Horses
That's very promising, thank you!

I have no experience with this sort of thing, hopefully I can make that work 
with NSURLConnection or -Session..

I'll look into the documentation on NSURLProtocol

Thanks again to you both!



Op Jul 4, 2014, om 10:01 PM heeft Jens Alfke j...@mooseyard.com het volgende 
geschreven:

 
 On Jul 4, 2014, at 4:27 AM, Uli Kusterer witness.of.teacht...@gmx.net wrote:
 
 On OS X you could probably also register a URL scheme of your own (or 
 override an existing URL scheme) by hooking into the URL loading system. Not 
 sure whether that API is available on iOS, but might be worth looking into 
 as a hook-in point for a manual DNS resolution
 
 Yes, NSURLProtocol is available on iOS (all versions), and it could be used 
 this way.
 
 —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: Resolve alternative TLD

2014-07-04 Thread Diederik Meijer | Ten Horses
Thanks Jens, will try all that over the coming days


Op Jul 4, 2014, om 11:13 PM heeft Jens Alfke j...@mooseyard.com het volgende 
geschreven:

 
 On Jul 4, 2014, at 1:24 PM, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 I have no experience with this sort of thing, hopefully I can make that work 
 with NSURLConnection or -Session..
 
 If you register an NSURLProtocol, it will be used by anything (in your 
 process) that uses NSURLConnection or NSURLSession. That includes UIWebViews.
 
 Basically, when you register a protocol class, it’ll be called for every 
 request and gets a chance to claim it or not. You’d just claim any request 
 where the NSURL’s host matched your custom domain. Then you have to handle 
 the request by returning an NSURLResponse and a sequence of NSData objects. 
 In your case you’d start up an NSURLConnection of your own (with the hostname 
 changed to a hardcoded IP address) and delegate to that.
 
 —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

Resolve alternative TLD

2014-07-03 Thread Diederik Meijer | Ten Horses
Dear list,

Is it possible to have an iOS app connect to a web server through a domain name 
that uses an alternative TLD (top level domain name)?

The issue being that the TLD (think for example: domain.law, with law being the 
TLD) is accessible through a DNS server, but since the TLD is not officially 
registered with ICANN, standard browsers do not resolve the domain into an IP 
address. Using a standard UIWebView does not work. But, I repeat, the server is 
up and running and the domain is accessible through the network.

Is there any way to configure my app's networking classes to handle this, like 
resolving the domain itself, or pointing the networking requests to the 
appropriate DNS?

Is there anybody out there with experience on this that can point me in the 
right direction?

I think I saw something related fly by on this list a couple of weeks back, but 
now I cannot seem to find it.


Many thanks,

Diederik



___

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: Resolve alternative TLD

2014-07-03 Thread Diederik Meijer | Ten Horses
Take start.rental as an example, has a live server on the dot rental TLD, but 
no standard browser will resolve it, try it in Safari, you'll see..

Verstuurd vanaf mijn iPhone

 Op 3 jul. 2014 om 18:22 heeft Jens Alfke j...@mooseyard.com het volgende 
 geschreven:
 
 
 On Jul 3, 2014, at 6:52 AM, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 The issue being that the TLD (think for example: domain.law, with law being 
 the TLD) is accessible through a DNS server, but since the TLD is not 
 officially registered with ICANN, standard browsers do not resolve the 
 domain into an IP address. Using a standard UIWebView does not work. But, I 
 repeat, the server is up and running and the domain is accessible through 
 the network.
 
 Really? I’m not aware of anything built into browsers that restricts them to 
 a fixed set of “official” TLDs. As far as I know, the client simply hands off 
 _any_ hostname for DNS lookup, which will query the configured DNS server(s).
 
 Are you 100% sure that the DNS is configured correctly? For example, the name 
 server (or some parent of it) needs to have a custom entry for “.law”, 
 otherwise it will end up querying upstream for it, and the upstream (ISP) 
 name servers won’t know about that TLD.
 
 Also, are you 100% sure that the iOS device is configured to access the DNS 
 server that knows about your custom domain? It’s probably getting the name 
 server IP addresses via DHCP.
 
 —Jens
 
 PS: This question really belongs on the macnetworkprog mailing list. There 
 are Apple networking gurus hanging out there who don’t monitor cocoa-dev.
___

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: Resolve alternative TLD

2014-07-03 Thread Diederik Meijer | Ten Horses
In addition, if you run it through the Sundial browser 
(www.sundialbrowser.com), it will resolve .rental domains...

ICANN effectively has a monopoly on which TLD's are accessible.

Forclarity: this is not a new TLD generally issued, it is a TLD issued bu 
unifiedroot.com

Verstuurd vanaf mijn iPhone

 Op 3 jul. 2014 om 18:22 heeft Jens Alfke j...@mooseyard.com het volgende 
 geschreven:
 
 
 On Jul 3, 2014, at 6:52 AM, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 The issue being that the TLD (think for example: domain.law, with law being 
 the TLD) is accessible through a DNS server, but since the TLD is not 
 officially registered with ICANN, standard browsers do not resolve the 
 domain into an IP address. Using a standard UIWebView does not work. But, I 
 repeat, the server is up and running and the domain is accessible through 
 the network.
 
 Really? I’m not aware of anything built into browsers that restricts them to 
 a fixed set of “official” TLDs. As far as I know, the client simply hands off 
 _any_ hostname for DNS lookup, which will query the configured DNS server(s).
 
 Are you 100% sure that the DNS is configured correctly? For example, the name 
 server (or some parent of it) needs to have a custom entry for “.law”, 
 otherwise it will end up querying upstream for it, and the upstream (ISP) 
 name servers won’t know about that TLD.
 
 Also, are you 100% sure that the iOS device is configured to access the DNS 
 server that knows about your custom domain? It’s probably getting the name 
 server IP addresses via DHCP.
 
 —Jens
 
 PS: This question really belongs on the macnetworkprog mailing list. There 
 are Apple networking gurus hanging out there who don’t monitor cocoa-dev.
___

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: Resolve alternative TLD

2014-07-03 Thread Diederik Meijer | Ten Horses
Thanks, prefixing my one just reports 'server cannot be found'...

Verstuurd vanaf mijn iPhone

 Op 3 jul. 2014 om 18:54 heeft Paul Scott psc...@skycoast.us het volgende 
 geschreven:
 
 This is a known problem on Safari for Mac, and presumably for iOS. I reported 
 it, and my bug report was closed as a duplicate of radar:10252476. We have a 
 corporate TLD that does not resolve in safari, unless you prefix it with 
 http:// so that Safari doesn’t treat it as a search term.
 
 Paul
 
 On Jul 3, 2014, at 9:22 AM, Jens Alfke j...@mooseyard.com wrote:
 
 
 On Jul 3, 2014, at 6:52 AM, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 The issue being that the TLD (think for example: domain.law, with law being 
 the TLD) is accessible through a DNS server, but since the TLD is not 
 officially registered with ICANN, standard browsers do not resolve the 
 domain into an IP address. Using a standard UIWebView does not work. But, I 
 repeat, the server is up and running and the domain is accessible through 
 the network.
 
 Really? I’m not aware of anything built into browsers that restricts them to 
 a fixed set of “official” TLDs. As far as I know, the client simply hands 
 off _any_ hostname for DNS lookup, which will query the configured DNS 
 server(s).
 
 Are you 100% sure that the DNS is configured correctly? For example, the 
 name server (or some parent of it) needs to have a custom entry for “.law”, 
 otherwise it will end up querying upstream for it, and the upstream (ISP) 
 name servers won’t know about that TLD.
 
 Also, are you 100% sure that the iOS device is configured to access the DNS 
 server that knows about your custom domain? It’s probably getting the name 
 server IP addresses via DHCP.
 
 —Jens
 
 PS: This question really belongs on the macnetworkprog mailing list. There 
 are Apple networking gurus hanging out there who don’t monitor cocoa-dev.
 
 --
 Paul Scott
 psc...@skycoast.us
 
___

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: Resolve alternative TLD

2014-07-03 Thread Diederik Meijer | Ten Horses
Wait, so it's not a real DNS server, or what? I suppose in that case you'd have 
to take the URL and look up the domain yourself, then feed the raw IP address 
to WebKit instead.
 
 Cheers,
 -- Uli Kusterer
 The Witnesses of TeachText are everywhere...
 http://www.zathras.d


Exactly, any experience on looking up the domain and handling the ip address? I 
have no idea how to do that...



___

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: Resolve alternative TLD

2014-07-03 Thread Diederik Meijer | Ten Horses
This is what it looks like in the Sundial browser: 
http://www.tenhorses.com/sundial.png

So I guess I somehow need to handle DNS Lookup / IP resolving myself, is there 
anybody here who has any idea how to proceed?

Thanks!





Op Jul 3, 2014, om 7:31 PM heeft Alex Zavatone z...@mac.com het volgende 
geschreven:

 Firefox doesn't resolve start.rental either.
 Neither does Chrome.
 
 On Jul 3, 2014, at 12:58 PM, Diederik Meijer | Ten Horses wrote:
 
 Take start.rental as an example, has a live server on the dot rental TLD, 
 but no standard browser will resolve it, try it in Safari, you'll see..
 
 Verstuurd vanaf mijn iPhone
 
 Op 3 jul. 2014 om 18:22 heeft Jens Alfke j...@mooseyard.com het volgende 
 geschreven:
 
 
 On Jul 3, 2014, at 6:52 AM, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 The issue being that the TLD (think for example: domain.law, with law 
 being the TLD) is accessible through a DNS server, but since the TLD is 
 not officially registered with ICANN, standard browsers do not resolve the 
 domain into an IP address. Using a standard UIWebView does not work. But, 
 I repeat, the server is up and running and the domain is accessible 
 through the network.
 
 Really? I’m not aware of anything built into browsers that restricts them 
 to a fixed set of “official” TLDs. As far as I know, the client simply 
 hands off _any_ hostname for DNS lookup, which will query the configured 
 DNS server(s).
 
 Are you 100% sure that the DNS is configured correctly? For example, the 
 name server (or some parent of it) needs to have a custom entry for “.law”, 
 otherwise it will end up querying upstream for it, and the upstream (ISP) 
 name servers won’t know about that TLD.
 
 Also, are you 100% sure that the iOS device is configured to access the DNS 
 server that knows about your custom domain? It’s probably getting the name 
 server IP addresses via DHCP.
 
 —Jens
 
 PS: This question really belongs on the macnetworkprog mailing list. There 
 are Apple networking gurus hanging out there who don’t monitor cocoa-dev.
 ___
 
 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/zav%40mac.com
 
 This email sent to z...@mac.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: Resolve alternative TLD

2014-07-03 Thread Diederik Meijer | Ten Horses
OK thanks everybody!


Op Jul 3, 2014, om 10:54 PM heeft Jens Alfke j...@mooseyard.com het volgende 
geschreven:

 
 On Jul 3, 2014, at 1:33 PM, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 So I guess I somehow need to handle DNS Lookup / IP resolving myself, is 
 there anybody here who has any idea how to proceed?
 
 If this were Mac OS you could edit /etc/hosts and add an entry for that 
 domain, but that won’t fly on iOS.
 
 You can set up a local nameserver (bind or something like that) and configure 
 it with a hardwired entry for that domain, then point the local WiFi router 
 to use that nameserver as the DNS address it advertises via DHCP.
 
 —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: Insetting a UIWebView while a keyboard is on screen

2014-05-28 Thread Diederik Meijer
You could consider animating the UiWebview up when the keyboard appears and 
down again when it disappears. 

Verstuurd vanaf mijn iPad

 Op 28 mei 2014 om 05:40 heeft Nick Zitzmann n...@chronosnet.com het 
 volgende geschreven:
 
 Short question: What's the best way to scroll a UIWebView slightly from its 
 current position when there's a keyboard present? I already tried 
 -[UIScrollView setContentInset:], but that does not work when a keyboard is 
 on screen.
 
 Long question:
 
 I have a UIWebView, and I'm trying to graft a custom keyboard extension onto 
 it that will appear on top of the keyboard. Since UIWebView doesn't support 
 -inputAccessoryView, I've made this happen by listening for 
 UIKeyboardWillShowNotification, and then adding the extension view as a 
 subview when the notification is received.
 
 This works fine, except that the spot the user is editing might appear 
 underneath the keyboard extension, so I need to inset the scroll view in 
 order to compensate for this or the user won't be able to see what they are 
 editing. So I tried adjusting the scroll view's content inset, but I noticed 
 that UIWebView makes its own adjustment to the content inset whenever the 
 keyboard appears, and the attempt to change it twice in a row seems to cause 
 the content inset to change to some other number internally for some reason. 
 So how do I move the scroll view slightly if adjusting the content inset 
 won't work?
 
 Nick Zitzmann
 http://www.chronosnet.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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: Insetting a UIWebView while a keyboard is on screen

2014-05-28 Thread Diederik Meijer | Ten Horses
Keyboard appears in response to a html input element getting focus? If so, 
adding a javascript scrollTo may work. When the element gets focus, calculate 
its y position in the webview and call scrollTo with relevant coordinates. 
Maybe all in javascript, which makes it fast and lightwight. Do you own the 
html? 

Verstuurd vanaf mijn iPhone

 Op 29 mei 2014 om 00:27 heeft Nick Zitzmann n...@chronosnet.com het 
 volgende geschreven:
 
 
 On May 28, 2014, at 2:11 AM, Diederik Meijer diede...@tenhorses.com wrote:
 
 You could consider animating the UiWebview up when the keyboard appears and 
 down again when it disappears.
 
 That works, but then I have the opposite problem - touching in an area that 
 isn't obscured by the keyboard causes it to be moved off the top of the 
 screen. So I tried using UIGestureRecognizer to figure out where the user 
 touched the screen, but UIGestureRecognizers added to UIWebViews don't seem 
 to be called when the view is touched.
 
 So how do I figure out where the user touched the view so the app can know 
 when not to move the view? The AppKit has the -[NSApplication currentEvent] 
 property, but I can't find any UIKit equivalent.
 
 Nick Zitzmann
 http://www.chronosnet.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

White rectangle behind UIAlertView when subview clipsToBounds

2014-05-15 Thread Diederik Meijer | Ten Horses
Dear list,

I implemented a very straightforward UIAlertView.

For some reason, on iPad, a light rectangular appears behind the alertview, 
here is what it looks like:

http://www.tenhorses.com/apps/alertScreenshot.jpg

What makes it strange is that that light rectangle is not visible when I take a 
screenshot, see jpg

This only happens on iPad, not on iPhone.

The centre part (the white card on the larger background) is a UIView that has 
a number of subviews.

This UIView has clipsToBounds set to yes, because I have subviews flying in 
with animations.

If I set clipsToBounds to NO, then the alertview is shown normally without any 
issues.

Has anybody run into this and is there a way to fix this?

Many thanks,

Diederik


___

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: White rectangle behind UIAlertView when subview clipsToBounds

2014-05-15 Thread Diederik Meijer | Ten Horses
Hi David,

Many thanks for your quick response!

UIAlertView is called here:

-(void)welcomeAlert {
if (![[NSUserDefaults standardUserDefaults] 
objectForKey:@welcomeAlertShown] || [[[NSUserDefaults standardUserDefaults] 
valueForKey:@welcomeAlertShown] isEqual:@NO]) {
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@Welcome to 365 
days of Flow! message:@\nPlease swipe left or right to browse\n\nTap the 
screen to find the menu for more options delegate:nil cancelButtonTitle:@OK 
otherButtonTitles:nil, nil];
[av show];
[[NSUserDefaults standardUserDefaults] setValue:@YES 
forKey:@welcomeAlertShown];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}



So indeed, simply by 'show'.


View hierarchy is as follows:

ViewController's view
UIImageView for fullscreen background image (image changes when user 
scrolls, the UIScrollView below)
UIImageView for transparent PNG background image (image changes when 
user scrolls, the UIScrollView below)
UIView (the centred iPhone5-like view)
UIScrollView
3 UILabels (for the date strings)
3 UIImageViews (for the images)
UIView (separate view with sharing buttons, shown/hidden by 
button click)
UIView (Date selector view with UIPickerView, kept offscreen, 
animates into

Screenshot from Xcode/IB: http://www.tenhorses.com/apps/IBscreenshot.png

As mentioned, if I turn off clipsToBounds on the centred iPhone5-like UIView, I 
have no problems with the alert, but then my last UIView (Date selector view) 
becomes visible, which is something I can't have…

To me it seems the view hierarchy is slightly complex, but not to any kind of 
extreme.

Many thanks again,

Diederik





Op May 15, 2014, om 6:53 PM heeft David Duncan david.dun...@apple.com het 
volgende geschreven:

 
 On May 15, 2014, at 8:42 AM, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 Dear list,
 
 I implemented a very straightforward UIAlertView.
 
 For some reason, on iPad, a light rectangular appears behind the alertview, 
 here is what it looks like:
 
 http://www.tenhorses.com/apps/alertScreenshot.jpg
 
 What makes it strange is that that light rectangle is not visible when I 
 take a screenshot, see jpg
 
 This only happens on iPad, not on iPhone.
 
 The centre part (the white card on the larger background) is a UIView that 
 has a number of subviews.
 
 This UIView has clipsToBounds set to yes, because I have subviews flying in 
 with animations.
 
 If I set clipsToBounds to NO, then the alertview is shown normally without 
 any issues.
 
 Has anybody run into this and is there a way to fix this?
 
 When it doesn’t appear in screenshots it usually means its a transient 
 compositing error (as the screenshot re-composites the screen).
 
 I’m not certain what exactly would cause this, but you might be served by 
 better describing your view hierarchy (and I assume you are showing your 
 alert with the -show method, and that it is a plain UIAlertView and not a 
 subclass).
 
 
 Many thanks,
 
 Diederik
 
 
 ___
 
 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/david.duncan%40apple.com
 
 This email sent to david.dun...@apple.com
 
 --
 David Duncan
 
 

___

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: White rectangle behind UIAlertView when subview clipsToBounds

2014-05-15 Thread Diederik Meijer | Ten Horses
Update: this sequence of steps is a workaround that avoids the problem:

1. Setting the view that should remain invisible hidden;
2. Setting clipsToBounds on its parent to NO;
3. Now create and show the alert;
4. On a tap on the 'OK' button, reverse 1 and 2, meaning:
5. Set clipsToBounds on the parent to YES;
6. Setting the view that should remain invisible's hidden property to NO.

This is not problematic because the UIAlertView takes over the entire 
interface, so there is no harm in making it impossible for the hidden view to 
animate into my visible area.

Nevertheless, it does seem strange I need these steps to have a normal 
UIAlertView experience in my use case, so I'm still very interested in helpful 
feedback!







Op May 15, 2014, om 8:23 PM heeft Diederik Meijer | Ten Horses 
diede...@tenhorses.com het volgende geschreven:

 Hi David,
 
 Many thanks for your quick response!
 
 UIAlertView is called here:
 
 -(void)welcomeAlert {
if (![[NSUserDefaults standardUserDefaults] 
 objectForKey:@welcomeAlertShown] || [[[NSUserDefaults standardUserDefaults] 
 valueForKey:@welcomeAlertShown] isEqual:@NO]) {
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@Welcome to 365 
 days of Flow! message:@\nPlease swipe left or right to browse\n\nTap the 
 screen to find the menu for more options delegate:nil 
 cancelButtonTitle:@OK otherButtonTitles:nil, nil];
[av show];
[[NSUserDefaults standardUserDefaults] setValue:@YES 
 forKey:@welcomeAlertShown];
[[NSUserDefaults standardUserDefaults] synchronize];
}
 }
 
 
 
 So indeed, simply by 'show'.
 
 
 View hierarchy is as follows:
 
 ViewController's view
   UIImageView for fullscreen background image (image changes when user 
 scrolls, the UIScrollView below)
   UIImageView for transparent PNG background image (image changes when 
 user scrolls, the UIScrollView below)
   UIView (the centred iPhone5-like view)
   UIScrollView
   3 UILabels (for the date strings)
   3 UIImageViews (for the images)
   UIView (separate view with sharing buttons, shown/hidden by 
 button click)
   UIView (Date selector view with UIPickerView, kept offscreen, 
 animates into
 
 Screenshot from Xcode/IB: http://www.tenhorses.com/apps/IBscreenshot.png
 
 As mentioned, if I turn off clipsToBounds on the centred iPhone5-like UIView, 
 I have no problems with the alert, but then my last UIView (Date selector 
 view) becomes visible, which is something I can't have…
 
 To me it seems the view hierarchy is slightly complex, but not to any kind of 
 extreme.
 
 Many thanks again,
 
 Diederik
 
 
 
 
 
 Op May 15, 2014, om 6:53 PM heeft David Duncan david.dun...@apple.com het 
 volgende geschreven:
 
 
 On May 15, 2014, at 8:42 AM, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 Dear list,
 
 I implemented a very straightforward UIAlertView.
 
 For some reason, on iPad, a light rectangular appears behind the alertview, 
 here is what it looks like:
 
 http://www.tenhorses.com/apps/alertScreenshot.jpg
 
 What makes it strange is that that light rectangle is not visible when I 
 take a screenshot, see jpg
 
 This only happens on iPad, not on iPhone.
 
 The centre part (the white card on the larger background) is a UIView that 
 has a number of subviews.
 
 This UIView has clipsToBounds set to yes, because I have subviews flying in 
 with animations.
 
 If I set clipsToBounds to NO, then the alertview is shown normally without 
 any issues.
 
 Has anybody run into this and is there a way to fix this?
 
 When it doesn’t appear in screenshots it usually means its a transient 
 compositing error (as the screenshot re-composites the screen).
 
 I’m not certain what exactly would cause this, but you might be served by 
 better describing your view hierarchy (and I assume you are showing your 
 alert with the -show method, and that it is a plain UIAlertView and not a 
 subclass).
 
 
 Many thanks,
 
 Diederik
 
 
 ___
 
 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/david.duncan%40apple.com
 
 This email sent to david.dun...@apple.com
 
 --
 David Duncan
 
 
 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.com


___

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

Please do not post

JSONSerialization 'Garbage at end' error

2014-04-30 Thread Diederik Meijer | Ten Horses
Hi all,

I have Googled this issue for hours and tried various solutions suggested at 
Stackoverflow, but can't seem to solve the following problem.

I am pulling JSON from here: 
http://www.tenhorses.com/apps/meijburg/dotTAXDataHandler/dotTAXtaxNotesAPI.php

Both JSONLint, http://jsonformatter.curiousconcept.com and freeformatter.com 
say this is valid JSON.

I am using the NSURLConnection delegate methods (appending data as it comes in 
to a NSMutableData object) and are  serialising the downloaded data in the 
didFinishLoading like so:

NSError *error;
id jsonObject = [NSJSONSerialization JSONObjectWithData:self.container 
options:NSJSONReadingAllowFragments error:error];
if (error) {
NSLog(@ERROR: %@, error);
}
else {
if ([self.type isEqual:@people] || [self.type isEqual:@projects] || 
[self.type isEqual:@taxNotes]) jsonObject = [jsonObject 
objectForKey:@items];
NSString *notificationName = [NSString 
stringWithFormat:@%@DataDownloaded, self.type];
[[NSNotificationCenter defaultCenter] 
postNotificationName:notificationName object:nil userInfo:[NSDictionary 
dictionaryWithObject:jsonObject forKey:@jsonArray]];
[sharedConnectionList removeObject:self];
}


In short this sends off a notification with a pointer to an NSArray in case the 
downloader object's type is 'people', projects' or 'taxNotes' and to a 
NSDictionary in other cases.

Now here is the problem: although the JSON parses fine and populates a 
UITableView without any issues, I am still getting the following error:

Error Domain=NSCocoaErrorDomain Code=3840 The operation couldn’t be completed. 
(Cocoa error 3840.) (Garbage at end.) UserInfo=0xa2329a0 
{NSDebugDescription=Garbage at end.}

I tested by creating an NSString from the data object and adding a few 
characters at the end. Never does that reveal anything that should be there at 
the end of the JSON string.

This, in itself, is slightly unsettling, but not critically wrong..

Has anybody here experienced a similar issue?

If so, can you tell me how to fix this?

Many thanks,

Diederik


___

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: JSONSerialization 'Garbage at end' error

2014-04-30 Thread Diederik Meijer | Ten Horses
Thanks Steve, that's promising, most likely something wrong in my 
NSURLConnection code then, or the way I call it.

I don't think there's anything trailing in the JSON content, there really 
isn'tt much in there his is the api server code:

?php
header(Content-Type: application/json; charset=UTF-8);
   $link = mysql_connect('localhost','[USERNAME','[PASSWORD') or die 
(mysql_error($link));
mysql_query(SET NAMES 'utf8');
mysql_select_db('[DB NAME') or die('Can't select database');
$query = SELECT * FROM `[TABLE NAME]` ORDER BY `date` DESC LIMIT 0, 
100;
$result = mysql_query($query) or die('ERROR EXECUTING QUERY 
'.mysql_error($link));

 $TaxNotes = array();

 while ($row = mysql_fetch_array($result)) {
$UserName = $row['username'];
$DossierName = $row['dossierName'];
$Text = $row['text'];
$date = new DateTime($row['date']);
$Date = $date-format('d.m.Y');
$Hyperlink = $row['hyperlink'];
$Title = $row['title'];
$PictureURL = $row['pictureUrl'];

   $Note = array(
username = $UserName,
dossiername = $DossierName,
text = $Text,
date = $Date,
link = $Hyperlink,
title = $Title,
pictureUrl = $PictureURL
 );

array_push($TaxNotes, $Note);
}
$object = new stdClass();
$object-items = $TaxNotes;
echo json_encode($object);
?





Op Apr 30, 2014, om 9:14 PM heeft Steve Christensen puns...@mac.com het 
volgende geschreven:

 I’m already doing downloads in my app using NSURLSession so I used my 
 existing code to download and decode the data returned by the URL below and 
 didn’t get an error. I am building against iOS 7.1 and I tried it out in the 
 simulator.
 
 Doing a brief search, it seems like when others are running into this error, 
 they’re working with JSON data that really does have garbage at the end. Is 
 it possible that you’re doing something like appending a null terminator or 
 something else non-printable so that when you look at the data then it all 
 seems OK?
 
 
 On Apr 30, 2014, at 8:20 AM, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 Hi all,
 
 I have Googled this issue for hours and tried various solutions suggested at 
 Stackoverflow, but can't seem to solve the following problem.
 
 I am pulling JSON from here: 
 http://www.tenhorses.com/apps/meijburg/dotTAXDataHandler/dotTAXtaxNotesAPI.php
 
 Both JSONLint, http://jsonformatter.curiousconcept.com and freeformatter.com 
 say this is valid JSON.
 
 I am using the NSURLConnection delegate methods (appending data as it comes 
 in to a NSMutableData object) and are  serialising the downloaded data in 
 the didFinishLoading like so:
 
   NSError *error;
   id jsonObject = [NSJSONSerialization JSONObjectWithData:self.container 
 options:NSJSONReadingAllowFragments error:error];
   if (error) {
   NSLog(@ERROR: %@, error);
   }
   else {
   if ([self.type isEqual:@people] || [self.type isEqual:@projects] 
 || [self.type isEqual:@taxNotes]) jsonObject = [jsonObject 
 objectForKey:@items];
   NSString *notificationName = [NSString 
 stringWithFormat:@%@DataDownloaded, self.type];
   [[NSNotificationCenter defaultCenter] 
 postNotificationName:notificationName object:nil userInfo:[NSDictionary 
 dictionaryWithObject:jsonObject forKey:@jsonArray]];
   [sharedConnectionList removeObject:self];
   }
 
 
 In short this sends off a notification with a pointer to an NSArray in case 
 the downloader object's type is 'people', projects' or 'taxNotes' and to a 
 NSDictionary in other cases.
 
 Now here is the problem: although the JSON parses fine and populates a 
 UITableView without any issues, I am still getting the following error:
 
 Error Domain=NSCocoaErrorDomain Code=3840 The operation couldn’t be 
 completed. (Cocoa error 3840.) (Garbage at end.) UserInfo=0xa2329a0 
 {NSDebugDescription=Garbage at end.}
 
 I tested by creating an NSString from the data object and adding a few 
 characters at the end. Never does that reveal anything that should be there 
 at the end of the JSON string.
 
 This, in itself, is slightly unsettling, but not critically wrong..
 
 Has anybody here experienced a similar issue?
 
 If so, can you tell me how to fix this?
 
 Many thanks,
 
 Diederik
 
 


___

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: JSONSerialization 'Garbage at end' error

2014-04-30 Thread Diederik Meijer | Ten Horses
Thanks Andy and Jens!



Op Apr 30, 2014, om 10:07 PM heeft Andy Lee ag...@mac.com het volgende 
geschreven:

 On Apr 30, 2014, at 3:21 PM, Jens Alfke j...@mooseyard.com wrote:
 On Apr 30, 2014, at 8:20 AM, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 Now here is the problem: although the JSON parses fine and populates a 
 UITableView without any issues, I am still getting the following error:
 
 If the JSON parsed fine, then the error must be coming from somewhere else. 
 A call to JSONObjectWithData: either returns a parsed object, or returns nil 
 and sets the error. It doesn’t do both :)
 
 Which means...
 
   NSError *error;
   id jsonObject = [NSJSONSerialization JSONObjectWithData:self.container 
 options:NSJSONReadingAllowFragments error:error];
   if (error) {
   NSLog(@ERROR: %@, error);
   }
   else {
 
 ...you shouldn't be testing error, you should be checking whether jsonObject 
 is nil, and only then look at the error.  Doing it the wrong way around could 
 explain false errors.  For example, NSJSONSerialization could pessimistically 
 stick an error object in there as the default error, but manage to parse 
 successfully and return a non-nil object.  But then I'm not sure how you 
 could *also* be having your table populated with the right objects.
 
 --Andy
 
 


___

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: HTML emails from Objective C

2013-12-22 Thread Diederik Meijer | Ten Horses
Can you post your code please?


Op Nov 26, 2013, om 9:16 PM heeft Bryan Schmiedeler bryanschmiede...@me.com 
het volgende geschreven:

 I am trying to write an HTML email using Objective C.
 
 I have the HTML all done, now I am just putting it into mutable string line 
 by line. I am using / to escape when I need a quote in the HTML. 
 
 This I think will work but sure seems tedious. Is there something I am 
 missing, some library that helps with this.
 
 Thanks,
 Bryan
 
 Bryan Schmiedeler
 12263 Rosewood Drive
 Overland Park, KS 66209-3517
 bryanschmiede...@me.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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: Best way to put a fixed view in a UITableViewController scene?

2013-11-27 Thread Diederik Meijer | Ten Horses
Not if your UITableView has only one section and you use the section's header 
view in the way Marcelo suggests. Sections headers scroll up to the top and 
then remain there - visible - while additional cells scroll underneath it…




Op Nov 27, 2013, om 4:30 AM heeft Rick Mann rm...@latencyzero.com het 
volgende geschreven:

 
 On Nov 26, 2013, at 19:18 , Marcelo Alves marcelo.al...@me.com wrote:
 
 Probably I’m missing something or I’m just naïve (or stupid), but what about 
 the tableHeaderView (or tableFooterView) property? (not the same as section 
 headers)
 
 It scrolls with the table content.
 
 -- 
 Rick
 
 
 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: Threadsafe copy of objective c object

2013-09-03 Thread Diederik Meijer | Ten Horses
Is it possible to reverse the issue? Keep the original object (living on the 
main thread) untouched, make a copy for algorithm processing as an async task, 
then, when done, update the original object from the copy that may have been 
changed during async processing? Or will that cause the exact same problem in 
the final step?

Verstuurd vanaf mijn iPhone

Op 3 sep. 2013 om 13:16 heeft Lasse Jansen la...@lasselog.com het volgende 
geschreven:

 Since the implementation of -copy is up to you, you could just put 
 @synchronized(self){…..} around the code in that method. That implements a 
 lock which should make the copy thread-safe.
 
 
 No, it wouldn't. It would only ensure that two calls to copy are executed 
 sequentially. You would need to add @synchronized(self) {…} to all other 
 methods that modify the object too to ensure that the object isn't changed 
 during a copy.
 
 
 Lasse
 
 
 
 
 Sent with Unibox
 
 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: Introducing ioscomponents.com

2013-08-28 Thread Diederik Meijer | Ten Horses
Hi Jason,

Don't be too disappointed. This is exactly what The Lean Startup (a good read!) 
is all about and I am pretty sure quite a few of us have run into a situation 
like this ourselves. I was thinking about your remark on the radio buttons. I 
could be wrong, but I think it is the only control in your suite for which 
Foundation does not offer a widely known and used standard object. The closest 
thing is a UISegmentedControl, but that is still quite different from radio 
buttons, like Java has. So my guess is that you are getting a lot of feedback 
on it, because it is not regularly available and a custom control has to be 
created when a clients requests something like that. If that thought were true, 
than maybe focussing on controls that are currently absent in Foundation, but 
that could be useful might be a strategy to consider? A successful example 
would be the 'Facebook' panels, for which there is no out-of-the-box solution, 
but which are hugely popular. In short, my 5 cents would be to not focus on 
existing controls for which - to be honest - it will be very hard to come up 
with look and feel improvements AND for which coding practices are widely 
known, used and very accessible, but to focus on the white spots on the map 
instead.. Along the way, try to get feedback from your target audience as early 
as possible, maybe even at the drawing table, and let them help you find the 
best direction..

Best,

Diederik





Op Aug 28, 2013, om 12:04 AM heeft Jason Gibbs iosmaniac...@gmail.com het 
volgende geschreven:

 Allright - thanks everyone - I feel like going and hiding beneath a rock or
 something - We put months of blood and sweat into this thing and did not
 focus on the one thing that matters - polish and presentation.  I am
 already going through the website and fixing the inconsistencies. However,
 as you guys said, we need a serious UX review of the whole thing. I am
 going to keep the website up as we do this, otherwise google will forget
 us. I hope to fix these mistakes and hopefully next time I ask for
 feedback, you guys wont be disappointed.
 
 Thanks again for your brutal, yet VERY constructive and HIGHLY appreciated
 feedback. This is just what we needed.
 
 
 On Tue, Aug 27, 2013 at 12:03 PM, David E Blanton 
 aired...@tularosa.netwrote:
 
 
 On Aug 26, 2013, at 8:56 PM, Jason Gibbs iosmaniac...@gmail.com wrote:
 
 main DataGrid product
 
 
 … is ugly and reminds me of Windows MFC crap.
 
 -koko
 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: Fastest way to replace characters in string

2013-08-22 Thread Diederik Meijer | Ten Horses
Thanks Esteban and Wim,

Indeed, using javascript or jQuery can also be an option.

What actually speeds things up significantly is to revert back to NSString and 
use NSRegularExpression.

I now needs seven seconds on iPad3 to handle 600 replacement actions. This is, 
in itself a VERY long time, but since it is handled by an async task and we 
notify the user that for large law documents this action may take a few 
seconds, the UX should be acceptable, hopefully (up to test group to decide).

Additionally, I can show a progress bar to give visual feedback.

Moreover, less than 5% of the laws included in the app are that large. Most 
laws are handled and updated within two seconds.

Thanks again for thinking with me, I hugely appreciate it.



Best regards,

Diederik



Op Aug 22, 2013, om 1:57 AM heeft Wim Lewis w...@omnigroup.com het volgende 
geschreven:

 
 On 21 Aug 2013, at 4:44 PM, Diederik Meijer | Ten Horses wrote:
 The web service returns the list lightning fast, but in order to get the 
 count number added to each of the 300 articles html h4 header, I am 
 looping through the list and call NSString's 
 stringByReplacingOccurancesOfString:withString: on each item.
 
 There must be a more efficient way to update the html string loaded from the 
 local file, obviously doing more than 300 of these replace actions is slow 
 and inefficient.
 
 The -stringByReplacing... method has to copy the entire string each time you 
 do a replacement. You might be able to get a significant speedup making a 
 mutable copy of the original string, calling 
 -replaceOccurrencesOfString:withString: repeatedly, and (possibly) calling 
 -copy to make a final immutable copy.
 
 Depending on what you're doing, though, it might make more sense to load the 
 original string into the WebView and manipulate the WebView's DOM to update 
 all of the counts and things.
 
 
 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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

Fastest way to replace characters in string

2013-08-21 Thread Diederik Meijer | Ten Horses
Dear list,

I have an iOS app that loads a local html file into a UIWebView.

The content is quite large, about 1MB, it is the full text of a law.

By tapping a button, users can reveal the number of published court rulings for 
each of the law's articles.

As this data changes frequently, a list that has a court ruling count for each 
article is downloaded from a web service.

The web service returns the list lightning fast, but in order to get the count 
number added to each of the 300 articles html h4 header, I am looping 
through the list and call NSString's 
stringByReplacingOccurancesOfString:withString: on each item.

There must be a more efficient way to update the html string loaded from the 
local file, obviously doing more than 300 of these replace actions is slow and 
inefficient.

Does anybody here know of a better way to handle this?

Many thanks!

diederik
___

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

NSLog object = nil?

2013-08-20 Thread Diederik Meijer | Ten Horses
Dear list,

I have the following structure:

An itemStore object creates a worker object (property of itemStore object) that 
hold a weak reference back to the itemStore object;
When the worker classes is done, it sets the itemStore object (of which the 
worker class itself is a property) to nil.

This project uses ARC.

So within itemStore I do:
self.worker = [[Worker alloc] init];
[self.worker setItemStore:self];

In Worker.h I do
@property (nonatomic, weak) ItemStore *itemStore;

In Worker.m, when all its tasks are done, I do
self.itemStore = nil;

I assume this completely destroys the itemStore object and all objects it 
exclusively owns.

Is there any way to NSLog the destruction of the itemStore object?

I tried putting a log in itemStore's dealloc method, but it doesn't show up in 
the console.

Many thanks,

Diederik
___

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: NSLog object = nil?

2013-08-20 Thread Diederik Meijer | Ten Horses
Apologies, no need to respond, I have just fixed this..



Op Aug 20, 2013, om 11:32 PM heeft Diederik Meijer | Ten Horses 
diede...@tenhorses.com het volgende geschreven:

 Dear list,
 
 I have the following structure:
 
 An itemStore object creates a worker object (property of itemStore object) 
 that hold a weak reference back to the itemStore object;
 When the worker classes is done, it sets the itemStore object (of which the 
 worker class itself is a property) to nil.
 
 This project uses ARC.
 
 So within itemStore I do:
 self.worker = [[Worker alloc] init];
 [self.worker setItemStore:self];
 
 In Worker.h I do
 @property (nonatomic, weak) ItemStore *itemStore;
 
 In Worker.m, when all its tasks are done, I do
 self.itemStore = nil;
 
 I assume this completely destroys the itemStore object and all objects it 
 exclusively owns.
 
 Is there any way to NSLog the destruction of the itemStore object?
 
 I tried putting a log in itemStore's dealloc method, but it doesn't show up 
 in the console.
 
 Many thanks,
 
 Diederik
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: NSLog object = nil?

2013-08-20 Thread Diederik Meijer | Ten Horses
Thanks for this. I'd like to try using the Document object that owns the 
itemStore. The itemStore objects are created by the Document object in a loop 
as part of a dispatch_async GCD block. The itemStores' workers have a reference 
to the Document object. But since the itemStore objects are created within a 
loop and not as properties, the Document object has no direct reference to 
them. This means that calling self.document.itemStore = nil won't help either. 
Or is there a way to do this? I'd like to clear out itemStores for which the 
workers have completed their tasks, to manage CPU usage...

Verstuurd vanaf mijn iPhone

Op 20 aug. 2013 om 23:45 heeft Ken Thomases k...@codeweavers.com het volgende 
geschreven:

 On Aug 20, 2013, at 4:32 PM, Diederik Meijer | Ten Horses wrote:
 
 An itemStore object creates a worker object (property of itemStore object) 
 that hold a weak reference back to the itemStore object;
 When the worker classes is done, it sets the itemStore object (of which the 
 worker class itself is a property) to nil.
 
 It doesn't set the object to nil.  It sets its reference to the itemStore 
 object to nil.
 
 This project uses ARC.
 
 So within itemStore I do:
 self.worker = [[Worker alloc] init];
 [self.worker setItemStore:self];
 
 In Worker.h I do
 @property (nonatomic, weak) ItemStore *itemStore;
 
 In Worker.m, when all its tasks are done, I do
 self.itemStore = nil;
 
 I assume this completely destroys the itemStore object and all objects it 
 exclusively owns.
 
 No.  The itemStore property of Worker is weak.  That means it does not 
 influence the lifetime of the itemStore object it references.  Setting the 
 reference to nil simply makes it no longer reference that object.
 
 
 Is there any way to NSLog the destruction of the itemStore object?
 
 I tried putting a log in itemStore's dealloc method, but it doesn't show up 
 in the console.
 
 Putting a call to NSLog() in the -dealloc would be the way to detect it.  
 Nothing is showing up because the itemStore object is not being deallocated.
 
 If you want to deallocate it, you have to make sure to clear all strong 
 references to it.  Clearing weak references doesn't help.
 
 Regards,
 Ken
 
 

___

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: How to get rid of keyboard on iPhone

2013-08-13 Thread Diederik Meijer | Ten Horses
Call resignFirstResponder in the textViewShouldReturn delegation method…
In addition: have a tap anywhere in the screen outside the textView call a 
dismiss as well



Op Aug 13, 2013, om 12:18 PM heeft Gerriet M. Denkmann gerr...@mdenkmann.de 
het volgende geschreven:

 I have an app with a textView on an iPad.
 When I touch it, a keyboard comes up. And when I have typed enough there is, 
 in the bottom right corner of the keyboard, a key, which makes the keyboard 
 disappear again.
 So far so good.
 
 But when the same app runs on an iPhone, the keyboard has no such key.
 
 What is the best way to get rid of the keyboard?
 
 Currently I have added a button: Dismiss Keyboard. 
 Is there an official Dismiss-Keyboard-Image somewhere (looking similar to the 
 one on the iPad keyboard) - to be used for this button?
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: Computing the height for a UITableViewHeaderFooterView

2013-08-06 Thread Diederik Meijer | Ten Horses
The way is handled something similar is by first calculating the label size for 
the dynamic string (which you probably need anyway), then using the returned 
value in the heightForHeaderInSection (or recalculating it with a method call), 
followed by calling reloadData on the tableView. The code below, by the way, is 
portrait only, which is fine in my case, but unlikely to work in yours, so 
you'd have to change that.


somewhere in your data model code:
float labelSizeHeight = [self calculateLabelSizeHeightForText:@blablabla];



-(float)calculateLabelSizeHeightForText:(NSString *)text {
CGSize constraintSize = ([[UIDevice currentDevice] userInterfaceIdiom] == 
UIUserInterfaceIdiomPad) ? CGSizeMake(748.0f, MAXFLOAT) : CGSizeMake(300.0f, 
MAXFLOAT);
//You will need to define kDefaultCellFont
CGSize labelSize = [text sizeWithFont:[UIFont systemFontOfSize:14]
constrainedToSize:constraintSize
lineBreakMode:UILineBreakModeWordWrap];
return labelSize.height+10;
}


- (CGFloat)tableView:(UITableView *)tableView 
heightForHeaderInSection:(NSInteger)section {
return labelSizeHeight;
}




Op Aug 6, 2013, om 9:23 AM heeft Rick Mann rm...@latencyzero.com het volgende 
geschreven:

 Unfortunately, that won't compute the height of the 
 UITableViewHeaderFooterView, which has two different labels with different 
 text characteristics, and who know what positioning within.
 
 On Aug 5, 2013, at 18:57 , synelang synel...@gmail.com wrote:
 
 Try this : (never tested)
 
  • void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView 
 *)view forSection:(NSInteger)section_
 {
  CGSize size = [dataString sizeWithFont:font constrainedToSize:size 
 lineBreakMode:UILineBreakModeWordWrap];  
  CGFrame frame = view.frame;
  frame.size.height = size.height;
  •   [view setFrame:frame]; 
  • }
 
 
 
 Original Message 
 Sender: Rick Mannrm...@latencyzero.com
 Recipient: Cocoa Dev Listcocoa-dev@lists.apple.com
 Date: 星期二, 8月 6, 2013 09:25
 Subject: Computing the height for a UITableViewHeaderFooterView
 
 Is there any way around manually providing the height for a table header 
 view? If I simply provide a title string for the header, UITableView is able 
 to compute the height itself. But if I use a UITableViewHeaderFooterView and 
 set the textLabel and detailTextLabel, I also have to set the height (as far 
 as I can tell).
 
 But the text I'm rendering is dynamic, and could change the number of lines 
 used. Not sure how best to handle this.
 
 -- 
 Rick
 
 
 
 
 ___
 
 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/synelang%40gmail.com
 
 
 This email sent to 
 synel...@gmail.com
 
 
 -- 
 Rick
 
 
 
 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: dev site down time is ridiculous

2013-07-24 Thread Diederik Meijer | Ten Horses
On ZD Net:

Apple hack conducted for the greater good of research
By Charlie Osborne, 5 hours ago

A security researcher has stepped up and shouldered the blame for taking down 
Apple's Dev Center --all in the name of blowing the whistle on bugs.


Verstuurd vanaf mijn iPhone

Op 24 jul. 2013 om 19:21 heeft Bob Sabiston fl...@media.mit.edu het volgende 
geschreven:

 And of course I expect nothing but people to defend Apple and imply that I am 
 f'ed up for complaining -- god forbid someone else should feel the way I do. 
 Bring it on I don't care.  Of COURSE it is completely acceptable and makes 
 perfect sense that a week later the site is not back up!  What is wrong with 
 me.  It's the internet rule of complaining.  
 
 
 
 
 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: height of UITableView with exactly two rows

2013-07-15 Thread Diederik Meijer | Ten Horses
Won't, setting the row height in

- (CGFloat)tableView:(UITableView *)tableView 
heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return something;
}

and then multiplying that something with 2 work?

Add headerView/footerView heights if needed..




Op Jul 15, 2013, om 1:02 PM heeft Koen van der Drift 
koenvanderdr...@gmail.com het volgende geschreven:

 I'd like to add a tableview with exactly two rows under a custom view. I can 
 do that for one size of screen, and empirically figure out what he height of 
 the table should be and be done with it.  But of course that doesn't work 
 anymore when I move to a different size screen or iOS version.
 
 So somehow, I need to find find out what the height is of a UITableView with 
 two rows, and then I can calculate the height of the tableview and custom 
 view and position them.
 
 Is this a job for auto-layout, or is there another way that I am overlooking?
 
 I am not using a xib or storyboards.
 
 Thanks,
 
 - Koen.
 
 
 
 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: height of UITableView with exactly two rows

2013-07-15 Thread Diederik Meijer | Ten Horses
Isn't the standard 44?
Then 2 rows would be 88, or am I missing something?





Op Jul 15, 2013, om 1:08 PM heeft Diederik Meijer | Ten Horses 
diede...@tenhorses.com het volgende geschreven:

 Won't, setting the row height in
 
 - (CGFloat)tableView:(UITableView *)tableView 
 heightForRowAtIndexPath:(NSIndexPath *)indexPath
 {
return something;
 }
 
 and then multiplying that something with 2 work?
 
 Add headerView/footerView heights if needed..
 
 
 
 
 Op Jul 15, 2013, om 1:02 PM heeft Koen van der Drift 
 koenvanderdr...@gmail.com het volgende geschreven:
 
 I'd like to add a tableview with exactly two rows under a custom view. I can 
 do that for one size of screen, and empirically figure out what he height of 
 the table should be and be done with it.  But of course that doesn't work 
 anymore when I move to a different size screen or iOS version.
 
 So somehow, I need to find find out what the height is of a UITableView with 
 two rows, and then I can calculate the height of the tableview and custom 
 view and position them.
 
 Is this a job for auto-layout, or is there another way that I am overlooking?
 
 I am not using a xib or storyboards.
 
 Thanks,
 
 - Koen.
 
 
 
 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: height of UITableView with exactly two rows

2013-07-15 Thread Diederik Meijer | Ten Horses
Seems to be equal on iPhone and iPad

Verstuurd vanaf mijn iPhone

Op 15 jul. 2013 om 13:18 heeft Koen van der Drift koenvanderdr...@gmail.com 
het volgende geschreven:

 
 On Jul 15, 2013, at 7:14 AM, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 Isn't the standard 44?
 Then 2 rows would be 88, or am I missing something?
 
 
 If that won't change in future iOS versions or different screen sizes, then I 
 can use that indeed.
 
 Thanks,
 
 - Koen.

___

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: Javascript call function Objective-C

2013-07-05 Thread Diederik Meijer | Ten Horses
I am not entirely sure whether this is as clean as it can be, but this is 
working for me. Might be a starting point, please give me feedback if this can 
be improved.. 

In your Objective-C class, put in appropriate method:

NSString *path = [[NSBundle mainBundle] 
pathForResource:@javascriptFileName ofType:@js];
NSString *jsCode = [NSString stringWithContentsOfFile:path 
encoding:NSUTF8StringEncoding error:nil];
[self.myWebView stringByEvaluatingJavaScriptFromString:jsCode];
[self.myWebView 
stringByEvaluatingJavaScriptFromString:@javascriptFunction()];
NSString *someString = [self.myWebView 
stringByEvaluatingJavaScriptFromString:@javascriptFunction()];

In javascriptFileName.js file that has been added to the NSBundle:

function javascriptFunction() {
  // javascript logic here
return someReturnValue;
}

By the way, if you want to catch javascript click events, then I think you'd 
need to have that event trigger a return value. That way, your Objective-C 
class can interpret the javascript and act accordingly…



Op Jul 4, 2013, om 3:20 PM heeft Tibira Botto tibira.bo...@gmail.com het 
volgende geschreven:

 it is possible to access a javascript function in Objective-C?
 
 didactic example:
 
 - (NSString *) getName
 {
   return @ Test
 }
 
 in javascript
 function writeReturn(text)
 {
 document.write (text)
 }
 
 onclick = writeReturn (getName () function that in Objective-C).
 
 I'm using Webview and development for OSX.
 
 thank you
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: Moving a textField from under keyboard

2013-06-29 Thread Diederik Meijer | Ten Horses
One way is to animate the UiTextField upwards in the didBeginEditing delegation 
method and down again in the shouldReturn.

Verstuurd vanaf mijn iPhone

Op 29 jun. 2013 om 00:44 heeft Julius Oklamcak juli...@icodemonks.com het 
volgende geschreven:

 I'm looking for something OR some method that knows how to change (I
 think) the position (I think) of the view containing a UITextField so the
 TextField is visible after a keyboard comes up and covers it.  Then the view
 goes back to normal position once the keyboard is dismissed.
 
 Is there an inspector attribute for that? 
 
 Is this a delegation thing?
 
 Have a read through the Managing the Keyboard section in the Text, Web,
 and Editing Programming Guide for iOS.
 
 http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conce
 ptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html 
 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: What, exactly constitutes a mutable action on an instance?

2013-05-29 Thread Diederik Meijer | Ten Horses
May I add two questions to this enlightening thread?

1. With ARC, do we still have to worry about string1 leaking in the following 
scenario?

@property (nonatomic, copy) NSString *string1;
…..
self.string1 = @Hello;
string1 = @Hello hello;
string1 = @Hello hello hello;


2. How do the strong, copy and weak keywords in the property declaration affect 
this?

Thanks!

Diederik



Op May 28, 2013, om 10:16 PM heeft Jens Alfke j...@mooseyard.com het volgende 
geschreven:

 
 On May 28, 2013, at 6:39 AM, Alex Zavatone z...@mac.com wrote:
 
 NSString *myString;
 
 You’ve declared myString as a _mutable_ pointer to an _immutable_ object. If 
 you had declared it as
 
   NSString* const myString = @“Hi;
 
 then the variable itself would be immutable, and the compiler would give you 
 an error if you tried to reassign it. (You often see this style used when 
 declaring a string constant in a header file, since it’s supposed to stay 
 constant and no one should reassign it.)
 
 Working with C++ will beat this concept into your head (for better or worse).
 
 —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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: What, exactly constitutes a mutable action on an instance?

2013-05-29 Thread Diederik Meijer | Ten Horses
Thanks Robert and Quincey, that's very helpful!



Op May 29, 2013, om 8:26 AM heeft Quincey Morris 
quinceymor...@rivergatesoftware.com het volgende geschreven:

 On May 28, 2013, at 23:37 , Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 1. With ARC, do we still have to worry about string1 leaking in the 
 following scenario?
 
 @property (nonatomic, copy) NSString *string1;
 …..
 self.string1 = @Hello;
 string1 = @Hello hello;
 string1 = @Hello hello hello;
 
 No, you don't have to worry. When dealing with objects, ARC handles all 
 retain/release correctly, regardless of whether the assignment is to the 
 property or the ivar. That's kinda the point.
 
 2. How do the strong, copy and weak keywords in the property declaration 
 affect this?
 
 ARC still does the right thing, whether you use the ivar or the setter.
 
 The ownership keyword is multi-purpose (unfortunately, IMO):
 
 1. It defines the ownership attribute of a synthesized ivar (or must match 
 the ownership attribute of a manually declared ivar). For this, copy is the 
 same as strong.
 
 2. It defines the behavior of a synthesized setter. For this, copy makes a 
 copy, everything else just does an assignment (with the appropriate memory 
 management according to the ivar ownership attribute).
 
 3. It declares the ownership attribute of the property itself, separately 
 from the ivar. For this, strong and copy represent a strong property; weak 
 represents a weak property; __unsafe_unretained represents no ownership. 
 However, the property's ownership attribute has no actual effect on the 
 compiler. Everything the compiler does via synthesis is covered under #1 and 
 #2.
 
 Note that #1 and #2 are in truth private implementation details of the class. 
 #3 is the public API contract, and communicates to clients of the class 
 whether the property takes ownership of the property value.
 

___

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: UILabel with superscripts

2013-05-09 Thread Diederik Meijer | Ten Horses
Have you tried loading a NSAttributedString? It's iOS 6 only, a quick search 
implies you can set 
kCTSuperscriptAttributeName to specific ranges in your string...


Verstuurd vanaf mijn iPhone

Op 9 mei 2013 om 14:04 heeft Koen van der Drift koenvanderdr...@gmail.com het 
volgende geschreven:

 Right now I am using an UILabel with unicode symbols to show strings with 
 superscripts, something like this:
 
NSInteger base = 2;
myLabel.text = [NSString stringWithFormat: @%d\u00B2 = %d, base, 
 base*base];
 
 But it kinda looks ugly in my opinion, the subscript is too low relative to 
 the regular characters.  Maybe it's the font I'm using, which is the standard 
 system font.  Are there alternatives? I read about using an UIWebView, but 
 that seems a bit overkill for a simple string.
 
 Thanks,
 
 - Koen.
 
 
 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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


Detect whether UIRefreshControl can be used

2013-05-08 Thread Diederik Meijer | Ten Horses
Hi,

I am implementing a UIRefreshControl in an app that runs on iOS 5.1 or higher 
and want to test if the device is running iOS 6, because this is an iOS 6 
feature.

I'd like to avoid detecting the iOS version in runtime and use a 
respondsToSelector route instead.

I am getting no compiler error on this codeline, so my first guess is this 
works, but I'd like to check..

if ([self respondsToSelector:@selector(setRefreshControl)]) [self 
setUpRefreshControl];

Has anybody done this and van they tell me if the above works fine, or, 
alternatively, how to do this?

Many thanks!

diederik

___

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: Detect whether UIRefreshControl can be used

2013-05-08 Thread Diederik Meijer | Ten Horses
Thank you Nick, that works perfectly!!



Op May 8, 2013, om 5:20 PM heeft Nick Zitzmann n...@chronosnet.com het 
volgende geschreven:

 
 On May 8, 2013, at 8:51 AM, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 I am implementing a UIRefreshControl in an app that runs on iOS 5.1 or 
 higher and want to test if the device is running iOS 6, because this is an 
 iOS 6 feature.
 
 I'd like to avoid detecting the iOS version in runtime and use a 
 respondsToSelector route instead.
 
 I am getting no compiler error on this codeline, so my first guess is this 
 works, but I'd like to check..
 
   if ([self respondsToSelector:@selector(setRefreshControl)]) [self 
 setUpRefreshControl];
 
 Has anybody done this and van they tell me if the above works fine, or, 
 alternatively, how to do this?
 
 If your intent is to check to see if the UIRefreshControl class exists at 
 runtime, then do this instead:
 
 if (NSClassFromString(@UIRefreshControl))
 
 The line you wrote above checks to see if the method setRefreshControl 
 exists inside the method's own class. I doubt that's your intention, 
 especially since set-methods typically take an argument, and if the method 
 takes an argument, then you would need to use setRefreshControl: instead.
 
 Nick Zitzmann
 http://www.chronosnet.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: UITableViewCell with variable height

2013-04-28 Thread Ten Horses | Diederik Meijer
Are you recalculating the size of the label as well? Using the same logic?
I worked on the very same thing yesterday and that got it to work.

In my case the label's content can be very large, with string length up to 
12 characters and I found out that a label's recalculated size doesn't work 
well if the string's length is larger than 20.000...




Op 28 apr. 2013, om 20:57 heeft Koen van der Drift koenvanderdr...@gmail.com 
het volgende geschreven:

 I'm having some problems to resize and show all text in a UITableViewCell 
 based on the contents. It has two labels, the second of which can have a 
 variable length and I'd like to show it all.
 
 So I added this code:
 
 - (CGFloat)tableView:(UITableView *)tableView 
 heightForRowAtIndexPath:(NSIndexPath *)indexPath;
 {
Note *n = [self.notes objectAtIndex: [indexPath row]];
 
CGSize constraint = CGSizeMake(320, 2000.0f);
CGSize size = [n.content sizeWithFont: [UIFont systemFontOfSize: 14.0f]
 constrainedToSize: constraint
 lineBreakMode: NSLineBreakByWordWrapping];
 
CGFloat height = MAX(size.height, 44.0f);
 
return height + 44.0f;
 }
 
 
 The problem is that the height of the cell is changing, but it still shows 
 only one line of the second label. I have also set the numberOfLines to 0, 
 which according to the docs To remove any maximum limit, and use as many 
 lines as needed, set the value of this property to 0.
 
 How can I fix this?
 
 Thanks,
 
 - Koen.
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: ^Block statement considered harmful for callbacks?

2013-04-25 Thread Diederik Meijer | Ten Horses
I don't agree, blocks are very powerful.

I am using Xcode 4.6 and in a project that uses ARC it was throwing warnings 
when a block reference to a property caused a retain cycle. This is how I found 
it and why I mentioned it in another thread in the first place.

I haven't tested it extensively, but it looks as if the compiler recognises 
these situations easily and then tells you about it.

So I wouldn't call blocks dangerous at all…

 


Op Apr 25, 2013, om 10:21 AM heeft Tom Davie tom.da...@gmail.com het volgende 
geschreven:

 
 On 25 Apr 2013, at 09:34, Oleg Krupnov oleg.krup...@gmail.com wrote:
 
 Tom, I disagree, because unlike other objects with strong refs, or say
 @property(retain), the strong refs in blocks are created implicitly
 and it's just too easy to let them slip out of attention. There is no
 direct command to create the strong ref, unlike @property(retain). All
 you do is *mention* self or even an ivar, and voila, you're done.
 
 I wish there was a safe and elegant solution to this, like we did with
 proxy for NSTimer.
 
 I'm not really convinced that the fact that these objects are easier to 
 dynamically create makes the problem that retain counting inherently can't 
 deal with retain cycles any worse.
 
 That said, I wonder if the correct solution to what some are clearly finding 
 an issue here is to look to the compiler.  At least superficially, I could 
 see it being possible to detect a lot of cycles with a static analyser.  
 Obviously you couldn't detect all of them, but this would probably get a good 
 way to stomping on the you used an ivar here, and self retains the block, 
 that's bad m'kay bugs.
 
 Thanks
 
 Tom Davie
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: presentViewController completion block usage

2013-04-16 Thread Diederik Meijer | Ten Horses
An additional thought: when you put references to the presentingVC's properties 
in the completion block you may get retain cycle warnings. This is caused by 
the fact that blocks keep strong references to objects. Passing data back to 
the referring VC could also be done in viewWillDisappear, couldn't it? That 
would secure it gets send over early.


Op Apr 12, 2013, om 3:09 PM heeft Koen van der Drift 
koenvanderdr...@gmail.com het volgende geschreven:

 
 On Apr 12, 2013, at 10:00 AM, Roland King r...@rols.org wrote:
 
 The completion block is really for your view controller to know when it is 
 entirely finished presenting or entirely finished dismissing a view 
 controller so that it can do some cleanup work, if it needs to. They often 
 don't.
 
 Got it!
 
 Thanks,
 
 - Koen.
 
 
 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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


Better way to create a 'grouped' array from a NSArray?

2013-03-26 Thread Diederik Meijer | Ten Horses
Dear list,

I need to create a grouped array from a simple array, it then populates a 
grouped UITableView. Below is my code, which works fine (the project uses ARC).

But I'd like to know if there is a quicker or more efficient way to do this, 
with less code. If so, please let me know.

  NSArray *resultArray = [[result objectForKey:@hits] objectForKey:@hits]; 
//1
  NSMutableSet *dates = [[NSMutableSet alloc] init]; //2
  for (NSDictionary *dict in resultArray) {
[dates addObject:[[dict objectForKey:@_source] 
objectForKey:@datum_gepubliceerd_ymd]]; //3
  }
  self.datesArray = [NSArray arrayWithArray:[[dates allObjects] 
sortedArrayUsingComparator:^(NSString* a, NSString* b) {
return [b compare:a options:NSNumericSearch]; //4
  }]];
  self.sortedJSONContent = [NSMutableArray array]; //5
  for (NSString *date in self.datesArray) {
NSMutableArray *sortedSection = [NSMutableArray array]; //6
for (NSDictionary *dict in resultArray) {
if ([[[dict objectForKey:@_source] 
objectForKey:@datum_gepubliceerd_ymd] isEqual:date])
[sortedSection addObject:dict]; //6
}
[self.sortedJSONContent addObject:sortedSection]; //7
}


These are the steps the above code takes:

1. Create the resultArray from a JSON web service, this is an array of 
dictionaries (result is returned from a NSJSONSerialization action);
2. Create a mutableSet to hold the group titles (these will go in the 
tableView's sectionHeader views);
3. Iterate through the resultArray and add the relevant key's value to the 
mutableSet;
4. Create a datesArray from the set, ordered descending (creating an array of 
unique values);
5. Create a new sortedJSONContent array to hold the grouped array when done;
6. Loop through the dates array (main loop), and with each iteration create a 
sortedSection array loop through the resultArray ('nested loop') and add those 
items for which the date is equal to the main loop's date (I don't need to 
worry about empty arrays here, because they only get created when a date 
exists, which means a record exists and, therefore, that the array will have at 
least one item);
7. Add the sortedSection array to the new sortedJSONContent array.

The output is an array of arrays that fits nicely into the grouped UITableView.

PS I know this is done much more easily using CoreData, I actually have another 
app that does just that. But in this case, all data is pulled in from the 
network at all times and there is no persistent storage on the device. For this 
reason, implementing CoreData feels like overkill to me.

Thanks!

Diederik
___

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: @class

2013-03-22 Thread Diederik Meijer | Ten Horses
 The forward declaration is used to tell the compiler: The word MyClass 
 represents a class. I don't give you the implementation yet, but it 
 represents a class, and the implementation will be provided later.

…and this allows you to create a property for an instance of that class in the 
.h that has the @class forward declaration. This way, you don't need to put 
#import class.h in there. You will need to include that last line in the .m in 
order for the property to work. So, in essence, you are putting your #import 
statement in the implementation and use the @class in the interface in order to 
reference its iVars in the .h

This is all done for performance reasons


 



Op Mar 21, 2013, om 10:20 PM heeft Jean Suisse jean.li...@gmail.com het 
volgende geschreven:

 A few minutes search gave me this. While I haven't taken a deep look to these 
 resources, they do look good.
 
 - What's a forward declaration ? (several languages including Obj-C)
 http://en.wikipedia.org/wiki/Forward_declaration
 
 - When to use a forward declaration (C++):
 http://stackoverflow.com/questions/553682/when-to-use-forward-declaration
 
 - Objective C Programming Tutorial | Using @class And #import Directives
 http://www.youtube.com/watch?v=0b9Qok2uHhU
 
 @class allows you to declare a class.
 Example: @class MyClass;
 
 The forward declaration is used to tell the compiler: The word MyClass 
 represents a class. I don't give you the implementation yet, but it 
 represents a class, and the implementation will be provided later.
 
 Jean
 
 On 21 mars 2013, at 21:43, H Miersch hmier...@me.com wrote:
 
 hi.
 
 what exactly does @class do?
 
 and what does forward declaration mean?
 ___
 
 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/jean.lists%40gmail.com
 
 This email sent to jean.li...@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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: KeyboardType for an iOS searchBar.

2013-03-13 Thread Diederik Meijer | Ten Horses
Maybe I'm missing the point, but you can set the keyboard type in the 
storyboard settings for it.. Or do you need to change it programmatically for 
some particular reason?




Op Mar 13, 2013, om 6:51 PM heeft Alex Zavatone z...@mac.com het volgende 
geschreven:

 Hopefully, this will be a more constructive question for the list.
 
 On iOS in Xcode 4.2, I've put a storyboard scene together with a tableView 
 and a searchBar.
 
 The searchBar searches the tableView just fine, but my problem is how and 
 when the storyboard defaults are applied to the searchBar and the resulting 
 keyboard?  I ask, because it appears that it's only possible to override the 
 storyboard defaults to set the keyboardType within the 
 searchBar:textDidChange: method and this seems really clunky.
 
 I'm using the methods below and I've tried setting the keyboardType on the 
 viewController's viewDidLoad, viewDidAppear, after notification from 
 UIKeyboardDidShowNotification, nothing works to override the setting used in 
 the storyboard except for searchBar:textDidChange:, which is not acceptable.
 
   [searchBar setKeyboardType:UIKeyboardTypeNumbersAndPunctuation];
   [searchBar reloadInputViews];
 
 I'm extending the interface to use the UISearchBarDelegate.  Is there 
 anything obvious here that I might be missing?
 
 TIA,
 - Zav
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: UITableViewController init not called (storyboard)

2013-03-12 Thread Ten Horses | Diederik Meijer
Have you tried moving those datasource codelines to viewDidLoad or 
viewWillAppear? It may be that when the view is instantiated from the 
storyboard init is not called?



Op 12 mrt. 2013, om 17:09 heeft Koen van der Drift koenvanderdr...@gmail.com 
het volgende geschreven:

 I'm playing around with a storyboard app on iOS. To test a TableView I 
 created a UITableViewController subclass, and set it as the custom class in 
 the storyboard. Then in the init method, I added a bunch of objects to act as 
 the datasource, however init never gets called, and my tableview remains 
 empty.
 
 If I modify the datasource methods, by adding a cell title and return a 
 positive number for the numberOfRows, I do see the table being filled, so 
 everything must be hooked up ok.
 
 But why is init never called? I also tried - 
 (id)initWithStyle:(UITableViewStyle)style, but that is not called either.
 
 Any ideas?
 
 - Koen.
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: Turning off screen shot ability

2013-03-06 Thread Diederik Meijer | Ten Horses
I agree with Charles. I only work with iOS and have apps that actually take 
screenshots in runtime triggered by IBActions. I have no experience with 
detecting it, but would be suprised if detecting that a screenshot was taken 
would be impossible to do.
The good thing about Charles' suggestion is it clearly shows users there is 
nothing wrong with their device, it is intended behaviour.
While you are at it, you may consider adding an explanation to that solid color 
png. Part of that image could display text that tells the user why screenshots 
are discouraged.
That would take away some of the objections raised against this feature.

Verstuurd vanaf mijn iPhone

Op 7 Mar 2013 om 02:56 heeft Charles Srstka cocoa...@charlessoft.com het 
volgende geschreven:

 On Mar 5, 2013, at 9:57 PM, Brad O'Hearne br...@bighillsoftware.com wrote:
 
 Hello, 
 
 I am working on a security-related Mac app and I need to know the way to 
 turn off the ability to screen shot or capture the contents of the app's 
 window. It would appear that setting the sharing type on the main window 
 (which covers the entire screen) to none doesn't completely do it. It 
 appears that Shift-Cmd-3 still performs a screen shot. I've already tried 
 capturing keystrokes and it appears these system-level hot-key combinations 
 aren't able to be cleanly intercepted. More than that, I would think this is 
 overkill -- I would think there would be a simple way to turn off the 
 ability for outside sources to grab contents of an app. 
 
 How can I turn this off?
 
 Turning off the user's ability to do a screen capture in general is probably 
 the wrong approach — and even if you managed to sink your tendrils deep 
 enough to do this, there'd probably be plenty of ways to work around it. 
 Instead, I'd try to figure out what Apple's DVD player does; it allows you to 
 take screenshots all day long, but the copyrighted content gets replaced by a 
 solid color.
 
 I'm not sure exactly how it pulls this off, but taking a random stab in the 
 dark, one thing that might be worth looking into would be finding a way to 
 *detect* when a screenshot is taking place, and swapping your content out for 
 a solid color or some other generic thing when you notice you're getting 
 screenshotted. No idea how possible/feasible that is, but it's an idea.
 
 Charles
 
 
 ___
 
 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/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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: [OT] Sync vs ASync Server Comms

2013-02-27 Thread Ten Horses | Diederik Meijer
 

On iOS sync will freeze your user interface for the duration of the network 
call, because it is done on the main thread, async
is done in the background and keeps the interface responsive, you can then 
update your data when done 

Dave schreef op 2013-02-22
11:13: 

 Hi All,
 
 I was reading an article about Server/Client communications using a 
 Rest service and the author seemed to
have a downer on using the Sync 
 (as opposed to ASync) methods of making a request and receiving a 
 reply. Also I've noticed it
being generally discouraged in quite a 
 few other places when I was searching for 3rd Party Network 
 Libraries. However, I can't
find any reason behind it? Does anyone 
 have any idea why ASync transactions are better than Sync 
 transactions? Or is it just
Sync'ism? lol
 
 Have a Good Weekend!
 
 Thanks
 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/diederik%40tenhorses.com [1]
 
 This email sent to diede...@tenhorses.com




Links:
--
[1] https://lists.apple.com/mailman/options/cocoa-dev/diederik%40tenhorses.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