Re: Crash at iOS App Startup - What Could Have Gone Wrong?

2015-04-22 Thread Mike Abdullah

> On 21 Apr 2015, at 21:43, Michael Crawford  wrote:
> 
> It's not stopping in the debugger anymore, but instead of getting my
> navigation controller I'm just getting a black screen.

That sounds like a good time to use Xcode’s view debugger to find out what’s 
actually onscreen. I’m going to hazard a guess you’ve got a blank window with 
no other content.
> 
> I think all these problems arose by starting with an app that did not
> use a nav controller, then - incorrectly - refactoring it so it did
> use one.  It looks like I left some stale configuration in there.
> When I tried to fix that, that's when I started getting the crashes.
> 
> Now I'm backing up, trying to recreate the navigation controller at
> the beginning.
> Michael David Crawford, Consulting Software Engineer
> mdcrawf...@gmail.com
> http://www.warplife.com/mdc/

___

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: Converting to Window Coordinates

2015-04-22 Thread Dave
Hi Again Lee Ann,

Thanks a lot for this, one thing though, how do I tell which window the 
position is in? At present I loop through all my open windows and apply run 
“hitTest” on the content view until I find one.

> Another thing you've missed: converting to myContentView's coordinate space 
> from the window's space, with [myContentView convertPoint:myWindowPoint 
> fromView:nil] - "If aView is nil, this method instead converts from window 
> base coordinates"

Do I have to worry about this? It seems to work, but the window I am testing in 
is a plain (no title bar etc) window, so the content view and the window Frame 
coincide, do I need to add this for safety in case the window does have a title 
bar?

Here is the code I am using, it seems for work ok:

myContentView = self.window.contentView;

myGlobalPoint.x = theGlobalPoint.x;
myGlobalPoint.y = NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - 
theGlobalPoint.y;  //Flip

myWorkRect.origin = myGlobalPoint;
myWorkRect.size = NSMakeSize(1,1);
myWorkRect = [self.window convertRectFromScreen:myWorkRect];
myWindowPoint = myWorkRect.origin;

myCocoaControlView = (LTWViewBase*) [myContentView hitTest:myWindowPoint];
if (myCocoaControlView != nil)
{
if ([myCocoaControlView class] == [myContentView class])
myCocoaControlView = nil;

else if ([[myCocoaControlView class] isSubclassOfClass:[LTWViewBase 
class]] == NO)
myCocoaControlView = nil;
}

All the Best
Dave

___

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

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

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

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

RE: Converting to Window Coordinates

2015-04-22 Thread Lee Ann Rucker
There's also +[NSEvent mouseLocation], which gives you the position in the same 
screen coordinate space the windows use.

> Do I have to worry about this? It seems to work, but the window I am testing 
> in is a plain (no title bar etc) window, so the content view and the window 
> Frame coincide, do I need to add this for safety in case the window does have 
> a title bar?

It's always best to future-proof your code, just in case some day you decide to 
reuse it on a window with a title or if for some odd reason your view's base 
coordinates aren't what you expect.

From: cocoa-dev-bounces+lrucker=vmware@lists.apple.com 
[cocoa-dev-bounces+lrucker=vmware@lists.apple.com] on behalf of Dave 
[d...@looktowindward.com]
Sent: Wednesday, April 22, 2015 3:55 AM
To: Cocoa Developers
Subject: Re: Converting to Window Coordinates

Hi Again Lee Ann,

Thanks a lot for this, one thing though, how do I tell which window the 
position is in? At present I loop through all my open windows and apply run 
“hitTest” on the content view until I find one.

> Another thing you've missed: converting to myContentView's coordinate space 
> from the window's space, with [myContentView convertPoint:myWindowPoint 
> fromView:nil] - "If aView is nil, this method instead converts from window 
> base coordinates"

Do I have to worry about this? It seems to work, but the window I am testing in 
is a plain (no title bar etc) window, so the content view and the window Frame 
coincide, do I need to add this for safety in case the window does have a title 
bar?

Here is the code I am using, it seems for work ok:

myContentView = self.window.contentView;

myGlobalPoint.x = theGlobalPoint.x;
myGlobalPoint.y = NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - 
theGlobalPoint.y;  //Flip

myWorkRect.origin = myGlobalPoint;
myWorkRect.size = NSMakeSize(1,1);
myWorkRect = [self.window convertRectFromScreen:myWorkRect];
myWindowPoint = myWorkRect.origin;

myCocoaControlView = (LTWViewBase*) [myContentView hitTest:myWindowPoint];
if (myCocoaControlView != nil)
{
if ([myCocoaControlView class] == [myContentView class])
myCocoaControlView = nil;

else if ([[myCocoaControlView class] isSubclassOfClass:[LTWViewBase 
class]] == NO)
myCocoaControlView = nil;
}

All the Best
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/lrucker%40vmware.com

This email sent to lruc...@vmware.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: Converting to Window Coordinates

2015-04-22 Thread Dave
Yes, good idea, I’ll change it.

Is hit testing the content view the only way to tell which window a point falls 
within? At the moment I loop though all windows until I find one which works, 
but is a bit inefficient. 

I’d like a windowForScreenPoint: type method.

Thanks again for all your help. I’d love to know how many developer hours have 
been spent in the history of Cocoa figuring out how and where to flip the Y 
coordinate. I don’t know about anyone else but I find it really hard work 
trying to think bottom up when designing NIBS etc.  I really can’t understand 
why it was ever defined to be bottom left, does anyone know why?

