In the course of creating slides for my upcoming Animation in iOS talk, I’ve been re-running through relevant WWDC talks (and docs, and sample code, and Nathan Eror’s awesome CA360 project, anything I can get my hands on about CoreAnimation).
I came across a handy illustrative example of how to fade a layer in using an explicit CoreAnimation animation from the “Building Animation Driven Interfaces” talk. In practice, you wouldn’t really do this–it’s much easier to just use UIKit animations. But, it helps as a teaching exercise, so I wanted to include it in the sample code I plan to release for my talk.
CABasicAnimation *myAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
myAnimation.toValue = [NSNumber numberWithFloat:1.0];
myAnimation.duration = 2.0;
myAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
[myUIImageView.layer addAnimation:myAnimation forKey:@"myAnimation"];
This animation ran fine, with one wrinkle. CoreAnimation’s explicit animations do not change the underlying model object. They animate any changes in the presentation layer, but the underlying model is unchanged. Which means, when you are done with the animation, the model’s value is still the same. For the above code, that meant the nice fade-in of a UIImageView I just created disappeared (POOF!) as soon as the animation was done; the UIImageView’s layer still had an opacity of 0.0.
Read more »
I have been reading slowly through Apple’s excellent Core Data tutorial, and I noticed something funny–about $$$$ MONEY $$$$$!
In their Fetching Events example, they are querying salary data for employees. Now, this is a made-up example, but I thought it was interesting to look at the numbers. In Apple’s fake example, the male employee, Fred, makes the largest salary: $97,000. The second-highest goes to Juli, with $90,000. And bringing up the rear, is Tanya, who makes even less: $56,000.
Now, yes, this is a made-up example. And yes, there are only three made-up employees at that. But I found it interesting that even in a made-up example, the male employee made the most. I wonder if this says anything about salaries at Apple. Is this the subtle work of a disgruntled technical documentation writer? Is this a subconscious reflection of society as it is? WHO IS THIS FRED, ANYWAY?! TANYA, YOU NEED TO ASK FOR A RAISE!
The next time I write some technical documentation, my made-up employees with made-up salaries are going to read:
| Employee |
Salary |
| Ursula Ellis-Cooper |
$235,000 |
| John Smith |
$49,000 |
| Mellody Hobson |
A METRIC ASS TON OF MONEY |
I am hard at work on a vlog of my WWDC experience, including mini-interviews with six wonderful women from WWDC.
In the meantime, here are two pictures from our group photo. For the record, this is nowhere NEAR all the women at the conference. Just the most women we could rally together on short notice:


So you may have heard the recent rumor that Ballmer is supposed to take up 7 minutes onstage at WWDC. I’ve spent the morning asking myself what this could mean.
If VS 2010 supports developing iPhone/iPad apps, what dose that mean in terms of language? Will VS 2010 support Objective-C? Or will C# compile into binaries that can be run on iPhones? The latter blatantly violates what Apple stated in the iPhone Developer program:
“Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).”
So the only thing this COULD mean, if this is true, is that VS 2010 will support Objective-C, and load in all the Apple CocoaTouch frameworks, so you can develop in Objective-C and CocoaTouch, on a PC and in Visual Studio. This would mean Apple sees the future as mobile, and not Macs, but we knew that already when Apple announced the only design awards for WWDC 2010 would be given out to iPhone/iPad apps, not for Macs.
Through the course of my progress through the iPhone Developer’s Cookbook
, one thing is becoming increasingly clear to me: I did not understand fundamentals of Objective-C.
I really thought that my foundations in java, C#, and even C (thank you, Operating Systems with Jason Nieh) was enough. I breezed through lists of the differences, read some code, and I was done, thankyouverymuch. I even skimmed the “Objective-C bootcamp” section and deemed it irrelevant for me.
But with this challenge, I’ve promised myself to read every page of this book. And you know what? I really needed to RTFM. Why?
- I didn’t realize Objective-C is dynamically typed (even though I should have realized this with all the id variables floating around!)
- I didn’t know selectors were basically just another way of saying “method name”
- I didn’t know that if you do a child-to-parent assignment, like assigning an NSMutableArray to an NSArray, you’ll get the somewhat vague “assignment from distinct Objective-C” warning
- I didn’t know you should always check for if (!self) in your init methods because in case of memory warnings, [super init] can return nil
- I didn’t know that Apple has a standard on Class methods: any object returned by a class method is returned to you already autoreleased
It’s little things like these that can really trip me up. So far, the Erica/Alexis project is incredibly rewarding.
Filed in: Erica/Alexis project, apple, education, technology | am | April 20, 2010 | View Comments
Tags: erica sadun, Erica/Alexis project, ipad, iphone, objective, Objective-C basics, RTFM
I wrote this entire blog on my iPad. It took twice the time to get it on the web as it took me to write it, and edit all images, in Pages on the iPad.
No headphones? Really?
The lack of headphones seems unnecessarily cheap, and very un-Apple. I mean, they gave us free water and free Starbucks in the line to get this thing, but no headphones with your iPad? LAME.
Ipad keyboard
It feels a little awkward not to have the tactile response. The keyboard also feels a little bit cramped. I am definitely not spreading my fingers out as much as I normally do on a real keyboard. I am, however, doing my best to type as i do on a normal keyboard (not looking at the keys, left fingers placed on ASDF).
Read more »
Filed in: Reviews, apple, ipad, iphone, tech, technology | am | April 3, 2010 | View Comments
Tags: apple, ipad, ipad first impressions, ipad keyboard, ipad review, word press iPad, wordpress, wordpress ipad app review
I’m on page 58 of the second edition of Erica Sadun’s “iPhone Developer’s Cookbook
,” and here are the most important lessons I’ve learned so far:
- Zombies!
- What’s inside that XIB?
- The Clear Log Button
Zombies!
Did you know that, by default, your XCode project is NOT enabled to catch Zombies? And by zombies, I mean objects that you have released, but then subsequently try to access? THEY ARE ZOMBIES! They are the dead that still roam. This is good for horror films, but very bad for your code. But, by default, XCode’s debugger has no way to catch these nasties.
If you try and access a destroyed or released object, you’ll get back a cryptic objc_msgSend. But! If you ENABLE THE ZOMBIES as Sadun suggests, you’ll get back a much better message. In my case, I’m trying to access an array (via this call: CFShow([array self])) that I’ve already released. This gives me the following message in my gdb console:
2010-03-30 21:39:28.180 HelloWorld2[2398:207] *** -[CFArray self]: message sent to deallocated instance 0x1810260
Getting inside those .xib files
Read more »
Filed in: Erica/Alexis project, apple, education, iphone, programming, technology | am | March 30, 2010 | View Comments
Tags: akosma, apple, Clear Log button, erica sadun, iphone, nib2obj, NSZombieEnabled, zombies