For any iPhone or iPad developer the official Apple documentation is a fundamental tool in development. While the documentation is not very easy for beginners to use (it rarely has examples) it is thorough and precise. Because of how much developers rely on the documentation it is very important that they get it right. So it really bothers me when there are mistakes. I reported them to app using the Apple bug reporter, and the three I submitted in January have already been fix. One more I submitted in February is still unfixed.
Something that bothered me is that Apple did not mark the bugs as resolved and did not update the change logs to indicate that there were any changes. So you are just going to have to take my word for it that these mistakes where there.
Spelling mistake in SKRequestDelegate documentation
In the SKRequestDelegate documentation the header for the section 'Handling Errors' read 'Handling Errrors', with the extra 'r'. It was a bit ironic.
Mistaking an enumerated type for a BOOL
UITableView has a bunch of functions for modifying the tableview, such as adding, removing and reloading cell. For all of these there is an enumerated type of what kind of animation you want to you (fade, push from left, push form top etc). In the UITableview documentation for - (void)deleteSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation
it did state that the row animation was a BOOL not an enumerated type. This was already pointed out on stackoverflow (here) in June 2011, but it wasn't fit until Feb 2012 after I submitted the bug report.
iOS documentation confuses a path for a URL
I know that I am being really pedantic, but this one bothered me a little. I (like most iOS developers) has some trouble at first with the difference between a path (a kind of NSString) and a url (and kind of NSURL). So when the documentation confuses them it can be really tough for a new programmer. In NSFileManager there are two very similar functions:
- (BOOL)removeItemAtPath:(NSString *)path error:(NSError **)error
and
- (BOOL)removeItemAtURL:(NSURL *)URL error:(NSError **)error
for the path one it used to state:
"Return value: YES if the item was removed successfully or if URL was nil." - which is confusing since there is no URL there is only a path. Seems like it was a copy-paste mistake. Thankfully they fixed it, and they even added italics to the words 'URL' and 'path'.
Misnamed variable in Programming Guide
In the programing guid to PDF there is some sample code called "Open the PDF Document". This is the code that Apple posted
CGPDFDocumentRef myDocument;
myDocument = CGPDFDocumentCreateWithURL(url);// 1
if (myDocument == NULL) {// 2
error ("can't open `%s'.", filename);
CFRelease (url);
return EXIT_FAILURE;
}
CFRelease (url);
if (CGPDFDocumentIsEncrypted (myDocument)) {// 3
if (!CGPDFDocumentUnlockWithPassword (myDocument, "")) {
printf ("Enter password: ");
fflush (stdout);
password = fgets(buffer, sizeof(buffer), stdin);
if (password != NULL) {
buffer[strlen(buffer) - 1] = '';
if (!CGPDFDocumentUnlockWithPassword (myDocument, password))
error("invalid password.");
}
}
}
if (!CGPDFDocumentIsUnlocked (myDocument)) {// 4
error("can't unlock `%s'.", filename);
CGPDFDocumentRelease(myDocument);
return EXIT_FAILURE;
}
}
if (CGPDFDocumentGetNumberOfPages(document) == 0) {// 5
CGPDFDocumentRelease(document);
return EXIT_FAILURE;
}
Did you catch it?. The last check uses of the variable "document" when the rest of the code used "mydocument". This is the only one of the four which is still not fixed.
The lesson here is that Apple bug reporter works, but don't expect any feedback or a thank you, or even a notice in the change log.