All the Best
Dave 


> On 22 Apr 2015, at 15:13, Lee Ann Rucker  wrote:
> 
> There's also +[NSEvent mouseLocation], which gives you the position in the 
> same screen coordinate space the windows use.
> 
>> Do I have to worry about this? It seems to work, but the window I am testing 
>> in is a plain (no title bar etc) window, so the content view and the window 
>> Frame coincide, do I need to add this for safety in case the window does 
>> have a title bar?
> 
> It's always best to future-proof your code, just in case some day you decide 
> to reuse it on a window with a title or if for some odd reason your view's 
> base coordinates aren't what you expect.
> 
> From: cocoa-dev-bounces+lrucker=vmware@lists.apple.com 
> [cocoa-dev-bounces+lrucker=vmware@lists.apple.com] on behalf of Dave 
> [d...@looktowindward.com]
> Sent: Wednesday, April 22, 2015 3:55 AM
> To: Cocoa Developers
> Subject: Re: Converting to Window Coordinates
> 
> Hi Again Lee Ann,
> 
> Thanks a lot for this, one thing though, how do I tell which window the 
> position is in? At present I loop through all my open windows and apply run 
> “hitTest” on the content view until I find one.
> 
>> Another thing you've missed: converting to myContentView's coordinate space 
>> from the window's space, with [myContentView convertPoint:myWindowPoint 
>> fromView:nil] - "If aView is nil, this method instead converts from window 
>> base coordinates"
> 
> Do I have to worry about this? It seems to work, but the window I am testing 
> in is a plain (no title bar etc) window, so the content view and the window 
> Frame coincide, do I need to add this for safety in case the window does have 
> a title bar?
> 
> Here is the code I am using, it seems for work ok:
> 
> myContentView = self.window.contentView;
> 
> myGlobalPoint.x = theGlobalPoint.x;
> myGlobalPoint.y = NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - 
> theGlobalPoint.y;  //Flip
> 
> myWorkRect.origin = myGlobalPoint;
> myWorkRect.size = NSMakeSize(1,1);
> myWorkRect = [self.window convertRectFromScreen:myWorkRect];
> myWindowPoint = myWorkRect.origin;
> 
> myCocoaControlView = (LTWViewBase*) [myContentView hitTest:myWindowPoint];
> if (myCocoaControlView != nil)
>{
>if ([myCocoaControlView class] == [myContentView class])
>myCocoaControlView = nil;
> 
>else if ([[myCocoaControlView class] isSubclassOfClass:[LTWViewBase 
> class]] == NO)
>myCocoaControlView = nil;
>}
> 
> All the Best
> 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/lrucker%40vmware.com
> 
> This email sent to lruc...@vmware.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: Submitting App Localization Issue...

2015-04-22 Thread Fritz Anderson
It would be helpful to know what the unhelpful message was, and at what stage 
of the process it came to you. 

Also, what exactly are you doing for localization?

— F


> On Apr 21, 2015, at 5:32 PM, Peters, Brandon  wrote:
> 
> I am getting an error in iTunes Connect for my App pertaining to the English 
> localization. English is the only language my app currently supports. The 
> error is not really helpful. Has anyone seen something similar?

___

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: Converting to Window Coordinates

2015-04-22 Thread Scott Ribe
On Apr 22, 2015, at 10:10 AM, Dave  wrote:
> 
> I really can’t understand why it was ever defined to be bottom left, does 
> anyone know why?

Normal Cartesian coordinates. (I agree the other way made sense, measuring from 
the menu bar…)

