n the head here too): Always
ensure your using floating point division if your going to do this.
That means always dividing by 255.0. I've seen too many people asking
"why do I always get black" and pointed out "because you forgot the .
0" :).
--
David Duncan
Ap
you elaborate?
--
David Duncan
Apple DTS Animation and Printing
___
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
ffset into its coordinate system.
--
David Duncan
Apple DTS Animation and Printing
___
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-admi
ecifically) demonstrates
this.
<http://developer.apple.com/samplecode/OutputBins2PDE/index.html>
--
David Duncan
Apple DTS Animation and Printing
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comm
y required.
--
David Duncan
Apple DTS Animation and Printing
___
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
trol to do this, but at
the same time your still looking at using a lot of memory to implement
this (especially on older devices that don't have non-power-of-2
textures).
Am I right in assuming that quicktime playback on the iphone does
not support transparency?
Correct.
--
Da
igate that alternative instead.
--
David Duncan
Apple DTS Animation and Printing
___
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
if your getting memory glitches, it sounds like your images are
awfully large...
--
David Duncan
Apple DTS Animation and Printing
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the li
On Aug 13, 2009, at 9:24 AM, Daniel Furrer wrote:
I'm trying to get the RGB components of a system color.
Which system color? Many system colors are patterns and thus do not
have real RGB values.
--
David Duncan
Apple DTS Animation and Pri
On Aug 13, 2009, at 2:12 PM, Eric E. Dolecki wrote:
Is there a way to tell if the device is currently docked?
Probably the closest thing would be to use the Battery API to
determine if the battery is being charged. See UIDevice for details.
--
David Duncan
Apple DTS Animation and Printing
vice is on external power
(which in this particular case would likely be a false positive on one
of those external battery packs) then you want to know if the battery
status is "charging".
--
David Duncan
Apple DTS Animation and Printing
__
gnize this situation.
Caveat implementor.
On Aug 15, 2009, at 2:19 PM, Jack Carbaugh wrote:
ah but wouldn't this be a FAIL if say, the user was using a battery
extender for a quick recharge ?
On Aug 15, 2009, at 3:40 AM, David Duncan wrote:
On Aug 14, 2009, at 4:29 AM, Sean Kline wrot
If you can require iPhone OS 3.0 then you can experiment with the
CAShapeLayer which will automatically rerender when zoomed.
--
David Duncan @ My iPhone
On Aug 17, 2009, at 4:18 PM, Kaspar Fischer
wrote:
Any ideas?
Kaspar
On 16.08.2009, at 12:43, Kaspar Fischer wrote:
Dear list
Mac OS X 10.5 or later.
<http://devworld.apple.com/samplecode/OutputBins2PDE/>
--
David Duncan
Apple DTS Animation and Printing
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to th
no control over when data
is written (and writing to flash can be fairly costly).
--
David Duncan
Apple DTS Animation and Printing
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to t
there is a
certain amount of experimentation required.
--
David Duncan
Apple DTS Animation and Printing
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators a
than just returning 0,
usually by just extracting some bits from 'self', ala
-(NSUInteger)hash
{
uintptr_t hash = (uintptr_t)self;
return (hash >> 4);
}
--
David Duncan
Apple DTS Animation and Printing
___
Cocoa-dev mai
was able to find the source.
Trust what you see on the device. It is what your users will
experience. But you haven't provided enough information for anyone to
really assist you at this time...
--
David Duncan
Apple DTS Animation and Pri
from the sample code
because there were a number of design flaws that lead to many issues,
such as the leak you are seeing here. Use the AVAudioPlayer class or
OpenAL directly instead.
--
David Duncan
Apple DTS Animation and Printing
___
Cocoa
the framework. Open up
your Targets, Get Info, select the General Tab and in the list at the
bottom of the window press the + button. You should be able to find
the AVFoundation.framework easily in the list.
--
David Duncan
Apple DTS Animation and Printing
does not mean that it is in a view hierarchy yet.
-viewDidAppear: or -viewWillAppear: make more sense here.
--
David Duncan
Apple DTS Animation and Printing
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin reques
your just drawing an image, you could instead just set the contents
directly to the image (same issue applies).
--
David Duncan
Apple DTS Animation and Printing
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin reques
On Aug 27, 2009, at 3:58 PM, David Duncan wrote:
By default when the contents of an animation change
contents of a layer change, sorry for any confusion...
--
David Duncan
Apple DTS Animation and Printing
___
Cocoa-dev mailing list (Cocoa-dev
t found in protocol(s).
Your protocol probably doesn't conform to NSObject, ala
@protocol MyProtocol
--
David Duncan
Apple DTS Animation and Printing
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or mod
s the drift that you will get from assuming that timers will
always fire on time, every time (neither of which is true).
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments
l instance of some cell type, but as you scroll through a table you
might go through dozens or hundreds of rows that all share a specific type. In
such a case you might have less than a dozen cell instances for those hundreds
of rows, but you still need individual instances for each row.
--
Dav
gt; nil, and there is a significant amount of data coming in - 30K out of a 200K
> image.
It is unclear how you are managing having multiple requests. Do you have
multiple instances of this class, or does -loadAsync just get called 4 times?
--
David Duncan
___
this mean?
It means exactly what it says. Someone tried to create a CGImage with a size of
0x0.
> What can I do about this?
If you are creating CGImages, you should ensure they aren't 0x0 in size. If you
are not creating CGImages then you shoul
e is always draw at its full size. A UIView
(really the CALayer owned by the view) can and will display content larger than
its bounds if given to it.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin
On Aug 4, 2010, at 4:46 PM, Jonathon Kuo wrote:
> On Aug 4, 2010, at 9:43 AM, David Duncan wrote:
>
>> A UIView (really the CALayer owned by the view) can and will display content
>> larger than its bounds if given to it.
>
> Is there a way to restrict this behavior, i
of
your view hierarchy).
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update
re a representation of the NSAttributedString (probably as strings with
matching attribute dictionaries) and reassemble the NSAttributedString from
that at runtime.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not
r both getting and setting attributes and characters. You
will have to use those methods along with your own storage scheme to save and
restore the NSAttributedString.
It primarily comes down to reading the documentation and asking more pointed
questions if necessary :).
--
David
ecially if each of them takes a while to draw, which is a function
of their size – then you could end up blowing past available memory pretty
quickly.
You might try using smaller tiles instead. Fade duration is unlikely to have
any effect (as that i
e a small
set of layers or views that do your drawing as you scroll through the document.
This allows you to maintain control of memory usage as well.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin re
on-layer backed mode. In UIKit and in AppKit
under layer backed mode however a layer will retain backing store for its
entire content area (generally bounds.size * contentsScale). You can ask for
partial draws, but if the content isn't going to change then that may not
; I've tried hiding the files and folders, to no avail -- they still show up
> in iTunes. Is there any way to prevent this?
http://developer.apple.com/iphone/library/qa/qa2010/qa1699.html
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@list
to accomplish and what your bottlenecks really are,
because I think part of your issue may be due to assumptions about where your
bottlenecks are.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin request
f the iOS 4.0 SDK, the simulator supports the modern, non-fragile runtime.
--
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-
chronous networking (like you are above) is generally
discouraged.
--
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
k on devices that have more built in memory, but is almost
certain to fail on older devices that do not. But 24MB is still a huge amount
of memory to consume on a single image that the user can't even see all at once.
--
David Duncan
___
Cocoa-d
rovided that you are on iOS 3.2 or later (there
was a bug in 3.1 and prior where UIGraphicsBeginImageContext() used a format
that caused Core Animation to make a copy of the data).
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admi
egant, which makes me wonder if there's a better way.
Unfortunately at this time the "clumsy and inelegant" solution is also the only
viable one.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post
On Aug 25, 2010, at 5:08 AM, Mr. Gecko wrote:
> I do not do garbage collection because I am building for 10.4. Why, because I
> have 10.4 customers.
-drain is still available on 10.4.
--
David Duncan
___
Cocoa-dev mailing list (Coc
i.e. supporting the portrait and landscape default pngs) it should
just work from there.
--
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
ur. Now that NSOperation uses GCD, the threads are
much longer lived and thus Core Animation's state flush doesn't occur (because
you aren't running a run loop).
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com
up hitting one of
the watchdog timers and having your application get killed.
Basically you should NEVER block the main thread for any reason.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests o
>
>[task release];
>}
> #elif TARGET_OS_IPHONE
>
>//
>
> #endif
>
>return __sSystemPageSize;
> }
There is no reason to use NSTask for this on the desktop. Just call
getpagesize() on either platform.
--
David Duncan
__
What is the error you are getting?
--
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
ppendingPathComponent:]: unrecognized selector sent to instance
> 0x16fbe0
defaultImageLocation is an NSURL* (because thats what you created at the top of
the method). You want to use -URLByAppendingPathComponent: with it.
--
David Duncan
___
Cocoa-dev
On Aug 28, 2010, at 1:22 PM, Matt Neuburg wrote:
> In my UIView's drawRect: I derive a CGLayer from the current context, draw
> into it, and then draw the layer into the context (the view).
Out of curiosity is there any particular reason you are taking this approach?
--
D
I would recommend you file a bug.
--
David Duncan
On Aug 29, 2010, at 9:38 AM, Matt Neuburg wrote:
> On or about 8/28/10 9:31 PM, thus spake "David Duncan"
> :
>
>> In the case of iOS for example, caching contents to CGLayers is rarely useful
>> because it is
On Aug 29, 2010, at 11:21 AM, Matt Neuburg wrote:
> On or about 8/28/10 9:31 PM, thus spake "David Duncan"
> :
>
>> it is usually far more
>> useful to use a hardware cache, which means CALayer or UIView, not CGLayer.
>
> Sorry to keep coming back to thi
Retain/Release and calls CFRelease()
under GC. The typical idiom for dual mode code is to do
"[NSMakeCollectable(foo) autorelease]" which will ensure the object will be
released under both RR and GC (NSMakeCollectable is identical to
CFMakeCollectable except for its return valu
done, but you have to ensure that your layer's drawing is
threadsafe. Should be as simple as this with that precondition met:
dispatch_async(queue, ^{
[layer display];
[CATransaction flush];
}
--
David Duncan
___
Cocoa-dev mailing l
On Sep 2, 2010, at 9:40 AM, Chris Parker wrote:
> On 2 Sep 2010, at 8:52 AM, David Duncan wrote:
>
>> On Sep 2, 2010, at 7:39 AM, Vincent Habchi wrote:
>>
>>> I just wanted to know someone has already tried to successfully send a
>>> CALayer -drawInConte
of
which is things "mostly" working but occasionally your drawing going into the
wrong view. Basically *never* use the context given to you in -drawInContext:
outside of that invocation.
--
David Duncan
___
Cocoa-dev mailing list (Coc
d in the
>> block, does nothing: the -(void)display
>
> Read: "at any subsequent call, albeit the block is correctly enqueued,
> nothing is done: …"
Are you sure the block was executed? I've done this before in various
incarnations and
of
other ways to do this too, I would recommend you read the documentation for
-[CALayer actionForKey:] for more details.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments
t; various forums including apple forum I cant find the answer for it. I
> hope you guyz can help. The following is the code which I used for the
> animation.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not
ay of the
> amount of system memory?
Disk storage and rates should be in base-10. System memory is in base-2.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
animation in Cocoa.
You are probably looking at NSOpenGLView on Mac OS X and OpenGL ES on iOS
(technically via CAEAGLLayer, but see the OpenGL template for details).
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not pos
On Sep 13, 2010, at 7:58 AM, Matt Neuburg wrote:
> I would recommend that Apple improve the documentation
https://bugreport.apple.com/ or the feedback links at the bottom of every page
in the documentation. If there isn't a bug, the issue doesn't exist.
--
s opaque? If so you probably want to unmark
that. Or as an alternative, maybe mark your split view as layer backed instead?
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comme
and accomplishing the task that you are
trying to do and have nothing to do with the general animation techniques. Also
+[UIView beginAnimations:context:] isn't the new block based animation routines
– those are the +[UIView animateWithDuration:*] and +[UIView t
rator".
> The offending line in CGPDFContext.h is:
> CG_EXTERN void CGPDFContextAddDocumentMetadata(CGContextRef context,
> CFDataRef metadata) CG_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_0);
>
> Obviously something is messed up, but what can I do to fix this?
https://devforums.apple.com/message/28
block based animations?
>
> On Sep 15, 2010, at 9:56 AM, David Duncan wrote:
>
>> On Sep 14, 2010, at 9:42 PM, James Miller wrote:
>>
>>> With Apple recommending block-based animation of UIImageViews, I'm not
>>> quite grasping how to take older fr
e Animation define them (by declaring them @dynamic) they cannot be
animated and you will see the symptoms you see. In your -drawInContext: method
you can then query the property to get the current value.
--
David Duncan
___
Cocoa-dev mailing list
out more about this? It is not mentioned in the
> Core Animation Programming Guide (2010-08-12), and I have got two e-books on
> core animation, and it is not mentioned in either of them.
>
> Thanks
>
> Ken
>
> On 21 Sep, 2010,at 09:07 AM, David Duncan wrote:
>
>
the layer. Either way your talking
about drawing your path into a plain CALayer.
--
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 co
elatively straightforward.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Sub
ontext.
Where are you calling this? About the only thing I know of that might cause
this is trying to call UIGraphicsGetCurrentContext() from outside of -drawRect:
(in which case unless you've pushed or started your own context you get back
NULL, which
e shown thus far
should be causing any problems.
--
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
bitrates the supported orientations (most commonly
this case is a UITabBarController).
--
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
works" it is because you are getting very lucky with what is
already on the stack.
--
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 c
On Oct 14, 2010, at 1:30 PM, David Duncan wrote:
> On Oct 14, 2010, at 1:25 PM, Tito Ciuro wrote:
>
>> return [[[self alloc]initWithObjects:someObjects]autorelease];
>> <<<<<<<<<<<< warning occurs here
>
>
> -initWithO
would realize that it really doesn't matter – the Finder will still show "Part
1/2.jpg".
--
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;
> The free() gives this error
>
> malloc: *** error for object 0x21568580: Non-aligned pointer being freed (2)
>
> How can I avoid this?
Did you perhaps change destination between malloc() and free()?
--
David Duncan
___
Cocoa-dev mailing
On Nov 2, 2010, at 9:15 AM, Phillip Mills wrote:
> Suggestions for a cleaner approach would be appreciated
-viewWillAppear: or -viewDidAppear: perhaps?
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post ad
location you
expect, but we have no idea what is actually going wrong.
Also, if you think this is a framework bug, file one.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comment
o static and animated bits, stuff them into views,
move the views.
3) Shrink your image sizes, scale them up for animation. 512x384 for example
cuts the memory usage by 75%.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please
u create a single image for the body. You put all this in a view hierarchy
and move the whole thing from side to side. Done, and in far less memory.
Obviously if your scene is more complex this will require more work, but for
many animations of this n
ly equivalent is the problem. You should be
able to get something predictable by using AddCurveToPoint in both places, and
to use the same location for both control points (which degenerates a Cubic
curve to a Quadratic one).
--
David Duncan
___
Cocoa
asn't working nicely, I tried the quad curve.
--
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
ayLink, you may or may not need OpenGL. You
can experiment with using a CADisplayLink to update a view/layer hierarchy and
see if that gets what you need.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin re
er 'frameNumber' in 'frame', which is of non-class type
> 'objc_object* const'
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the
stored
> as a variable within the class, and is fixed soon after instantiation) in
> spite of the fact that I only have a 'const' pointer to the object at the
> time I want to access it. Semantically I don't see why it should be unsafe to
&
ontent.
So as I surmised when I asked the question, you don't need the 'const' modifier
at all. Just declare and use the variable normally.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do n
in the code, before it happens?
>
> I also get:
>
> : FT_Open_Face failed: error 2.
>
> for some files as well when I call CGContextDrawPDFPage on some PDF files.
> Once again, is there a way to pre-flight the PDFs to determine if they are
> going to fail?
--
David Dun
t a retain, worst case it was a mutable object that wouldn't have been
modified anyway.
--
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 mod
fortunately you can declare that your protocol inherits from
another, and there is also an NSObject protocol that defines the core
functionality of the class, so you can do this when you declare your protocol
and never need to worry about "NSObject"
@protocol SomeProtocol : NSObject
r probably right. Dangers of typing code into Mail instead of a compiler
:).
--
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-d
above is a warning and
not an error). Technically you don't even need to conform to the protocol, you
can just implement the methods and go, but implementing the protocol allows for
error checking by the compiler – but only when the compiler can actually see
the protocol declarations
form on the view the
frame is a much less reliable means of making adjustments to the view.
--
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 moderato
o hit the
debugger to check your deltas.
--
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
lemented for correct operation.
In the end the compiler is just trying to help you understand the ramifications
of your code, just like the warning for "if (x = y)". You can take the advice
or leave it.
--
David Duncan
___
Cocoa-dev mailin
comes
> form the frame, are not the same, and well the docs clearly says its
> undefined.
Check the bounds, it contains the untransformed size of the view.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not
• String and image drawing is now thread-safe.
>> • Using color and font objects in multiple threads is now safe to do.
>
> Moreover, in the WWDC videos we see CATiledLayer being drawn to via drawRect:
> with UIKit.
>
> So what's true? And how can I find out precisely wh
. Unless I misunderstand
> something
'self->foo' is equivalent to 'foo' (both are transformed into an appropriate
offset into instance storage). self.foo is equivalent to [self foo] or [self
setFoo:] depending on context.
--
David Duncan
er, but the size of the MPMediaPickerController view's
> is in portrait mode always.
As noted in the documentation, the media picker doesn't support landscape mode.
--
David Duncan
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
501 - 600 of 1008 matches
Mail list logo