BuySellAds.com

Until Dec 3rd, 44% off all Manning books, including Barcodes with iOS! Promo code: mobicftw
Our DNA is written in Objective-C
Jump

Category Archive for ‘Bug Reports’ rss

Radar: CGRectMakeWithDictionaryRepresentation

This is one of those rare jewels of a bug that will cost you days to figure out if you encounter it in the context of a large app. It makes you doubt our own sanity until you come to the painful conclusion that the problem indeed resides in Apple’s code, not yours.

In this special case we had a couple of rare circumstances that worked together to form a scenario where CGRectMakeWithDictionaryRepresentation partially fails to reconstitute a CGRect from a dictionary. This function is literally ancient, it exists since iOS 2 and Mac OS 10.5. This makes it even more implausible that nobody has stumbled across this before us.

In the project where we first saw the problem these where the steps that led to this bug’s discovery:

  1. Create a CGRect that is not an integer
  2. Write a dictionary from iOS simulator which contains a dictionary encoding this CGRect
  3. Open this dictionary in Xcode’s property list editor
  4. Upon saving some of the least significant digits change in the “real” items
  5. This new dictionary can no longer be parsed on iOS

What’s even funnier is that some such modified values can still be read, but then the function fails internally and the remaining values don’t get parsed, i.e. stay zero.

From what I have seen researching this bug looks like certain floating point numbers cannot be represented on iOS. The normal parsing functions are able to round to the closest value that can be represented in 32-bit floats, whereas CGRectMakeWithDictionaryRepresentation fails to do so. The first value that cannot be exactly represented is truncated, all following values turn out to be Zero.

This was filed as rdar://12358120 and on OpenRadar.

Read more

Radar: Scroll Direction setting linked for Mouse and Trackpad

It is understandable to have this ominous “Natural Scrolling” setting for trackpads. And that there is a separate such setting for mice. But I don’t understand why Apple would like these two settings, because somebody working on a laptop might want to use the normal way to scroll with his mouse’s scroll while while using the “natural” setting for his trackpad.

Filed as Radar #12236447 and cross-posted on OpenRadar.

Updated March 6th, 2013: “Works as Intended”

Read more

Radar: AirPlay broken if only connected display is VNC

I got an AppleTV for our office and brought over my old Sharp TV which is able to display 720p well enough to be used as a presentation display via AirPlay. When I tried to use AirPlay to display the desktop of a MacMini server I discovered this bug.

The workaround at the moment is to use the AirParrot software which has no problems displaying the desktop. I filed it as rdar://12167290  and mirrored it on OpenRadar.

Update Nov 7th: Apple closed the bug report as a duplicate of rdar://11782381.

Read more

Radar: Allow Overriding of User-Agent on UIWebView

Here’s another thing that I had discussed with an Apple engineer at WWDC. UIWebView at present does let you easily modify the user-agent header field that it sends to the server. We found this functionality sorely lacking when we needed to change the user-agent in iCatalog. There are some scenarios where the server-side browser-detection fails and you want to override the user agent for example with one to pretend the web view is desktop Safari.

This feature request was filed as rdar://11767306  and on OpenRadar.

Read more

Radar: Filevault2 uses incorrect keyboard layout for initial unlock

Fresh from our series “Another Day Another Radar” here’s one that stumped my associate Rene.

Since I’m getting a knack in filing these I did the “quick file” for him, as rdar://11738458 and on OpenRadar. As always I am doing this publicly because other people out there might have experienced the same issue which can be quite nerve-wrecking. Also this problem was observed on an OS X version that is public and widely used.

Read more

Radar: ARC releases UIColor prematurely

There’s a gotcha/bug if you’re using -[UIColor CGColor] to get a CGColorRef for use with CoreGraphics. I think several people have already documented this on their blogs, but I was having the same issue in my DTCalendarView when running it on device. The same code worked before enabling ARC, but with ARC enabled it there is a difference whether its running on device or simulator.

On Simulator all is fine. On device however you get a EXC_BAD_ACCESS because the ARC release the UIColor way before the end of the current scope. There are several possible workarounds but it is still unintuitive that previously working code ceases working with ARC.

We were told to also file bug reports for unexpected behaviors or something that is counter intuitive, so here you go… Radar #11717864 and OpenRadar. Here’s the sample project.

Update: Yes, I know that you could call this “works as designed”. But the point here is that it is non-obvious and causes previously working code to break. Even the gurus at the Big Nerd Ranch stumbled over this one and filed is filed. In the least I would expect an LLVM compiler warning for this to be added.

Read more

Radar: App- and Folder-specific Passcode Locks

I’m on fire!

Never before have I filed so many Radars in a single day. This one aims to remove the need for components like my DTPinLockController which I used in iWoman.

This is a Feature Request for getting passcode locks on a per app and per folder basis. So that you can hand your unlocked device to your kids for playing Games but still apps being secure that they have no business in starting. This would passcode-enable all apps that don’t have custom solutions and also make all those custom-passcode-viewcontrollers unnecessary.

If there where an API for inquiring about passcode status then we could keep the user logged in just like the Find my Friends app is doing it. This requires entering the password only if you don’t have a passcode lock set.

I filed this as Radar #11716971 and also posted it to OpenRadars. Please dupe it if you think that this is a useful feature for our favorite platform.

Read more

Radar: WWDC videos should be organized as iTunes U courses

The third kind of Radars I plan to file more are for new features. While the Apple bug reporter is mostly made for reporting and tracking bugs this is also the only way to formally file a feature request. This one relates to WWDC videos and iTunes U.

I am suggesting here to organize the WWDC videos similar to the Stanford CS193P course where you have all the videos and materials aggregated together and can keep track of your progress (“gotta watch ‘em all”) independently of whether you have downloaded a video or not.

This was filed as Radar #11716509 and also posted on OpenRadar.

Read more

Radar: Block-based action handlers for UIActionSheet and UIAlertView

The second type of Radar I vowed to be filing more of following WWDC 2012 are so called “Enhancement Requests”. I have yet to see any of my previously filed requests be implemented in iOS, but it never hurts. One Apple representative once told me that “we’ll implement it if enough people want it”.

I recently demonstrated in a tutorial how to add block-support to UIActionSheet. Now here’s the formal feature request suggesting to Apple to implement this in the official SDK.

The following is filed as Radar #11695432 and also added to OpenRadar.

Read more

Radar: View frame inconsistency using presentViewController + wantsFullScreenLayout Y/N

One of the takeaways from WWDC should always be a renewed promise to yourself and Apple engineers: “File better Radars”. With some time at my hands jettting back over the Atlantic Ocean, I prepared a demo project and the text for my latest filing.

Read more