-- 
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.com/
https://www.linkedin.com/in/scottribe/
(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/archive%40mail-archive.com

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

Re: UIAlertView has zero bounds

2015-04-22 Thread Jamie Montgomerie

> On Apr 20, 2015, at 6:37 PM, M Pulis  wrote:
> 
> Sure...
> 
> BYOV - build your own view:
> 
> Create a custom UIViewController, pop in a UITextField and a couple of 
> buttons.
> Works on all versions, done in under an hour max….

There’s no need to do that!  You already brought up the use of 
UIAlertViewStyleSecureTextInput.  If you look at the documentation (or even 
just the header), you’ll see a UIAlertViewStylePlainTextInput too.

-setAlertViewStyle: and -textFieldAtIndex: are public, supported APIs: 
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIAlertView_Class/index.html

I would encourage using UIAlertController though if you can - it’s where the 
future lies, and its text field API is a little nicer.

Jamie.

> Good Luck!
> 
> Gary
> ...working in a code mind...
> 
> On Apr 20, 2015, at 4:18 PM, Michael Crawford wrote:
> 
>> Is there a way to prompt for a text string?
>> Michael David Crawford, Consulting Software Engineer
>> mdcrawf...@gmail.com
>> http://www.warplife.com/mdc/
>> 
>>  Available for Software Development in the Portland, Oregon Metropolitan
>> Area.
>> 
>> 
>> On Mon, Apr 20, 2015 at 4:12 PM, Kyle Sluder  wrote:
>>> On Mon, Apr 20, 2015, at 05:59 PM, Michael Crawford wrote:
 The method for iOS 5 and later on this page looks good:
>>> 
>>> Please stop reaching in to the UIAlertView hierarchy. As has been
>>> documented forever, this is not supported.
>>> 
>>> --Kyle Sluder


___

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: Converting to Window Coordinates

2015-04-22 Thread Jens Alfke

> On Apr 22, 2015, at 9:46 AM, Scott Ribe  wrote:
> 
> On Apr 22, 2015, at 10:10 AM, Dave  wrote:
>> 
>> I really can’t understand why it was ever defined to be bottom left, does 
>> anyone know why?
> 
> Normal Cartesian coordinates. (I agree the other way made sense, measuring 
> from the menu bar…)

This dates back to PostScript, which has always put (0,0) at the bottom left of 
the page. (Remember that NeXT started out using Display PostScript as its 
rendering engine.)

—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

UIAlertView won't set password field as first responder

2015-04-22 Thread Rick Mann
In my UIAlertView -didPresentAlertView: delegate call, I'm trying to change 
focus to the password field with

UITextField* tf = [inView textFieldAtIndex: 1];
[tf becomeFirstResponder];

But it's being ignored. I've verified that it is the correct field. I'm doing 
it in -didPresentAlertView:, as suggested by others online (who've indicated 
success). But it doesn't work for me in the Simulator or on a device. iOS 8.2 
and 8.3.

Any ideas? Thanks.

-- 
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/archive%40mail-archive.com

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

Re: UIAlertView won't set password field as first responder

2015-04-22 Thread Kyle Sluder
On Wed, Apr 22, 2015, at 01:53 PM, Rick Mann wrote:
> In my UIAlertView -didPresentAlertView: delegate call, I'm trying to
> change focus to the password field with
> 
> UITextField* tf = [inView textFieldAtIndex: 1];
> [tf becomeFirstResponder];
> 
> But it's being ignored.

How many times do we need to say it?

Stop. Touching. The. Alert. View. Hierarchy.

In fact, did you see Jamie's advice to use UIAlertController instead?

--Kyle Sluder
___

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: UIAlertView has zero bounds

2015-04-22 Thread M Pulis
Yep good stuff. I  forgot about those been on iOS8 too long -  
have converted all my code to UIAlertController(s).


But the OP won't use UIAlertController to be backwards compatible and  
(I guess) had not seen those calls.



Gary



On Apr 22, 2015, at 10:03 AM, Jamie Montgomerie wrote:




On Apr 20, 2015, at 6:37 PM, M Pulis  wrote:

Sure...

BYOV - build your own view:

Create a custom UIViewController, pop in a UITextField and a couple  
of buttons.

Works on all versions, done in under an hour max….


There’s no need to do that!  You already brought up the use of  
UIAlertViewStyleSecureTextInput.  If you look at the documentation  
(or even just the header), you’ll see a  
UIAlertViewStylePlainTextInput too.


-setAlertViewStyle: and -textFieldAtIndex: are public, supported  
APIs: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIAlertView_Class/index.html


I would encourage using UIAlertController though if you can - it’s  
where the future lies, and its text field API is a little nicer.


Jamie.


Good Luck!

Gary
...working in a code mind...

On Apr 20, 2015, at 4:18 PM, Michael Crawford wrote:


Is there a way to prompt for a text string?
Michael David Crawford, Consulting Software Engineer
mdcrawf...@gmail.com
http://www.warplife.com/mdc/

Available for Software Development in the Portland, Oregon  
Metropolitan

Area.


On Mon, Apr 20, 2015 at 4:12 PM, Kyle Sluder   
wrote:

On Mon, Apr 20, 2015, at 05:59 PM, Michael Crawford wrote:

The method for iOS 5 and later on this page looks good:


Please stop reaching in to the UIAlertView hierarchy. As has been
documented forever, this is not supported.

--Kyle Sluder






___

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: Converting to Window Coordinates

2015-04-22 Thread Lee Ann Rucker
> Is hit testing the content view the only way to tell which window a point 
> falls within? At the moment I loop though all windows until I find one which 
> works, but is a bit inefficient.

Since everything's in the same coordinate space now, use NSPointInRect on the 
window frame.

From: cocoa-dev-bounces+lrucker=vmware@lists.apple.com 
[cocoa-dev-bounces+lrucker=vmware@lists.apple.com] on behalf of Dave 
[d...@looktowindward.com]
Sent: Wednesday, April 22, 2015 9:10 AM
To: Cocoa Developers
Subject: Re: Converting to Window Coordinates

Yes, good idea, I’ll change it.

Is hit testing the content view the only way to tell which window a point falls 
within? At the moment I loop though all windows until I find one which works, 
but is a bit inefficient.

I’d like a windowForScreenPoint: type method.

Thanks again for all your help. I’d love to know how many developer hours have 
been spent in the history of Cocoa figuring out how and where to flip the Y 
coordinate. I don’t know about anyone else but I find it really hard work 
trying to think bottom up when designing NIBS etc.  I really can’t understand 
why it was ever defined to be bottom left, does anyone know why?

All the Best
Dave


> On 22 Apr 2015, at 15:13, Lee Ann Rucker  wrote:
>
> There's also +[NSEvent mouseLocation], which gives you the position in the 
> same screen coordinate space the windows use.
>
>> Do I have to worry about this? It seems to work, but the window I am testing 
>> in is a plain (no title bar etc) window, so the content view and the window 
>> Frame coincide, do I need to add this for safety in case the window does 
>> have a title bar?
>
> It's always best to future-proof your code, just in case some day you decide 
> to reuse it on a window with a title or if for some odd reason your view's 
> base coordinates aren't what you expect.
> 
> From: cocoa-dev-bounces+lrucker=vmware@lists.apple.com 
> [cocoa-dev-bounces+lrucker=vmware@lists.apple.com] on behalf of Dave 
> [d...@looktowindward.com]
> Sent: Wednesday, April 22, 2015 3:55 AM
> To: Cocoa Developers
> Subject: Re: Converting to Window Coordinates
>
> Hi Again Lee Ann,
>
> Thanks a lot for this, one thing though, how do I tell which window the 
> position is in? At present I loop through all my open windows and apply run 
> “hitTest” on the content view until I find one.
>
>> Another thing you've missed: converting to myContentView's coordinate space 
>> from the window's space, with [myContentView convertPoint:myWindowPoint 
>> fromView:nil] - "If aView is nil, this method instead converts from window 
>> base coordinates"
>
> Do I have to worry about this? It seems to work, but the window I am testing 
> in is a plain (no title bar etc) window, so the content view and the window 
> Frame coincide, do I need to add this for safety in case the window does have 
> a title bar?
>
> Here is the code I am using, it seems for work ok:
>
> myContentView = self.window.contentView;
>
> myGlobalPoint.x = theGlobalPoint.x;
> myGlobalPoint.y = NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - 
> theGlobalPoint.y;  //Flip
>
> myWorkRect.origin = myGlobalPoint;
> myWorkRect.size = NSMakeSize(1,1);
> myWorkRect = [self.window convertRectFromScreen:myWorkRect];
> myWindowPoint = myWorkRect.origin;
>
> myCocoaControlView = (LTWViewBase*) [myContentView hitTest:myWindowPoint];
> if (myCocoaControlView != nil)
>{
>if ([myCocoaControlView class] == [myContentView class])
>myCocoaControlView = nil;
>
>else if ([[myCocoaControlView class] isSubclassOfClass:[LTWViewBase 
> class]] == NO)
>myCocoaControlView = nil;
>}
>
> All the Best
> 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/lrucker%40vmware.com
>
> This email sent to lruc...@vmware.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/lrucker%40vmware.com

