|
Re: Getting IB_DESIGNABLE to work properly
You do want your subviews drawn, right?
--
Gary L. Wade
http://www.garywade.com/
You do want your subviews drawn, right?
--
Gary L. Wade
http://www.garywade.com/
|
By
Gary L. Wade
·
#516
·
|
|
Re: Getting IB_DESIGNABLE to work properly
I’ve gone for something slightly different that’s a little more generic (it’ll work for any view, not relying on it being a specific class). It still wouldn’t work for a layer backed or
I’ve gone for something slightly different that’s a little more generic (it’ll work for any view, not relying on it being a specific class). It still wouldn’t work for a layer backed or
|
By
Graham Cox
·
#515
·
|
|
Re: Getting IB_DESIGNABLE to work properly
Cool - I’ll give that a shot. Thanks!
—Graham
Cool - I’ll give that a shot. Thanks!
—Graham
|
By
Graham Cox
·
#514
·
|
|
Re: Getting IB_DESIGNABLE to work properly
I’ve never called super, nor understand why it would be needed. I know the boilerplate calls it, but it appears to do nothing.
If there has been a change in the recommendation for this since 10.2
I’ve never called super, nor understand why it would be needed. I know the boilerplate calls it, but it appears to do nothing.
If there has been a change in the recommendation for this since 10.2
|
By
Graham Cox
·
#513
·
|
|
Re: Getting IB_DESIGNABLE to work properly
Looking at the code, it appears you’re missing a call to [super drawRect:dirtyRect] in your own drawRect: method.
--
Gary L. Wade
http://www.garywade.com/
Looking at the code, it appears you’re missing a call to [super drawRect:dirtyRect] in your own drawRect: method.
--
Gary L. Wade
http://www.garywade.com/
|
By
Gary L. Wade
·
#512
·
|
|
Re: Getting IB_DESIGNABLE to work properly
Works, too!
By
Quincey Morris
·
#511
·
|
|
Re: Getting IB_DESIGNABLE to work properly
Oh, of course, by calling their drawRect, it makes them draw in parent bounds coordinates, not their own bounds coordinates, but you can compensate for that.
Oh, of course, by calling their drawRect, it makes them draw in parent bounds coordinates, not their own bounds coordinates, but you can compensate for that.
|
By
Quincey Morris
·
#510
·
|
|
Re: Getting IB_DESIGNABLE to work properly
An interesting observation. I went back to your test project and made the digit-array drawRect call drawRect on the subview, and they draw in IB!
Unfortunately, they draw in the wrong place. If you
An interesting observation. I went back to your test project and made the digit-array drawRect call drawRect on the subview, and they draw in IB!
Unfortunately, they draw in the wrong place. If you
|
By
Quincey Morris
·
#509
·
|
|
Re: Getting IB_DESIGNABLE to work properly
Yes - the view works properly in the normal runtime case.
I’ve determined that the reason is that the IB ‘agent’ for previewing an IB_DESIGNABLE view directly calls -drawRect: on the view - it
Yes - the view works properly in the normal runtime case.
I’ve determined that the reason is that the IB ‘agent’ for previewing an IB_DESIGNABLE view directly calls -drawRect: on the view - it
|
By
Graham Cox
·
#508
·
|
|
Re: Getting IB_DESIGNABLE to work properly
Hi Graham,
Are you setting needsDisplay for each of the subviews?
Jeremy
Hi Graham,
Are you setting needsDisplay for each of the subviews?
Jeremy
|
By
Jeremy Hughes
·
#507
·
|
|
Re: Getting IB_DESIGNABLE to work properly
Thanks for having a look,
I see what you’re saying, but IB has to instantiate the view (at least once) to capture what it renders. It must also redo this capture whenever any of the properties
Thanks for having a look,
I see what you’re saying, but IB has to instantiate the view (at least once) to capture what it renders. It must also redo this capture whenever any of the properties
|
By
Graham Cox
·
#506
·
|
|
Re: Getting IB_DESIGNABLE to work properly
AFAICT it doesn’t work like that. The canvas isn’t showing the view hierarchy, it’s showing the objects in the design hierarchy that you can reveal on the left. Of course, that represents the
AFAICT it doesn’t work like that. The canvas isn’t showing the view hierarchy, it’s showing the objects in the design hierarchy that you can reveal on the left. Of course, that represents the
|
By
Quincey Morris
·
#505
·
|
|
Getting IB_DESIGNABLE to work properly
Hi all,
I’m working on a small custom view project (Mac), and have it working generally quite well.
I decided to make it IB_DESIGNABLE, and that too mostly works - I can see the view in IB rendered
Hi all,
I’m working on a small custom view project (Mac), and have it working generally quite well.
I decided to make it IB_DESIGNABLE, and that too mostly works - I can see the view in IB rendered
|
By
Graham Cox
·
#504
·
|
|
Re: string pointer
(I tried to find Charles’s post about this, but didn’t succeed.)
Everything you said after the first sentence is absolutely true. That is the standard way, and your suggestion helped rewrite the
(I tried to find Charles’s post about this, but didn’t succeed.)
Everything you said after the first sentence is absolutely true. That is the standard way, and your suggestion helped rewrite the
|
By
Quincey Morris
·
#503
·
|
|
Re: string pointer
I disagree that it's dangerous. It's the standard way code is written when a parameter is passed back by reference. How many times in Apple code do you see something like:
NSError* err;
if([thing
I disagree that it's dangerous. It's the standard way code is written when a parameter is passed back by reference. How many times in Apple code do you see something like:
NSError* err;
if([thing
|
By
Steve Mills
·
#502
·
|
|
Re: string pointer
So, here’s what’s going on. It’s a bit messy.
— A pointer has an ownership attribute, which is __strong by default, but can be explicitly specified as __weak or __autoreleasing. In your code,
So, here’s what’s going on. It’s a bit messy.
— A pointer has an ownership attribute, which is __strong by default, but can be explicitly specified as __weak or __autoreleasing. In your code,
|
By
Quincey Morris
·
#501
·
|
|
Re: string pointer
Excellent. Works perfectly without complaints from the compiler.
Thanks a lot!
Kind regards,
Gerriet.
Excellent. Works perfectly without complaints from the compiler.
Thanks a lot!
Kind regards,
Gerriet.
|
By
Gerriet M. Denkmann
·
#500
·
|
|
Re: string pointer
Yes.
Why not this?
NSString* s;
NSUInteger c = [self computeFor:42 reason:needReason ? &s : nil];
--
Steve Mills
Drummer, Mac geek
Yes.
Why not this?
NSString* s;
NSUInteger c = [self computeFor:42 reason:needReason ? &s : nil];
--
Steve Mills
Drummer, Mac geek
|
By
Steve Mills
·
#499
·
|
|
string pointer
I have a method like (macOS 13.3, Xcode 9.2 (9C40b)):
- (NSUInteger)computeFor: (NSUInteger)arg reason: (NSString * __autoreleasing *)reason
{
NSUInteger value;
// some computing…
if ( reason
I have a method like (macOS 13.3, Xcode 9.2 (9C40b)):
- (NSUInteger)computeFor: (NSUInteger)arg reason: (NSString * __autoreleasing *)reason
{
NSUInteger value;
// some computing…
if ( reason
|
By
Gerriet M. Denkmann
·
#498
·
|
|
Push notification debugging mobile profile on Apple's 2265 TN.
https://developer.apple.com/library/content/technotes/tn2265/_index.html
https://developer.apple.com/library/content/technotes/tn2265/tn2265_PersistentConnectionLogging.zip
Testing on the Mac to see
https://developer.apple.com/library/content/technotes/tn2265/_index.html
https://developer.apple.com/library/content/technotes/tn2265/tn2265_PersistentConnectionLogging.zip
Testing on the Mac to see
|
By
Alex Zavatone
·
#497
·
|