Understanding iOS Compiler Errors – Missing sentinel in method dispatch

Missing sentinel in method dispatch

You usually get this warning when you forget to put a nil at the end of your argument list
when calling methods such as NSArray’s
initWithObjects:

NSArray *choices = [[NSArray alloc]

                     initWithObjects:

                     @”Upper
Case”,

                     @”Lower
Case”,

                     @”Capitalized”];

 To correct this problem, just add a nil to the end of the list:

NSArray *choices = [[NSArray alloc]

                        initWithObjects:

                        @”Upper
Case”,

                        @”Lower
Case”,

                        @”Capitalized”,

                        nil];

For explanations of other compiler errors and warnings, check out our new book site: http://www.iOSAppsForEveryone.com

Kevin McNeish
Eight-time .NET MVP Recipient
Apple iOS Author, Trainer
http://www.iOSAppsForEveryone.com  FourBooks

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>