This email sent to lruc...@vmware.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: UIAlertView won't set password field as first responder

2015-04-22 Thread Rick Mann
Stop. Making. Me. Abandon. Older. Users.

> On Apr 22, 2015, at 12:18 , Kyle Sluder  wrote:
> 
> On Wed, Apr 22, 2015, at 01:53 PM, Rick Mann wrote:
>> In my UIAlertView -didPresentAlertView: delegate call, I'm trying to
>> change focus to the password field with
>> 
>>UITextField* tf = [inView textFieldAtIndex: 1];
>>[tf becomeFirstResponder];
>> 
>> But it's being ignored.
> 
> How many times do we need to say it?
> 
> Stop. Touching. The. Alert. View. Hierarchy.
> 
> In fact, did you see Jamie's advice to use UIAlertController instead?
> 
> --Kyle Sluder
> ___
> 
> 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/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


-- 
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/archive%40mail-archive.com

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

Re: UIAlertView won't set password field as first responder

2015-04-22 Thread Kyle Sluder
On Wed, Apr 22, 2015, at 03:16 PM, Rick Mann wrote:
> Stop. Making. Me. Abandon. Older. Users.

Nobody is making you abandon older users.

Use UIAlertView when running on older platforms.

Use UIAlertController when running on newer platforms, or continue to
use the UIAlertView compatibility support.

But stop messing with the internals of UIAlertView!

--Kyle Sluder
___

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: UIAlertView won't set password field as first responder

2015-04-22 Thread Rick Mann
I don't think this qualifies as "messing with the internals." Apple provides 
those methods. I'm not adding or removing views, or even moving them. All I 
want to do is change focus. There are several posts on this approach that 
report success. I'm not seeing it.

Provide me with a solution, or tell me it's impossible for some reason that 
explains why others have reported success.

> On Apr 22, 2015, at 13:19 , Kyle Sluder  wrote:
> 
> On Wed, Apr 22, 2015, at 03:16 PM, Rick Mann wrote:
>> Stop. Making. Me. Abandon. Older. Users.
> 
> Nobody is making you abandon older users.
> 
> Use UIAlertView when running on older platforms.
> 
> Use UIAlertController when running on newer platforms, or continue to
> use the UIAlertView compatibility support.
> 
> But stop messing with the internals of UIAlertView!
> 
> --Kyle Sluder


-- 
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/archive%40mail-archive.com

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

Re: UIAlertView won't set password field as first responder

2015-04-22 Thread Shazron
- (void)didPresentAlertView:(UIAlertView*)alertView
{
if (alertView.alertViewStyle == UIAlertViewStylePlainTextInput){
[[alertView textFieldAtIndex:0] selectAll:nil];
}
}

On Wed, Apr 22, 2015 at 1:21 PM, Rick Mann  wrote:
> I don't think this qualifies as "messing with the internals." Apple provides 
> those methods. I'm not adding or removing views, or even moving them. All I 
> want to do is change focus. There are several posts on this approach that 
> report success. I'm not seeing it.
>
> Provide me with a solution, or tell me it's impossible for some reason that 
> explains why others have reported success.
>
>> On Apr 22, 2015, at 13:19 , Kyle Sluder  wrote:
>>
>> On Wed, Apr 22, 2015, at 03:16 PM, Rick Mann wrote:
>>> Stop. Making. Me. Abandon. Older. Users.
>>
>> Nobody is making you abandon older users.
>>
>> Use UIAlertView when running on older platforms.
>>
>> Use UIAlertController when running on newer platforms, or continue to
>> use the UIAlertView compatibility support.
>>
>> But stop messing with the internals of UIAlertView!
>>
>> --Kyle Sluder
>
>
> --
> 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/shazron%40gmail.com
>
> This email sent to shaz...@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/archive%40mail-archive.com

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

