I recently wrote a blog post with a demo xcode project that shows an
implementation of updating a progress indicator for file copy. You can
see it here: http://www.cimgf.com/2008/05/03/cocoa-tutorial-file-copy-with-progress-indicator/
It's a lowest common denominator example, so it might give
It's included for 10.5. I don't think you want Image Capture for your
app, though as this API is mainly for downloading images from the
camera after a photo shoot. I don't believe there is any mechanism for
causing the picture to be taken (from a button click in your app for
example). QTKit
n
IB and start adding your code to it. That's really all you *need* to
know.
-Matt
--
Matt Long
[EMAIL PROTECTED]
http://www.matthew-long.com/
On May 23, 2008, at 12:49 PM, Johnny Lundy <[EMAIL PROTECTED]> wrote:
I decided to once again go verbatim through C
Yes. See this post.
http://www.matthew-long.com/2007/11/02/the-managed-object-model-version-used-to-open-the-persistent-store-is-incompatible-with-the-one-that-was-used-to-create-the-persistent-store/
hth
-Matt
On May 28, 2008, at 2:41 PM, Rick Mann wrote:
In my simple CoreData document app,
Hey Graham. I wrote a blog post not too long ago that demonstrates
adding layers to a root layer. You can see it here: http://www.cimgf.com/2008/03/15/core-animation-tutorial-dashboard-effect/
I think you want to get the root content layer and then call
insertSublayer or addSublayer to it. He
This might help:
http://www.cimgf.com/2008/05/13/from-hacker-to-microisv-custom-file-formats/
In essence you create a folder and set attributes on it as you
suspected. Though these are referred to as packages instead of
bundles. Take a look at NSFileManager. You can create a directory that
It has a lot of compiler warnings when you build it under Leopard, but
the Connection Kit: http://opensource.utr-software.com/connection/
says it does support WebDAV.
-Matt
On Jul 21, 2008, at 9:59 AM, Abernathy, Joshua wrote:
Goliath (http://www.webdav.org/goliath/) is an open source WebDA
When you call addSubLayer, you are in essence telling the layer to
animate so any properties you changed in the layer will animate after
adding the layer. You are doing this in your awakeFromNib which is
likely why you don't see the animation when it runs--not sure though.
You might want to
I can't speak to the example you mention specifically, but I had tried
to scale font sizes this way as well and never got the smooth
transition either. Instead I used something like this:
CATransform3D transform = CATransform3DMakeScale(factor, factor,
factor);
[mainLayer setTransform:tran
Are you trying to remove views or animations? Animations are removed
from a layer by default which can be overridden in the
removedOnCompletion property (in CAAnimation) in an explicit animation.
If you're trying to remove views, however, your code is wrong. You
need to find the view you wa
I think you need to clarify what you mean by "swapping of layers into
views". The page curl transition works fine in a CALayer. I just set
the transition for the "opacity" key so that whenever opacity gets
changed, the transition between the previous layer opacity and the new
is done with a
I've noticed that when using the mask property in a CALayer, the mask
itself defines what part of the containing layer shows through rather
than what part of the layer is actually covered or masked. I'm sure
it's just me, but this logic seems inverted from what it ought to be.
Is there a si
You've got some fundamental issues here. This call in particular:
imageLayer drawLayer:imageLayer inContext:ctx];
It doesn't make sense.
-drawLayer:inContext is a delegate method. You are overriding drawing
functionality for the layer in question. Instead you would set the
layer's delegate
to try to
get his code to work. ;-)
On Sep 18, 2008, at 5:00 PM, Brad Gibbs wrote:
On Sep 18, 2008, at 3:18 PM, Matt Long wrote:
You've got some fundamental issues here.
That doesn't surprise me...
___
Cocoa-dev mailing list (Co
If you compiled your libs using the normal linux/unix ./configure,
make, make install routine, you likely don't have universal binaries.
Can't be sure your issue without seeing your linker error messages,
but this is a likely cause.
-Matt
On Sep 23, 2008, at 11:50 AM, Harsh Trivedi wrote
Carmen,
I don't know anything about reading pixels back from VRAM and this CPU
analysis you refer to. Why do you need to do that again?
You might want to look into using Core Animation for what you are
trying to do. For that matter, you could very easily create a simple
Quartz Composition
You could get a char array from your initial NSString and then use
stringByAppendingFormat:@"%c " on an NSString in a loop. Notice the
space after the %c.
-Matt
J. Todd Slack wrote:
Hi John,
Yes, I have, Are you thinking insertString:atIndex:?
So at a basic level, can I get the string
This may be a best practice type issue, so if you think I'm missing
something fundamental, don't assume I know it just because I probably
should.
I have a class called AppDelegate that handles all of my UI code. I am
handling actions in it not only from my main window, but also from
secon
Man! That sure simplified things. Thanks for the tip. Works perfectly.
I ended up using NSRunLoopCommonModes which is apparently Leopard
only. But that's fine for my app.
Thanks.
-Matt
On Mar 19, 2008, at 7:16 PM, Wim Lewis wrote:
On Mar 19, 2008, at 6:00 PM, Matt Long wrote:
Hey Mani,
I never solved the problem completely, however, I realized that what
you need to do, or so it seems, is to somehow get notified when the
animation has finished and then actually move the button to the
position where the animation stopped. It seems really convoluted to
me, but I
This might help you: http://www.matthew-long.com/2007/11/09/xcode-30-tutorial/
It's a bit shorter tutorial than the Apple one.
-Matt
On Apr 15, 2008, at 9:25 AM, Mike R. Manzano wrote:
Please read one of the many fine tutorials on the subject, including
this one: http://developer.apple.com
http://www.cimgf.com/2008/04/09/cocoa-tutorial-introduction-to-identity-services/
It has a few 10.5 only features, but you can probably get the gist of
API level calls that will work in 10.4.
Here's a demo from Apple: http://developer.apple.com/samplecode/IdentitySample/
-Matt
On Apr 16, 2
that allows
developers to access users and groups on a system in order to create
customized access controls."
Sorry about that.
-Matt
On Apr 16, 2008, at 7:52 AM, Matt Long wrote:
http://www.cimgf.com/2008/04/09/cocoa-tutorial-introduction-to-identity-services/
It has a few 10.5 onl
I execute this code and it successfully copies my file from source to
destination:
- (IBAction)startCopy:(id)sender;
{
FSFileOperationRef fileOp = FSFileOperationCreate(NULL);
FSRef source;
FSRef destination;
FSPathMakeRef( (const UInt8 *)[[sourceFilePath stringValue]
cStrin
Thanks for the help. The first response I got (Steve) was the correct
one for what I was needing. I didn't correctly schedule with the run
loop.
Here's a couple of points
Mike Fischer suggested that the operation was completing in less time
than the one second specified. This is a good tho
Does anyone know if there is a way to programatically set the Image
Capture.app preference called "When a camera is connected, open:". I
want to set this to "No Applicaiton" using code. I would think that
there is some plist file containing this preference, but I've yet to
find such a thing
I'm hoping that all of the asterisks are just artifacts from a copy/
paste maneuver or something, however, if they are not then you're
missing some serious fundamentals. This code will never compile.
Let's just assume a copy/paste issue. If you are wanting to animate
the size of the frame, u
Matt Gemmell is the guy to read on this: http://whathaveyoutried.com/
The shortcut function you are asking for doesn't exist. So now what?
What have you tried? People are much more likely to provide answers to
questions that show what you are currently doing. You're taking the
risk that peo
Have you tried setting a "Clear" renderer as Layer 1?
Are you loading the composition in a QCView or a Core Animation
QCCompositionLayer? Also, do your dimensions match between the
composition and the view you're loading it into?
-Matt
On Dec 26, 2008, at 8:30 AM, Gustavo Pizano wrote:
The quartz composition key paths are going to be:
@"patch.pitch.value"
@"patch.roll.value"
If you are using a QCCompositionLayer, you can simply call [layer
setValue:[NSNumber numberWithFloat:pitch]
forKeyPath@"patch.pitch.value"] or even more simply [layer setValue:
[NSNumber numberWithFlo
Both? I can see reasons to want both depending upon what the developer
is providing the end-user. How about a parameter letting me specify? ;-)
-Matt
On Dec 30, 2008, at 7:51 AM, Mike Abdullah wrote:
What is the desired intent of the -connect method? If you call it
while already connected,
A QTMovieLayer "starts" when you call [QTMovie play] on the movie you
initialized the layer with. What "specs" make the claim that a
QTMovieLayer starts automatically? A QCCompositionLayer does start
automatically. If your composition is not playing, check it in Quartz
Composer first and ma
Seth,
Synchronization is done at a lower level. You need to get the movie
time base of the movie you want to be the master and then set the
master time base for the movie you want to be the slave. Since this is
done at the Movie primitive level it doesn't matter that you are using
QTMovie
Bridger,
As far as I can tell there is nothing inherent in the CA API to do
what you want, however, KVC is available to you. When you create your
animation, do this:
[animation setValue:objectLayer forKey:@"parentLayer"];
Where objectLayer is the layer the animation is going to be run on.
If you are using a QCView, use this:
http://developer.apple.com/technotes/tn2005/tn2146.html
If you are using Core Animation (i.e. QCCompositionLayer), try this
blog post:
http://www.cimgf.com/2008/09/24/core-animation-tutorial-core-animation-and-quartz-composer-qccompositionlayer/
and this
tained it, it's been autoreleased
at that point.
hth,
-Matt
On Jan 8, 2009, at 12:10 AM, Bridger Maxwell wrote:
Hey,
Is the animation your own subclass of CAAnimation? I am justing using
CAKeyframeAnimation.
TTFN
Bridger
On Tue, Jan 6, 2009 at 1:45 PM, Matt Long long.com>wrote:
Bridger,
Dennis,
If any of your layers are autoreleased and not explicitly retained, if
you try to access them again, you will get a crash. Can you show us
what your functions such as updateRemovedSublayer look like (I'm
assuming that's yours)? If you are calling [CALayer setSublayers:nil]
and the
Inputs and Outputs in the root patch can be accessed with
@"path.patchname.value" where patchname is the name of the input or
output.
http://www.cocoabuilder.com/archive/message/cocoa/2008/12/27/226313
-Matt
On Jan 15, 2009, at 1:44 PM, Jonathan Selander wrote:
Does anybody have an idea o
Because you can't. These are the only properties you can animate:
http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/CoreAnimation_guide/Articles/AnimProps.html
-Matt
On Jan 16, 2009, at 10:46 AM, Adam Venturella wrote:
Basically, I was thinking: Hey, why can't I use CABasicAnimation
Yes. It's what they're made for. What are you trying to do?
-Matt
On Jan 16, 2009, at 11:23 AM, Adam Venturella wrote:
So something like this would be better served with an NSTimer I take
it?
On Fri, Jan 16, 2009 at 9:54 AM, Matt Long long.com> wrote:
Because you can
39 AM, Adam Venturella wrote:
Set the volume on an Audio Queue (make a fade out/fade in)
So on the interval, I will call:
AudioQueueSetParameter (queueObject, kAudioQueueParam_Volume, value );
Where value is 0-1
On Fri, Jan 16, 2009 at 10:34 AM, Matt Long > wrote:
Yes. It's what the
Joe,
Can you post some code? We can't really know what might be the cause
without it.
Thanks.
-Matt
On Jan 17, 2009, at 5:30 PM, Joe Wildish wrote:
I am sub-classing CALayer and experiencing some strange behaviour.
Sometimes the content of one of my sub-classes is blurred. I can't
fig
How very interesting...
I wanted to confirm this so I wrote a little code. Here's an image of
the results.
http://cimgf.com/files/BlurryLayer.png
And here's the Xcode project:
http://cimgf.com/files/BlurryLayer.zip
Thanks for pointing that out David.
-Matt
On Jan 19, 2009, at 11:21 AM,
You can add controls to your View in IB and then use a QTMovieLayer to
display your movie (assuming you are Leopard only). Just make sure
when you add the QTMovieLayer to your view's sub-layers that you use -
insertSublayer:atIndex passing it an index of zero. This will keep all
of the contr
I don't know for sure the answer to whether or not the Quartz Composer
filters are the same as what Core Image gives you, but I would bet
they are. Have you seen this reference?
http://developer.apple.com/DOCUMENTATION/GraphicsImaging/Reference/CoreImageFilterReference/Reference/reference.htm
Not sure what you mean by "capable of running tiger". If you have a
machine capable of running Leopard, it should be able to run tiger.
Someone correct me if I'm wrong as I haven't actually done this, but
can' t you simply get an external drive you connect through USB and
install tiger onto
It's not really clear what you are asking. Your final question is
"Does this sound correct?" to which I would respond, "yes". Though
earlier in the message you ask for advice on the "remaining parts".
It would help if you were to clarify what you mean. When you say "...a
miracle happens...(
Someone correct me if I'm wrong, but this is completely *on*-topic.
Core Animation, it's capabilities and limitations are very pertinent.
I don't know the answer to your question, but I certainly think it's
on-topic. I would like to know the answers you get, myself. Then
again, maybe you wa
Colin,
Not sure I completely understand that issue, but in a QTMovieLayer,
the movie is tied to the layer dimensions. If you resize the layer,
you resize the movie. The layer itself has a frame and a bounds
property. All you should need to do is grab [myMovieLayer bounds] or
[myMovieLayer
Colin,
My assumptions were totally wrong. It seems that once you set it to
maintain the aspect ratio with kCAGravityResizeAspect, it is simply
updating the contents as you pointed out, and there doesn't appear to
be any way to get the movie's display frame. Seems to me you will
probably h
Hey Steve,
Your call to setWantsLayer won't take effect until the next run loop.
So here is what happens (I think).
- First call to changeRightView:
- turns on layer backing for next run loop
- adds the animation (transition) for next run loop
- sets the delegate for t
Patrick,
I believe the only animatable properties are the ones explicitly
labeled "animatable" in the documentation. That is why (I believe)
there is a section labeled "Animatable Properties" in the Core
Animation Programming guide. I think the reason is that you can't
guarantee that your
Hey Jim,
I don't know much about NSAnimation as I haven't used it, however, I
can try to answer your three questions from a Core Animation standpoint.
1. If you want to know whether an animation is still running, just
check to see if it is still in the animations dictionary in the layer.
Look at overriding the layer transition. You can use a page curl
filter, if that's your desired effect, to transition changes to the
layer's content property.
- Create a CATransition object.
- Create a CIFilter that implements a page curl (Check out Apple's
Core Image Filters docs and sampl
Jeshua,
I put together a little demo app that works in the simulator. Haven't
tried on my device yet, though. Take a look here:
http://www.cimgf.com/files/ImageFlip.zip
And one comment about the code. If you don't want a transition between
images when using a keyframe animation for the co
Others have answered the question, but here's some code. Gotta love
code. ;-)
http://www.cimgf.com/2008/10/25/core-animation-tutorial-slider-based-layer-rotation/
-Matt
On Nov 4, 2008, at 5:30 PM, Michael A. Crawford wrote:
By default, positive angle values assigned to a rotation animation
You also need to set it to not remove the animation on completion.
[animation setRemovedOnCompletion:NO]
-Matt
On Nov 11, 2008, at 1:00 AM, Michael A. Crawford wrote:
I have a number of layers that use rotation animation about the Z-
axis. Whenever the animation(s) complete the layer returns
You need both of these lines when you create your animation:
[animation setRemovedOnCompletion:NO];
[animation setFillMode:kCAFillModeForwards];
Here is a related blog post:
http://www.cimgf.com/2008/10/25/core-animation-tutorial-slider-based-layer-rotation/
-Matt
On Nov 12, 2008, at 7:57 AM
90 degree rotated image.
Meanwhile I've placed an order on Amazon for ""Core Animation for Mac
OS X and the iPhone: Creating Compelling Dynamic User Interfaces" ;-)
Many thanks
2008/11/12 Matt Long <[EMAIL PROTECTED]>:
You need both of these l
I'll find a reference when I get a chance, but I recall reading
somewhere that what you're trying to do won't work. You will need to
use CAOpenGLLayer if you want to add sub-layers to it.
Just to test it, don't add the sub-layer and see if it shows up then.
If it doesn't then you may have o
Have you tried :
[CATransaction begin];
[CATransaction setValue:(id)kCFBooleanTrue
forKey:kCATransactionDisableActions];
// Your code here
[CATransaction commit];
See also:
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreAnimation_guide/Articles/Transactions.html
Ok. This is interesting. I wrote a little code to see what might be
going on.
Whatever was true when the AppKit release notes were published has
either changed or the term "supported" has a loose definition. Thanks
for pointing that out, Mike, but I don't think it's accurate or I've
misun
Got it. Thanks for the clarification.
-Matt
On Nov 23, 2008, at 6:29 AM, Michael Ash wrote:
On Sun, Nov 23, 2008 at 12:46 AM, Matt Long <[EMAIL PROTECTED]
> wrote:
Ok. This is interesting. I wrote a little code to see what might be
going
on.
Whatever was true when the AppKit r
You can use an NSXMLDocument:
NSString *webpageString = [[[NSString alloc] initWithContentsOfURL:@"http://www.google.com
"] autorelease];
NSError *error = nil;
NSXMLDocument *document = [[NSXMLDocument alloc]
initWithXMLString:webpageString
Core Animation using layers would make this simpler for you, I think.
You can still get the click from the layer backed view, but then add
your image to the view's layer tree as a layer. Animating a layer is
trivial in CA.
I did a blog post on how to animate a layer to the clicked point in
- Layers can have rounded rects by setting the layer's cornerRadius
property. BTW, you can't create layers in a NIB. The *must* be created
in code.
- Layers do not inherit from NSResponder so clicks (and double-clicks)
must be registered through a backing layer
- You can easily hide a view su
Gary,
I haven't used IKImageView, however, it does implement the
NSAnimatablePropertyContainer protocol:
http://developer.apple.com/documentation/Cocoa/Reference/NSAnimatablePropertyContainer_protocol/Introduction/Introduction.html#/
/apple_ref/occ/intf/NSAnimatablePropertyContainer
This m
e it should have been all that is needed, and it does not
work (in my case). I must be missing something.
Read the container doc... still not quite grokking - but getting
clearer. Part of my problem is relative newness to cocoa and still
battling lingo.
Gary
On Dec 1, 2008, at 7:57 PM,
You get the point from the view and then do a hitTest on the root
layer. It returns a pointer to the layer you clicked on.
http://developer.apple.com/DOCUMENTATION/GraphicsImaging/Reference/CALayer_class/Introduction/Introduction.html#/
/apple_ref/occ/instm/CALayer/hitTest:
-Matt
On Dec 3,
Jon,
I'm not sure I understand the whole problem here, but from your
initial message I put together a simple demo project that will take
the input value from a text field and use that as the path for an
NSImageView. It does it on the fly (e.g. as you type). Here is the
demo project:
htt
Try this: http://www.matthew-long.com/2007/11/09/xcode-30-tutorial/
Are you new to programming as well or just new to Cocoa/Objective-C?
-Matt
On Dec 4, 2008, at 4:25 PM, [EMAIL PROTECTED] wrote:
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple
It would appear that you are right. I took your code and plugged it
into an xcode project and found that the manager property is not being
observed. I knew that you couldn't use KVO for animatable properties
in a CALayer, but it appears that CALayers don't allow KVO at all. As
soon as I mad
A crash when trying to add your layer again after a call to
removeFromSuperlayer suggests that you're not retaining the layer and
it's been autoreleased. You either need to re-allocate each time or
retain it yourself. How are you allocating your CALayer inside of your
Layer object?
-Matt
Your layer's transform.scale knows nothing of the toValue in the
animation. You have to explicitly set it in the layer in addition to
animating it. This also means that you need to add the animation using
the correct keypath otherwise it will use the default animation
instead of yours. Chan
Ok. You've just raised the bar! ;-) Seems that you would have to
specify the key path you're wanting for each animation which leads me
to think you won't be able to use grouping as you envision as
setAnimations on the CAAnimationGroup only takes an array rather than
a dictionary in which yo
I'll address the issue with the animation ignoring your duration
first. Try placing your addAnimation call before the
setValue:forKeyPath. Let me know if that works. Also, you will *need*
to specify a fromValue in your animation. If you want the current
value (in the case where an animation
Use animation grouping. I you use groups, set beginTime with your
offset for each animation's time to start. The duration of each
animation must be the full duration of the entire animation put
together end to end. Your group animation should also have the same
duration. Here's some pseudo
ceforge.net/projects/xlinterpreter
On 21 Mar 2009, at 00:07, Matt Long wrote:
Use animation grouping. I you use groups, set beginTime with your
offset for each animation's time to start. The duration of each
animation must be the full duration of the entire animation put
together end to end. Yo
You could try creating your own CALayer derived class that overrides
- (void)drawInContext:(CGContextRef)ctx
drawLayer simply allows your delegate to override that same method
externally.
-Matt
On Feb 22, 2008, at 9:52 PM, Francois-Jean De Brienne wrote:
Hello everyone,
I'm a very new c
79 matches
Mail list logo