|
Re: Drawing to a PDF context
Well, by default, NWView coordinates are flipped vs. CGContext coordinates. I suggest you try temporarily forcing the point you’re drawing at to be the center of the context or view, and see if the
Well, by default, NWView coordinates are flipped vs. CGContext coordinates. I suggest you try temporarily forcing the point you’re drawing at to be the center of the context or view, and see if the
|
By
Quincey Morris
·
#1204
·
|
|
Drawing to a PDF context
I need to replace calls to CGShowTextAtPoint() with calls to -drawAtPoint:withAttributes:
I made this change and drawing fails… :/
i.e. no text rendered, no exception, logging of errors, etc.
I need to replace calls to CGShowTextAtPoint() with calls to -drawAtPoint:withAttributes:
I made this change and drawing fails… :/
i.e. no text rendered, no exception, logging of errors, etc.
|
By
Sandor Szatmari
·
#1203
·
|
|
Re: NSAlert boxes ...
Oh interesting - it looks like when you call [NSAlert beginSheetModalForWindow:completionHandler:], the alert gets retained by the parent window's attachedSheet property. So you're right, no issues
Oh interesting - it looks like when you call [NSAlert beginSheetModalForWindow:completionHandler:], the alert gets retained by the parent window's attachedSheet property. So you're right, no issues
|
By
Jon Gotow
·
#1202
·
|
|
Re: NSAlert boxes ...
That is the case I’m talking about and no, it works fine even if you don’t “worry” about the lifecycle.
Just alloc + init + autorelease, then beginSheet…. it works, it has always worked
That is the case I’m talking about and no, it works fine even if you don’t “worry” about the lifecycle.
Just alloc + init + autorelease, then beginSheet…. it works, it has always worked
|
By
Graham Cox
·
#1201
·
|
|
Re: NSAlert boxes ...
You're making this far more complicated than it is (talking about running the alert asynchronously, etc).
NSModalResponse choice = [alert runModal];
will run the alert synchronously. Note that it
You're making this far more complicated than it is (talking about running the alert asynchronously, etc).
NSModalResponse choice = [alert runModal];
will run the alert synchronously. Note that it
|
By
Jon Gotow
·
#1200
·
|
|
Re: NSAlert boxes ...
That’s exactly what I’m saying - you are taking ownership of it with alloc+init.
Then you release it or autorelease it within the scope of setting it up. Normal rules.
But the point is the alert
That’s exactly what I’m saying - you are taking ownership of it with alloc+init.
Then you release it or autorelease it within the scope of setting it up. Normal rules.
But the point is the alert
|
By
Graham Cox
·
#1199
·
|
|
Re: NSAlert boxes ...
The MRR rules are straight forward and deviating from them because the runloop may retain the alert is asking for trouble in my opinion. There is no harm in taking ownership of the alert and
The MRR rules are straight forward and deviating from them because the runloop may retain the alert is asking for trouble in my opinion. There is no harm in taking ownership of the alert and
|
By
Sandor Szatmari
·
#1198
·
|
|
Re: NSAlert boxes ...
Thanks Graham and Alex.
I had reached the same sort of conclusions - but could not find any corroborative info anywhere ....
Peter
Thanks Graham and Alex.
I had reached the same sort of conclusions - but could not find any corroborative info anywhere ....
Peter
|
By
Peter Hudson
·
#1197
·
|
|
Re: NSAlert boxes ...
Normal rules require that you either autorelease it or release it when you’re done (assuming manual MM of course).
If no autorelease or release was required, then that would be an exception to
Normal rules require that you either autorelease it or release it when you’re done (assuming manual MM of course).
If no autorelease or release was required, then that would be an exception to
|
By
Graham Cox
·
#1196
·
|
|
Re: NSAlert boxes ...
Sorry, A bit groggy here. If my previous assumption that autorelease isn’t needed is incorrect, then it might be that the instance will be retained until the reference to it is cleared or the
Sorry, A bit groggy here. If my previous assumption that autorelease isn’t needed is incorrect, then it might be that the instance will be retained until the reference to it is cleared or the
|
By
Alex Zavatone
·
#1195
·
|
|
Re: NSAlert boxes ...
Hi Peter,
FWIW, I’ve always done exactly the same as this too, and have never had an issue.
My understanding (which may be wrong) is that the modal loop that runs the alert temporarily retains it,
Hi Peter,
FWIW, I’ve always done exactly the same as this too, and have never had an issue.
My understanding (which may be wrong) is that the modal loop that runs the alert temporarily retains it,
|
By
Graham Cox
·
#1194
·
|
|
Re: NSAlert boxes ...
My expectation is that autorelease is not needed. In any case, if you do use the memory graph debugger to see if it stays allocated or not, and if autorelease is needed, please let us know.
My expectation is that autorelease is not needed. In any case, if you do use the memory graph debugger to see if it stays allocated or not, and if autorelease is needed, please let us know.
|
By
Alex Zavatone
·
#1193
·
|
|
Re: NSAlert boxes ...
Why are you making it autorelease?
Run your method, display and dispose of the alert and then while your app is still running click on the Memory Graph Debugger icon in the debug bar. Look at your
Why are you making it autorelease?
Run your method, display and dispose of the alert and then while your app is still running click on the Memory Graph Debugger icon in the debug bar. Look at your
|
By
Alex Zavatone
·
#1192
·
|
|
Re: NSAlert boxes ...
Thanks Sandor.
My use of alert is very tightly scoped - and only used once - and not passed on.
Many thanks for the link.
Peter
Thanks Sandor.
My use of alert is very tightly scoped - and only used once - and not passed on.
Many thanks for the link.
Peter
|
By
Peter Hudson
·
#1191
·
|
|
Re: NSAlert boxes ...
Peter,
You may have to dispose of it yourself or maybe ARC will take care of it for you. If you’re writing MRR (not ARC) code you always have to -release/-autorelease objects you own (create).
Peter,
You may have to dispose of it yourself or maybe ARC will take care of it for you. If you’re writing MRR (not ARC) code you always have to -release/-autorelease objects you own (create).
|
By
Sandor Szatmari
·
#1190
·
|
|
NSAlert boxes ...
Hi There
I see from the docs that when you create an NSAlert that you should dispose of it yourself.
My code for creating a simple alert and using it looks like this :-
NSAlert *alert = [[[NSAlert
Hi There
I see from the docs that when you create an NSAlert that you should dispose of it yourself.
My code for creating a simple alert and using it looks like this :-
NSAlert *alert = [[[NSAlert
|
By
Peter Hudson
·
#1189
·
|
|
Re: Auto layout help
And I found the missing piece. I was failing to set translatesAutoresizingMaskIntoConstraints to false for one of the views. Doing that makes it all work.
John
And I found the missing piece. I was failing to set translatesAutoresizingMaskIntoConstraints to false for one of the views. Doing that makes it all work.
John
|
By
John Brownie
·
#1188
·
|
|
Re: Auto layout help
Further digging leaves me more confused. Because I'm supporting 10.9, there are various features I can't use, so I'm stuck with the auto layout basics, and it's hard to find a good explanation of how
Further digging leaves me more confused. Because I'm supporting 10.9, there are various features I can't use, so I'm stuck with the auto layout basics, and it's hard to find a good explanation of how
|
By
John Brownie
·
#1187
·
|
|
Auto layout help
I have my web view displaying correctly, but I've run into a problem in getting the auto layout constraints working correctly. Basically, I build the appropriate web view as a subview of a custom
I have my web view displaying correctly, but I've run into a problem in getting the auto layout constraints working correctly. Basically, I build the appropriate web view as a subview of a custom
|
By
John Brownie
·
#1186
·
|
|
Re: How to present a web view while supporting 10.9?
Thanks for all the tips. I have it all worked out now.
John
Jens Alfke wrote on 7/2/20 21:39:
--
John Brownie
Mussau-Emira language, New Ireland Province, Papua New Guinea
Kouvola, Finland
Thanks for all the tips. I have it all worked out now.
John
Jens Alfke wrote on 7/2/20 21:39:
--
John Brownie
Mussau-Emira language, New Ireland Province, Papua New Guinea
Kouvola, Finland
|
By
John Brownie
·
#1185
·
|