Re: UIAlertView won't set password field as first responder

2015-04-22 Thread Kyle Sluder
On Wed, Apr 22, 2015, at 03:21 PM, Rick Mann wrote:
> I don't think this qualifies as "messing with the internals."

Accessing the subviews of a view you do not own is by definition
"messing with the internals".


> Apple
> provides those methods.

Just because a method exists doesn't mean that it is OK for arbitrary
clients to access it.

It's an unfortunate reality of our current crop of OOP languages that
composability leads to unsafely exposing details such as this. There's
no clean way to say "certain callsites are allowed to do mutation-like
things through to this collection and its contents, but other callsites
can only read certain properties of things contained inside, and still
others shouldn't even access this collection".

> 
> Provide me with a solution, or tell me it's impossible for some reason
> that explains why others have reported success.

Your solution is to use UIAlertController on platforms where it exists.
It already has the correct first responder you desire.

--Kyle Sluder
___

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: Converting to Window Coordinates

2015-04-22 Thread Dave

> On 22 Apr 2015, at 20:52, Lee Ann Rucker  wrote:
> 
>> Is hit testing the content view the only way to tell which window a point 
>> falls within? At the moment I loop though all windows until I find one which 
>> works, but is a bit inefficient.
> 
> Since everything's in the same coordinate space now, use NSPointInRect on the 
> window frame.

Ok, but I still have to loop through my windows, there is no method I can call 
that will return the window for the point directly? e.g.

myWindow = [ getWindowForScreenPoint:thePoint);

it’s no big deal and I have it working already, it’s just if there is a system 
method then I may as well use it.

All the Best
Dave




___

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

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

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

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

Re: Converting to Window Coordinates

2015-04-22 Thread Dave

> On 22 Apr 2015, at 20:52, Lee Ann Rucker  wrote:
> 
>> Is hit testing the content view the only way to tell which window a point 
>> falls within? At the moment I loop though all windows until I find one which 
>> works, but is a bit inefficient.
> 
> Since everything's in the same coordinate space now, use NSPointInRect on the 
> window frame.

Ok, but I still have to loop through my windows, there is no method I can call 
that will return the window for the point directly? e.g.

myWindow = [ getWindowForScreenPoint:thePoint);

it’s no big deal and I have it working already, it’s just if there is a system 
method then I may as well use it.

All the Best
Dave




___

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

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

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

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

RE: Converting to Window Coordinates

2015-04-22 Thread Lee Ann Rucker
Possibly +[NSWindow windowNumberAtPoint:belowWindowWithWindowNumber:], but then 
you'd still need to loop through your windows to find the one with the matching 
windowNumber.

From: cocoa-dev-bounces+lrucker=vmware@lists.apple.com 
[cocoa-dev-bounces+lrucker=vmware@lists.apple.com] on behalf of Dave 
[d...@looktowindward.com]
Sent: Wednesday, April 22, 2015 1:56 PM
To: Cocoa Developers
Subject: Re: Converting to Window Coordinates

> On 22 Apr 2015, at 20:52, Lee Ann Rucker  wrote:
>
>> Is hit testing the content view the only way to tell which window a point 
>> falls within? At the moment I loop though all windows until I find one which 
>> works, but is a bit inefficient.
>
> Since everything's in the same coordinate space now, use NSPointInRect on the 
> window frame.

Ok, but I still have to loop through my windows, there is no method I can call 
that will return the window for the point directly? e.g.

myWindow = [ getWindowForScreenPoint:thePoint);

it’s no big deal and I have it working already, it’s just if there is a system 
method then I may as well use it.

All the Best
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/lrucker%40vmware.com

This email sent to lruc...@vmware.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: UIAlertView won't set password field as first responder

2015-04-22 Thread Jens Alfke

> On Apr 22, 2015, at 1:34 PM, Kyle Sluder  wrote:
> 
> Accessing the subviews of a view you do not own is by definition
> "messing with the internals".
> ...
> Just because a method exists doesn't mean that it is OK for arbitrary
> clients to access it.

Kyle, you may have forgotten that -textFieldAtIndex: is a method specifically 
declared in UIAlertView. It’s not some general-purpose method inherited from 
UIView. The documentation (see below) even helpfully tells you which field is 
the password field.

Removing the text field or changing its frame might constitute “messing with”, 
but giving it focus seems like a perfectly reasonable thing to do.

Back to the question at hand — some of the other discussion makes me suspect 
that -didPresentAlertView: is getting called earlier than it used to, maybe 
before the alert is actually fully presented. So try adding a delayed-perform 
so the text field’s focus will get set slightly later.

—Jens

/* Retrieve a text field at an index - raises NSRangeException when 
textFieldIndex is out-of-bounds. 
   The field at index 0 will be the first text field (the single field or the 
login field), the field at index 1 will be the password field. */
- (UITextField *)textFieldAtIndex:(NSInteger)textFieldIndex 
NS_AVAILABLE_IOS(5_0);

___

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

UIImage to jpeg results change between 32-bit & 64-bit

