Archive for the ‘iPhone/iPod Touch/iPad’ Category

Scroll views inside scroll view

Scroll views inside scroll view

Spark Inspector : Its flexibity

Ok.. Using Spark Inspector was very easy.

At first there was one odd thing : Where is the SparkInspector.framework?
It’s located in Spark Inspector app. However, if using its “Framework Setup assistant”, the app ingest frameworks to be linked for a chosen project for you.

One thing I didn’t like was that.. as most Cocoa programmers tend to set up a Xcode project, it puts framework setting in “target” Build Settings rather than “Project” Build Settings.

link settingIf you want to set those links as default for all targets you end up adding, the easier way is to put that setting in “project” Build Settings. I know that many Mac/iOS app developers who usually jumped into Mac/iOS app dev. after iOS became popular don’t understand the different necessity between the “Target” and “Project” Build Settings.
Anyway, this is not a big deal.

Now, let’s talk about cool things.

Spark Inspector app

As you can see from the above picture, your app runs on a simulator or an actual device while debugging, but the Spark Inspector app intercept that also and displays view hierarchy in list form on its left pane, visual representation of it in the middle pane, and finally, properties of chosen view/layers on the right-most pane. So, while you are debugging and interacting with a real device or a simulator, you can change colors, tints etc by choosing a layer/view on the Spark Inspector and changes some properties of them.
You don’t need to paint your layer/view in your code for debugging purpose anymore!
Isn’t that cool?

Also, the most important and useful feature of this app is the 3D display of those views and layers. When one view occludes an underlying view completely, and if there is some transition is applied to the underlying view ( unexpectedly ), you can still check what’s happening visually.

You can say that recursiveDescription is good enough. (It’s undocumented message of UIView )
However, when there are lots of view/layers, it can be very hard to identify which one is which when you use the message. However, this great helper tool for UI debugging eases debugging very easy.

After the PaintCode, I think this is a must-have tool for iOS developers!
I’ll buy it soon.

BTW, there is one little glitch there. As you can see, the right side of the right-most pane invades the right border of its super view. So, the content on the right-most pane goes beyond the right border.

What happened to Apple?

After lots of struggling at home yesterday with the sudden expiration of iOS 6.1 beta 4, now iTunes displays “Check Update” and “Restore iPhone…” buttons.

iTunes now displays "Check for Update" and "Restore iPhone..." buttons

iTunes now displays “Check for Update” and “Restore iPhone…” buttons

The iTunes didn’t display it yesterday, i.e. Jan. 27th, 2012 Pacific time.
Why it didn’t display those buttons yesterday?

Let’s point out a few things.
When a beta image was expired in previous versions ( I’m not just talking about iOS 6.x or 5.x. I have full experience with iOS since it’s beginning. ), they put some “allowance” or “cushion” days sufficiently. So, even though its following beta image was not installed, the old version was a live. If what I remember is right, in 3.x versions of iOS, I installed beta 2 and didn’t did so with beta 3 and after official public version was announced, I updated it to the public version. There was no problem in using the iPhone/iPod touch with the beta 2.
However, yesterday, my iPhone suddenly displayed “Activation Needed” message. I was mostly out of my home, so I didn’t know if new version was released on Jan. 26th, which was Saturday.
Then when I came back home, my iTunes didn’t display “Check for Update” and “Restore iPhone…” buttons. So, although I downloaded the latest beta image, I couldn’t update my phone. My iPhone just became bricked.

Who are leading Apple’s development and SQA teams nowadays? After iPhone got popular, I started to feel their quality of work degraded gradually. I understood that they lacked in their work force. I’ve heard that only finger-countable number of people worked on Xcode, while at MS about 250 people work on Visual Studio. I know that many good people in Mac OS X team wanted to move over to iPhone team. So, I expected such lower quality job. However, I believed Apple people. They will cease urgent fire and will be back to normal mode. However, it turned out they didn’t.
I file bugs to Apple’s bug report pages. Some are easily noticeable problems.
Even though some are beta, their internal SQA team should test things thoroughly and publish to developer community. The outside developers are not their SQA team. Although we test their S/W programs, the main focus is different. I’m not saying that their S/W programs should be perfect. They are also human. They can do mistake. However, I feel that their quality degraded seriously compared how they were before. Well, if we call it nicely, it’s social SQA.

I, personally, do three steps of testing of my own code.
While implementing, I frequently debug what I implemented to make sure if it works as I designed. Then when I finish implementation, I debug it to see if it works as a whole first, and do another test to see if it breaks any related features. Then I hand-over to SQA team.
So, there has been no bugs once they left my hands. I’m not saying that I’m always perfect. However, I at least try to ensure what I do. If there is only things I don’t test thoroughly although I implemented is some features of which designed behavior is not yet set by people who requested it. So, it’s kind of rough implementation to the point which can be ground for whatever they ask for the feature.
I don’t want to say some “great-sound” terminology like “Test-Driven Development”
Even we don’t use such term, that is common sense.

(Strangely, since 2000, people in this field just invent some nice-terminology to mean the same old thing. It looks to me that they try to impress other business background people or some S/W programmers who don’t have background in CS in a way that they know a lot or they are professionals. However, you know what? Although that can help office politics or impress during hiring process, actually those people who make things work are those who have those knowledge melted into their habit, so can’t even spend their time to learn those terminologies.)

Let’s look at what Apple announces. Xcode, Mac OS X, iOS.. they contain lots of bugs which are very easily visible.
Where are those Apple’s unique integrity, and perfectionism?
It’s not Steve Jobs they lost. It’s those integrity and perfectionism.

To simulate iPhone camera on your iOS simulator…

Although I didn’t test it yet ( I’ll do shortly ), this project looks very interesting.
I know iOS 5 simulator is not worth while to trying at all. Screen rotation, applying CGAffineTransform etc blah blah don’t work on iOS 5 simulator as it does on a real device. Sometimes the buggy iOS 5 simulator works more correctly for certain features than real iOS 5 devices.

Now even with iOS 6, it can be handy to test your code with a simulator without hooking up your iPhone.

So, let’s try this to see how far it can go!
UIImagePickerController-SimulatedCamera from the holly GitHub!

NOTE : Currently it doesn’t work.

Views of UIImagePickerController

Here is very good article on “How UIImagePickerController is composed of”.

How to create your own UIImagePickerController

It’s explained here…

Cloning UIImagePickerController using the Assets Library Framework

iOS rotation and view dimension

Please read my comment in the following screenshot.
You will be able to see it in its full resolution.

Screen rotation and the dimension of a view

Don’t try to readjust the dimension of a view when rotated. The underlying coordinate system will do it for you.
Just think it like it’s in Portrait mode.

In the original source code, the developer didn’t understand rotation mechanism, and forcefully rotated views here and there and it caused lots of mess and broke the state maintained in underlying system.

When I have a chance, I would like to talk about this problem in iOS 5. Also it was part of Apple’s responsibility, which looks to be solved in iOS 6.

%d bloggers like this: