; Besides, most of my attempts resulted in a EXC_BAD_ACCESS crash, and the rest
> were not successful.
Not sure what happened, but QA1620
<http://developer.apple.com/mac/library/qa/qa2008/qa1620.html> was recently
updated to show this technique.
--
David Duncan
Apple DTS Animation and Printi
sPerComponent, bytesPerRow, colorSpace, kCGBitmapFloatComponents);
Are you sure the context was actually created? Specifically for float contexts,
you need the kCGImageAlpha[Premultilied | None]Last flag as well.
--
David Duncan
Apple DTS Animation and Printing
le however scales down larger images, which may still be fuzzy in some
cases (for example line art). Getting pixel perfect zooming however is
difficult and to rather performance intensive for something like PDF.
You could also try just using a UIWebView for displaying PDF if it does wh
receiver gets some weird number like 345783653.0.
What's the code look like here? Are you getting any warnings?
More than likely this is something along the lines of a type mismatch on the
message send, but without seeing the code it is hard to know how or why that
might happen.
--
Dav
ow any objects or messages. Where are you getting the wrong
value and where is that code being called from with the correct value?
--
David Duncan
Apple DTS Animation and Printing
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do
re standard way of doing
> it? (Or does the RTF import/export category on NSAttributedString not exist
> in UIKit?)
It doesn't exist in UIKit.
--
David Duncan
Apple DTS Animation and Printing
___
Cocoa-dev mailing list (Cocoa-dev@lists.a
produced string. Any other format string errors are the client's to deal
with.
Yes, this would preclude the client logging objects, but from the sounds of
your specification, any escaping you did would have the same effect.
--
David Duncan
Apple DTS Animation and Printing
_
an asking how to do it the way you think you should. Then perhaps someone can
recommend a better solution.
--
David Duncan
Apple DTS Animation and Printing
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moder
Is your application 32-bit? Are you trying to load the entire file into memory
if you are? If so that would be why you are getting that error.
--
David Duncan
On Jun 9, 2010, at 12:56 PM, Pascal Harris <45rpmli...@googlemail.com> wrote:
> Weird one this - especially since I can
ain-able this couldn't be declared in the property itself.
> 2010-06-17 02:49:13.464 Revapp[4838:a0f] expecting model layer not copy:
> MRWorkspaceItemLayer[(125,125)]
What version of Mac OS X are you on?
--
David Duncan
Apple DTS Ani
likely that you will take exactly 1.5s for all of it to display :).
--
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
7; for the
text to draw over, and thus you get no subpixel smoothing.
You can get subpixel smoothing in CATextLayer by subclassing and overriding
-drawInContext: to first draw an opaque color into the target context before
calling -[super drawInCo
by UIKit or the various
animation classes). Otherwise it sounds like you are on pretty good footing.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact th
are pitfalls as renderInContext does
not implement the full Core Animation compositing model.
--
David Duncan
On Jul 5, 2010, at 12:01 PM, Chaitanya Pandit wrote:
> Hi, List
> I'm trying to create an image out of a UITableView using the layer's
> renderInContext Method, ho
e UTF8String], ...);
Where does it crash? Without knowing what is going wrong it is difficult to
advise...
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Con
ault is to resize with respect for aspect ratio. If you
want the view to resize but stay square, then you will have to resize it
yourself. You can use the willAnimateAutorotation… method on UIViewController
to do this with animation – see the docs f
ther, just
remove all the shenanigans that were defined to ensure that there was only one
instance. In the majority of cases it was likely overkill and potentially
masking memory management bugs.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev
release the data. Leaks should give you a
stack trace showing where that function was called.
--
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 mo
On Aug 2, 2011, at 3:34 PM, Izak van Langevelde wrote:
>
> On 2011-08-02, at 6:02 PM, David Duncan wrote:
>
>> On Aug 2, 2011, at 2:52 PM, Izak van Langevelde wrote:
>>
>>> However, Instruments shows a leaked Malloc of 236K with as responsible
>>> Caller
d:) is not getting invoked for iAD not
> supported regions. But thats not the case, if Appstore supports iAD,
> it Displays real ad. otherwise it will display "Test Ad". Either case
> your delegate method would be invoked.
>
> Any one can confirm the
typically a
rectangle, not a path that describes the text therein.
--
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)lis
On Aug 8, 2011, at 10:21 AM, Jean-Daniel Dupas wrote:
> Le 8 août 2011 à 18:50, David Duncan a écrit :
>
>> On Aug 8, 2011, at 8:16 AM, Jean-Daniel Dupas wrote:
>>
>>>
>>> I think you can create a CGPath from some text using CTFrameGetPath().
>>> O
were two ways to do something, and one involved subclassing
UIWebView and the other did not, I would nearly always choose the method that
didn't involved subclassing.
So the question to you becomes what problem are you trying to solve that you
believe you need to overr
RC
The ARC specification defines a "retainable pointer" as including those
pointers that have the __attribute__((NSObject)) decoration, so this should
behave as expected under ARC.
<http://clang.llvm.org/docs/AutomaticReferenceCounting.html#objects>
--
David Duncan
___
image.
On Aug 11, 2011, at 5:44 AM, charisse napeÿf1as wrote:
> I can already rotate an image. But I don't know how to save it in that
> current state.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please
be
recommended. There are platform specific methods for making a CGContextRef
current. For more complex needs, NSLayoutManager (Mac OS X only) or Core Text
(both) can be used as well.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.co
o stuff with popovers */ } else { /* do stuff
without */ }"
In GCC you should use
Class nsPopover = NSClassFromString(@"NSPopover");
if (nsPopover) ...
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do n
On Aug 15, 2011, at 10:47 AM, Kyle Sluder wrote:
> On Mon, Aug 15, 2011 at 10:45 AM, David Duncan wrote:
>> In either case, the best general way to determine availability of
>> weak-linked implementations is to test for them directly rather than using a
>> system versio
, but I get the same error when running on 10.6.8. I'll try some more in
> case I made a mistake, but….
But again, are you building with Clang? :).
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admi
On Aug 15, 2011, at 11:19 AM, Martin Hewitson wrote:
>
> On Aug 15, 2011, at 08:13 PM, David Duncan wrote:
>
>> On Aug 15, 2011, at 10:56 AM, Martin Hewitson wrote:
>>
>>> Is it ok to declare a property to be NSPopover, even if that class doesn't
>>&g
iple image views rather than drawing the subsection
you need manually.
--
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-ad
oot. You may find the
UIScrollView model easier to manage – YMMV – but if there is a chance that this
non-interactive view could become interactive, I would just go with with
UIScrollView and not look back.
--
David Duncan
___
Cocoa-dev mailing list (
C String and them convert to NSString will be fine for me.
Thats not always viable. Consider that in MacRoman most of the accented
characters use code points in the range of 128-255, and just removing them can
make the text look incredibly wrong.
--
David Duncan
_
t
Draw your NSImageRep using -draw (or -drawAtPoint: or -drawInRect:) to draw
into the current graphics context.
You now have an NSBitmapImageRep with your image contents.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not
y 10.6 will appear there soon.
--
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/
ed it to remain in that format. Core
Graphics can't provide you with non-premultiplied alpha pixels via drawing, so
thats the only route if you need them.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admi
getting composed
characters in this case (your second NSLog should use %C not %@ btw). The best
I can figure is that your SQL backend is expecting decomposed characters (which
would represent this string as UA etc). I
would try -decomposedStringWi
one information when it does not. This change is to (hopefully)
ensure the understanding that an NSDate is not something you can display to a
user simply by asking for its description.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Ple
in foo – replaces foo =
(id)bar; [foo release];
foo = (__bridge_transfer id)bar;
// retain foo and manage it as a non-ARC reference – replaces bar =
(CFTypeRef)[foo retain];
bar = (__bridge_retain CFTypeRef)foo;
--
David Duncan
___
Cocoa-dev mailing
struments, it can be viewed quite
> easily.
Try setting the memory size of the NSURLCache, something like [[NSURLCache
sharedURLCache] setMemoryCapacity:0].
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not po
ow's content area. Essentially, what you want to do is not possible in the
scope of the 4.3 SDK.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact t
Check the WWDC videos from this year, specifically the ones on View controllers.
On Sep 14, 2011, at 10:44 AM, Flavio ceolin wrote:
> Thanks for the reply David.
>
> So, do you know if there is another way to do something like that ?
>
> On Wed, Sep 14, 2011 at 2:31 PM, Davi
ifically says "don't do anything with ownership for this
object".
--
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 coc
he foreground. It
remains until your UI has had a chance to redraw itself.
--
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-
oesn't do this on Mac OS X is that nib loading
there doesn't use KVC, but rather then Obj-C runtime directly.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the
googled for a while now trying to find example code but have come up empty
> (plenty of finite examples). I see there are timer applications out there
> that seem to handle an infinite number of timers.
Have you looked into NSMutableArra
ive timer and
> reordering of the array according to times. But i have run into problems
> when two or more timers are set to fire at the same time.
>
> Tom
>
> On Sep 29, 2011, at 4:51 PM, David Duncan wrote:
>
>> On Sep 29, 2011, at 2:47 PM, Tom Hohensee wrote:
&
mentation details
(the ivar). As such, subclasses can't get at synthesized ivars, precisely
because the @synthesize declaration is hidden from them.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin reques
primary issue is that the compiler doesn't actually know for certain that other
code in your application or the frameworks it links against haven't changed the
implementation of your accessor and thus require it to be called for correct
operation.
--
David Duncan
_
gingRetain(nsString)" to get an
owning reference to an NSString as a CFString.
And you write "NSString *nsString = CFBridgingRelease(cfString);" to get an ARC
managed reference of a CFString as an NSString.
--
David Duncan
___
Cocoa-dev
op to do something like this:
[self setValue: ^(id value) { [aTable setTitle:value]; } fromTable: tableName
withKey: ^ { return [aTable title]; }];
Note there is no need to pass in 'aTable' now because the blocks capture it
instead, which can also provide you with additional flexibil
.
> Is this a bug?
No, its the compiler admitting that it has no way to verify that what is
happening will have the behavior you expect. Thats why this is a warning and
not an error.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists
5.0 only or on previous versions of iOS? There were
some text changes that (for a time) leaked out non-integral values, but we
thought we caught them – if you have a new one please file a bug with a simple
example of what you've found.
--
David Duncan
_
r you can assign an NSImage directly as the
contents of a layer, so your CGImageForProposedRect::: call is unnecessary here.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments
On Oct 22, 2011, at 1:21 PM, Jens Alfke wrote:
>
> On Oct 21, 2011, at 10:47 AM, David Duncan wrote:
>
>> Are you seeing this on iOS 5.0 only or on previous versions of iOS? There
>> were some text changes that (for a time) leaked out non-integral values, but
>>
dge id)foo) works fine. If you need to to manage
ownership, then CFBridgingRetain() or CFBridgingRelease() should be used.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments t
On Nov 1, 2011, at 6:38 PM, Matt Neuburg wrote:
>
> On Nov 1, 2011, at 5:21 PM, David Duncan wrote:
>
>> This compiles for me under ARC:
>> NSArray *array = [NSArray arrayWithObject:[[UIColor greenColor] CGColor]];
>>
>
>
> Well, not for me. I get: "
frames for an exception and logged
that, but it no longer does. You would find the same behavior using iOS 5 with
an older version of Xcode, and you would find the old behavior using any
previous version of iOS with Xcode 4.2.
--
David Duncan
___
Cocoa
efinition of a private method in Obj-C (see
class_copyMethodList)
--
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)l
8K not a big enough max grid size?
--
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/Unsu
ust as much as touches are. What that means is that if your
application is consuming memory slowly and returning to the event loop often,
you will get memory warnings. But if your application is in a tight loop on the
main thread forcing the allocation of lots of physical p
- (void)setWindow:(NSWindow *)window
{
[_internalDictionary setObject:window forKey:@"window"];
}
And thus not increase the size of the object at all (i.e. all properties could
in theory be entries in a _internalDictionary if the class decided to).
Properties are only interfaces.
--
Dav
gain.
This is basically just the theta calculation of a convert to polar coordinates.
man atan2 should give you what you need to know.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or m
around from right to bottom -0 to -90 then around to left side 90 to 0 and
> then back to top from left side -0 to -90.
>
As Marco's code showed, you want to use atan2() not atan(), as atan() doesn't
know which quadrant to use (you could do the work yourself, bu
sent to edole...@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.appl
bounds size.
Moral of the story is that when a layer is transformed (or may be) you should
only manipulate its position and bounds. Stay far far away from the frame
property, as its just a bag of hurt.
--
David Duncan
___
Cocoa-dev mailing lis
On Jan 25, 2012, at 11:24 AM, Seth Willits wrote:
> On Jan 24, 2012, at 5:52 PM, David Duncan wrote:
>
>>> Can anyone explain what's going on?
>>
>>
>> The frame is an entirely synthesized property, based on the bounds,
>> position, anchorPoint
for a cycle. What is the second one?
> Excuse me if I'm being dumb.
myController retains/copies the block. Then the block retains myController
(under ARC __block variables are strong references, so they get retained). Thus
you are left with myController r
On Jan 26, 2012, at 2:44 PM, Conrad Shultz wrote:
> However, __block variables are NOT retained automatically by a block
> during capture, so this breaks the retain cycle.
This is not true under ARC, where __block variables also retain.
--
David
ion (which
would be the permissions required to replace the 'Documents' folder).
As a rule, anything related to the hardware (such as the file system) is
unlikely to be authoritative when working with the Simulator. The other common
gotcha related to the file system is that typ
On Jan 31, 2012, at 1:39 AM, Alex Zavatone wrote:
> Is 4.2.1 this Lion only? Or are those of us who hate Lion in luck?
Lion only.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or modera
ere are probably better
ways for you to put the whole thing together, primarily as it seems you are
trying to setup a producer-consumer pattern.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin reque
.m/.mm or flagged to be compiled
as Objective-C[++]. If you want to avoid Objective-C syntax in your .cpp file,
you can either export a C[++] API to wrap the Objective-C code (the .mm's
header would only export C[++] functionality when __OBJC__ is not defined),
otherwise you should p
On Jan 31, 2012, at 3:49 PM, R wrote:
> I chose this approach rather than delegation.
>
> Thoughts?
Use Delegation instead.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or
FYI, using weak references doesn't necessarily avoid retain/release pairs. At
best it returns to you nil when you would have otherwise gotten an object that
was invalid instead.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.co
ation services are enabled, then check your authorization status and act
appropriately based on the status. kCLAuthorizationStatusNotDetermined means we
haven't asked the user yet, kCLAuthorizationStatusRestricted means that the
user cannot change t
may explain why you didn't get your stroke – the mask applies to a layer
and all of its sublayers. As such, the shape layer would have at least
partially masked the stroke (its possible Core Animation simply rejected
rendering the shape layer entirely, as its path rendering emp
reason why it shouldn't work.
--
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/Unsubscri
match shapeL (except for the fill), gradL was drawn as expected.
>
> I assume this is what you just said — or are you getting at a different way
> to duplicate the layer?
Nope, using +layer or -init and copying appropriate properties is an
appropriately acceptable way to du
k that is associated with a CGContextRef. This is
not the same stack as the call stack. This is discussed in the documentation
for this function (and its associated function CGContextRestoreGState).
--
David Duncan
___
Cocoa-dev mailing list (
>
> 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 se
priately. Alternatively, I can use the "short" format style, and then
> parse out the AM/PM, but that seems more fragile across locales (are there
> locales that use something other than "am" and "pm"?).
>
> Any suggestions?
I think this is what +[NSDa
quot; alone is of type
> "pointer" and so when it is tested by the "if" statement, it's
> implicitly cast to the type "boolean".
In C any non-zero value is 'true', as such if (self) vs if (self != nil) is a
p
oaded and displayed.
Do you do anything special inside of -viewDidLoad?
--
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-ad
mage.
If this does turn out to be the case, then lesson learned is "never store
critical data in my views".
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the l
On Mar 3, 2012, at 8:57 AM, Matt Neuburg wrote:
> On Fri, 02 Mar 2012 10:17:43 -0800, David Duncan
> said:
>> On Mar 2, 2012, at 1:28 AM, G S wrote:
>>
>> In the vast majority of cases where I've seen this behavior, it is because
>> in your delegate hand
bove refers to what happens to self.subview, not to self.view
(hence why I used self.view the first time, then view reference the second
time).
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin request
ain class. For example,
UIKit's NSString additions are in NSString(UIStringDrawing) (which you can
search for in the documetnation).
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or modera
on or do I
> have to add a counter?
You have to add a counter. Alternatively you can use the -enumerateObjects*
APIs on NSArray which give you an index as well as the object, and allow you to
stop the iteration early (if you need that capability).
--
David Duncan
plausible explanation, although it probably couldn't hurt to file a
bug with something that demonstrates the behavior.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments t
ntirely certain what is happening, but it sounds like
you have a timing issue, possibly one where the view's are resized on one
runloop invocation and their contents replaced on the next. Instead of
overriding -setFrame: you should override -layoutSubViews: which should catch
more cases
iately sized buffer and typecasting to
(unsigned char **)? The type cast doesn't change the data, just the compiler's
interpretation of it (and since this is a pointer that won't affect the data
itself in anyway).
--
David Duncan
___
Cocoa-de
g the image into the center of that layer (to make a 1 pixel border) will
likely give you the effect that you desire, although at the cost of additional
rendering time since your layers will no longer be opaque.
--
David Duncan
___
Cocoa-dev mail
ext that doesn't look as good as text drawn over a background.
--
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)li
slightly larger layer as I mentioned, using the very same APIs that you
mentioned :).
--
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
but the
major difference between the first and third image looks like layout metrics
(which is above Quartz) and so the question there might be what is Cocoa Text
doing differently (which is beyond my knowledge). The first and second look
like identical metrics with the issue
label would require such behavior (such as setting auto
sizing text).
Since it sounds like you want the redraw behavior, I would probably just make
that change in IB and go from there.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.ap
> view quietly.
Technically scrolling is a geometry change, since it is accomplished by
changing the layer's bounds.origin (basically the change is coming from Core
Animation). If your layout is expensive, it is likely that you will need to
maintain a separate "layout is dirty&qu
o I'm assuming it does.
Had you just added the layer to the layer tree on the current runloop
iteration? If so, there was no "from" to animate from, so there is no animation.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists
recollection from having
investigated this pathway in the past.
--
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.app
201 - 300 of 1008 matches
Mail list logo