2015-04-22 Thread David Brittain
In our app we create a UIImage and set its scale. It is then saved to
a jpeg using  UIImageJPEGRepresentation(image, 0.8);

I am converting the app to 64-bit and the generated image has junk in
the ppi block of the resulting jpeg. Below are examples of the data
(output using ImageMagick identify) from an iPad Air 2 (I see similar
behavior in the Simulator comparing the results from iPad Retina &
iPad Air)

32-bit build:

  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Mime type: image/jpeg
  Class: DirectClass
  Geometry: 2048x1536+0+0
  Resolution: 376.736x376.736
  Print size: 5.43617x4.07713
  Units: PixelsPerInch

64-bit build:

  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Mime type: image/jpeg
  Class: DirectClass
  Geometry: 2048x1536+0+0
  Resolution: -1x-1
  Print size: -2048x-1536
  Units: PixelsPerInch

Any suggestions appreciated for workarounds/solutions.

Thanks

Dave

-- 
David Brittain
___

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: UIAlertView won't set password field as first responder

2015-04-22 Thread Kyle Sluder
On Wed, Apr 22, 2015, at 06:03 PM, Jens Alfke wrote:
> 
> Kyle, you may have forgotten that -textFieldAtIndex: is a method
> specifically declared in UIAlertView. It’s not some general-purpose
> method inherited from UIView. The documentation (see below) even
> helpfully tells you which field is the password field.

"Forgotten" is being generous. I was just plain wrong.
-textFieldAtIndex: is not (the nonexistent) -subviewAtIndex:

My apologies to you, Rick.

> 
> Removing the text field or changing its frame might constitute “messing
> with”, but giving it focus seems like a perfectly reasonable thing to do.

This is complicated; first responder is a window-global state, so it
gets difficult to reason about interactions and dependencies.

It's not unreasonable to want the text fields of an alert to gain first
responder status when the alert appears, and UIAlertController should be
making that happen. Ideally, UIAlertView would as well, but it obviously
is exhibiting a bug. That said, UIAlertController is the way forward,
and adopting it should fix the bug _today_ and prep Rick's app for
_tomorrow_.

> 
> Back to the question at hand — some of the other discussion makes me
> suspect that -didPresentAlertView: is getting called earlier than it used
> to, maybe before the alert is actually fully presented. So try adding a
> delayed-perform so the text field’s focus will get set slightly later.

This diagnosis seems likely, but I don't like the prescription, Doctor.
;-)

--Kyle Sluder

___

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: UIAlertView won't set password field as first responder

2015-04-22 Thread Rick Mann

> On Apr 22, 2015, at 16:59 , Kyle Sluder  wrote:
> 
> On Wed, Apr 22, 2015, at 06:03 PM, Jens Alfke wrote:
>> 
>> Kyle, you may have forgotten that -textFieldAtIndex: is a method
>> specifically declared in UIAlertView. It’s not some general-purpose
>> method inherited from UIView. The documentation (see below) even
>> helpfully tells you which field is the password field.
> 
> "Forgotten" is being generous. I was just plain wrong.
> -textFieldAtIndex: is not (the nonexistent) -subviewAtIndex:
> 
> My apologies to you, Rick.

Thanks. Apologies for getting short.

The real problem is an increasing number of bugs in released Apple code.

-- 
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/archive%40mail-archive.com

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

Re: UIImage to jpeg results change between 32-bit & 64-bit

2015-04-22 Thread Michael Crawford
Would it work for you to convert the image using libjpeg?  It is open source.
-- 
Michael David Crawford, Consulting Software Engineer
mdcrawf...@gmail.com
http://www.warplife.com/mdc/

   Available for Software Development in the Portland, Oregon Metropolitan
Area.
___

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: UIImage to jpeg results change between 32-bit & 64-bit

2015-04-22 Thread David Brittain
Thanks for the suggestion. In the meantime I had implemented my own
version of UIImageJPEGRepresentation using ImageIO... painful, but it
works.

(by the way this is happening on iOS 8.2, I don't have a 64-bit device
with 8.3 at the moment)

Dave

On Wed, Apr 22, 2015 at 9:42 PM, Michael Crawford  wrote:
> Would it work for you to convert the image using libjpeg?  It is open source.
> --
> Michael David Crawford, Consulting Software Engineer
> mdcrawf...@gmail.com
> http://www.warplife.com/mdc/
>
>Available for Software Development in the Portland, Oregon Metropolitan
> Area.
> ___
>
> 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/websites%40paperetto.com
>
> This email sent to websi...@paperetto.com



-- 
David Brittain
da...@paperetto.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

The Case of the Dancing Keyboard

2015-04-22 Thread Gerriet M. Denkmann

An UITableViewController with an UISearchController in iOS 8.3

When I click in the SearchBar the following dance happens:
Keyboard comes; 
Keyboard goes away; 
Background becomes gray; 
Keyboard comes again and now stays. 

This is sort of difficult to see in the Simulator because it happens too fast.
But clearly seen (and rather annoying) on iPhone 4s.

Any ideas how this silly dance can be avoided?

Gerriet.


___

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

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

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

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

Linking to MLMediaSourcePhotosIdentifier

2015-04-22 Thread Graham Cox
I’m a bit confused/concerned about a problem I’m having using MLMediaLibrary.

On 10.10, my code works fine, and imports the media from Photos or iPhotos OK.

On 10.9, the same code crashes. At the moment it’s a bit unclear exactly where 
it’s crashing - The app I built on 10.10 using XCode 6.3 crashes on 10.9.1, but 
moving the project over to my 10.9 machine to find out why it was crashing 
required a massively tedious set of updates to get a working development 
system. In the end I have 10.9.5 with Xcode 6.1, but when I build using that 
the same code no longer crashes. That means that I’m having a hard time 
reproducing the problem I was seeing because I can’t build and debug on the 
system that exhibits the problem.

What it appears to be is that the earlier 10.9 version of 
MediaLibrary.framework did not export the string constant 
MLMediaSourcePhotosIdentifier, even though it’s declared in the header. The 
string is declared extern, and on a build using the 10.10 SDK, links fine. When 
it finds itself running on 10.9.1, this linkage fails. I’m not sure what 
happens when a string constant can’t be linked, presumably the address is 
random or nil. This crashes my code which adds this string to the options 
dictionary passed to  -[MLMediaLibrary initWithOptions:]

For my code, the MediaLibrary.framework is optional, and I detect whether it’s 
available by testing whether NSClassFromString(@“MLMediaLibrary”) return Nil or 
a valid Class. But that doesn’t help with the extern identifier string - the 
framework exists but the string doesn’t in some versions. What is a clean way 
to detect whether an externally linked string exists, and if it does not, to 
supply it myself? Or maybe I don’t need to bother, since any version of the OS 
that doesn’t export the string is not going to be able to run Photos anyway, so 
that combo will never arise in practice.

Of course this might not be the reason for the crash, but it’s the best theory 
I have at the moment.

—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/archive%40mail-archive.com

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

Re: Linking to MLMediaSourcePhotosIdentifier

2015-04-22 Thread Roland King

> 
> What is a clean way to detect whether an externally linked string exists, and 
> if it does not, to supply it myself? 
> 

Check if the address of the string constant is NULL. If it is, it wasn’t found. 
That’s the same as checking for weak linked methods. 
___

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: Linking to MLMediaSourcePhotosIdentifier

2015-04-22 Thread Graham Cox
More info:

I have managed to reproduce the crash on my 10.9 machine, and can confirm that 
the crash is caused by attempting to access the symbol 
MLMediaSourcePhotosIdentifier. (It wasn’t crashing because I’d locally defined 
a string with this name to see if that fixed the probem - it did, but I’d 
forgotten about it. Unfortunately just locally defining it won’t be correct for 
a 10.10 system, though I wonder if that would work provided I used the exact 
same string as Apple? Seems hackish…)

Any reference to it causes EXC_BAD_ACCESS, even testing to see whether it’s nil 
or not. I need a smart way to determine whether an externally linked string 
really exists in a framework or not which won’t crash if the symbol doesn’t 
exist.

—Graham




> On 23 Apr 2015, at 3:15 pm, Graham Cox  wrote:
> 
> I’m a bit confused/concerned about a problem I’m having using MLMediaLibrary.
> 
> On 10.10, my code works fine, and imports the media from Photos or iPhotos OK.
> 
> On 10.9, the same code crashes. At the moment it’s a bit unclear exactly 
> where it’s crashing - The app I built on 10.10 using XCode 6.3 crashes on 
> 10.9.1, but moving the project over to my 10.9 machine to find out why it was 
> crashing required a massively tedious set of updates to get a working 
> development system. In the end I have 10.9.5 with Xcode 6.1, but when I build 
> using that the same code no longer crashes. That means that I’m having a hard 
> time reproducing the problem I was seeing because I can’t build and debug on 
> the system that exhibits the problem.
> 
> What it appears to be is that the earlier 10.9 version of 
> MediaLibrary.framework did not export the string constant 
> MLMediaSourcePhotosIdentifier, even though it’s declared in the header. The 
> string is declared extern, and on a build using the 10.10 SDK, links fine. 
> When it finds itself running on 10.9.1, this linkage fails. I’m not sure what 
> happens when a string constant can’t be linked, presumably the address is 
> random or nil. This crashes my code which adds this string to the options 
> dictionary passed to  -[MLMediaLibrary initWithOptions:]
> 
> For my code, the MediaLibrary.framework is optional, and I detect whether 
> it’s available by testing whether NSClassFromString(@“MLMediaLibrary”) return 
> Nil or a valid Class. But that doesn’t help with the extern identifier string 
> - the framework exists but the string doesn’t in some versions. What is a 
> clean way to detect whether an externally linked string exists, and if it 
> does not, to supply it myself? Or maybe I don’t need to bother, since any 
> version of the OS that doesn’t export the string is not going to be able to 
> run Photos anyway, so that combo will never arise in practice.
> 
> Of course this might not be the reason for the crash, but it’s the best 
> theory I have at the moment.


___

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: Linking to MLMediaSourcePhotosIdentifier

2015-04-22 Thread Graham Cox

> On 23 Apr 2015, at 3:30 pm, Roland King  wrote:
> 
> Check if the address of the string constant is NULL. If it is, it wasn’t 
> found. That’s the same as checking for weak linked methods.


But that test itself crashes…


i.e. if I do this:

if( MLMediaSourcePhotosIdentifier == nil )
{


...
}

I get EXC_BAD_ACCESS.

—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/archive%40mail-archive.com

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

Re: Linking to MLMediaSourcePhotosIdentifier

2015-04-22 Thread Roland King

> On 23 Apr 2015, at 13:38, Graham Cox  wrote:
> 
> 
>> On 23 Apr 2015, at 3:30 pm, Roland King  wrote:
>> 
>> Check if the address of the string constant is NULL. If it is, it wasn’t 
>> found. That’s the same as checking for weak linked methods.
> 
> 
> But that test itself crashes…
> 
> 
> i.e. if I do this:
> 
> if( MLMediaSourcePhotosIdentifier == nil )
> {
> 
> 
>   ...
> }
> 
> I get EXC_BAD_ACCESS.
> 
> —Graham
> 
> 

That’s because you didn’t read properly. Check if THE ADDRESS OF THE STRING 
CONSTANT is NULL. 

The address of the string constant is &MLMediaSourcePhotosIdentifier
___

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: Linking to MLMediaSourcePhotosIdentifier

2015-04-22 Thread Graham Cox

> On 23 Apr 2015, at 3:40 pm, Roland King  wrote:
> 
> That’s because you didn’t read properly. Check if THE ADDRESS OF THE STRING 
> CONSTANT is NULL. 
> 
> The address of the string constant is &MLMediaSourcePhotosIdentifier


I read fine.

I may be confused, but my understanding is that extern NSString* const  
IS an address.

Also, adding the explicit & confuses the compiler - it then marks that code as 
dead, stating it will never be executed. I’m not sure how it comes to that 
conclusion exactly, but it tends to suggest that taking the address of an 
extern string constant is not a sensible operation.

—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/archive%40mail-archive.com

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

Re: UIImage to jpeg results change between 32-bit & 64-bit

2015-04-22 Thread Michael Crawford
If you think it's a bug on Apple's part, please file at
http://bugreport.apple.com/

Does your problem also occur in the simulator, or only on a device?

It could be a symptom of some other bug, possibly a bug of your own
which occurs earlier but causes trouble later.


-- 
Michael David Crawford, Consulting Software Engineer
mdcrawf...@gmail.com
http://www.warplife.com/mdc/

   Available for Software Development in the Portland, Oregon Metropolitan
Area.
___

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: Crash at iOS App Startup - What Could Have Gone Wrong?

2015-04-22 Thread Michael Crawford
I have it mostly working now.  Thanks for your help.

tl;dr: my .xib's were really messed up, it probably should never have
worked but the problems became more apparent when I refactored a
single large, rather messy source file.

In the beginning I did not use a Navigation Controller; I "added" that
later however I left in a .xib that I should have deleted.  In
addition I implemented the Nav. Con. only for iPhone, it was when I
went to add support for iPad that everything went south.

It was helpful and informative to validate my IBOutlets with
assertions.  Now my code has lots of assertions, I can leave them
there maybe they'll find trouble later.

I found what I believe to be an XCode 6.2 bug, I will file a report
after I regress it a but more.  I had a custom called called
"LifeIPhoneViewController", but when I entered the name, it was always
saved as "UIViewController".

Once I noticed the problem I was completely unable to get the exact
text "LifeIPhoneViewController" to stick;  "LifeIPhone" was OK, as was
any length of string that started with an alphabetic character.
"LifeIPhoneViewControlle" without the final "r" would be saved.

Not noticing this for quite a long time was a good part of my problem.
I moved back to XCode 6.0.1 until I resolved it.  I renamed that class
to "LifePhoneViewController".

I think the text field is attempting to validate the entered text but
getting very confused somehow; or maybe it is inappropriate code
reuse, in that something that wasn't meant to validate really is.

I managed to borrow the $99.00 for The Apple Tax.  I'm going to a job
fair tomorrow with twenty potential employers; I hope to demo Warp
Life running on my iPad:

   http://www.warplife.com/life/

It is my take on the Cellular Automaton known as Conway's Game of
Life; I've been into it since 1972.

Thanks Again,

Mike
-- 
Michael David Crawford, Consulting Software Engineer
mdcrawf...@gmail.com
http://www.warplife.com/mdc/

   Available for Software Development in the Portland, Oregon Metropolitan
Area.
___

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: Linking to MLMediaSourcePhotosIdentifier

2015-04-22 Thread Roland King

> On 23 Apr 2015, at 13:50, Graham Cox  wrote:
> 
> 
>> On 23 Apr 2015, at 3:40 pm, Roland King  wrote:
>> 
>> That’s because you didn’t read properly. Check if THE ADDRESS OF THE STRING 
>> CONSTANT is NULL. 
>> 
>> The address of the string constant is &MLMediaSourcePhotosIdentifier
> 
> 
> I read fine.
> 
> I may be confused, but my understanding is that extern NSString* const  
> IS an address.
> 
> Also, adding the explicit & confuses the compiler - it then marks that code 
> as dead, stating it will never be executed. I’m not sure how it comes to that 
> conclusion exactly, but it tends to suggest that taking the address of an 
> extern string constant is not a sensible operation.
> 
> —Graham
> 
> 


#import 
#import 

int main(int argc, const char * argv[]) {
@autoreleasepool {

NSString * const *test = &MLMediaSourcePhotosIdentifier;

if( test == NULL )
{
NSLog( @"The string appears to be missing - sad faces 
all around" );
}
else
{
NSLog( @"Holy halleujia we have a string and it is %@ 
or even %@", *test, MLMediaSourcePhotosIdentifier );
}
}
return 0;
}


Works for me - in the positive case at least as I don’t have a 10.9 machine to 
test it on. 
___

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