<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-371408380585915800.post6477759699030925020..comments</id><updated>2011-11-25T11:20:16.683-08:00</updated><category term='C++'/><category term='self promotion'/><category term='code management'/><category term='Lion'/><category term='UIKit'/><category term='CoreAudio'/><category term='Cocoa Touch'/><category term='Xcode'/><category term='fun hacks'/><category term='CoreGraphics'/><category term='Objective-C'/><category term='Standard C'/><category term='graphics'/><category term='performance tests'/><category term='Core Data'/><category term='Foundation'/><category term='object-oriented design'/><category term='testing'/><category term='numerical methods'/><category term='WebKit'/><category term='CoreAnimation'/><category term='Snow Leopard'/><category term='AppKit'/><title type='text'>Comments on Cocoa with Love: Variable argument lists in Cocoa</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://cocoawithlove.com/feeds/6477759699030925020/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default'/><link rel='alternate' type='text/html' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html'/><author><name>Matt Gallagher</name><uri>http://www.blogger.com/profile/12617910364694969282</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-371408380585915800.post-5436833705635290193</id><published>2011-11-25T11:20:16.684-08:00</published><updated>2011-11-25T11:20:16.684-08:00</updated><title type='text'>Been having difficulty getting this to support ARC...</title><content type='html'>Been having difficulty getting this to support ARC. Anyone been successful?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/5436833705635290193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/5436833705635290193'/><link rel='alternate' type='text/html' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html?showComment=1322248816684#c5436833705635290193' title=''/><author><name>Matt Gallagher</name><uri>http://www.blogger.com/profile/12617910364694969282</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html' ref='tag:blogger.com,1999:blog-371408380585915800.post-6477759699030925020' source='http://www.blogger.com/feeds/371408380585915800/posts/default/6477759699030925020' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-475684210'/></entry><entry><id>tag:blogger.com,1999:blog-371408380585915800.post-604545154383228350</id><published>2011-11-03T16:08:11.174-07:00</published><updated>2011-11-03T16:08:11.174-07:00</updated><title type='text'>Awesome articles, it was just what I was looking f...</title><content type='html'>Awesome articles, it was just what I was looking for.  I&amp;#39;ve used your technique to override the NSString class to allow for nillable formate args to remove that pesky &amp;quot;(null)&amp;quot; value from formatted strings.&lt;br /&gt;&lt;br /&gt;@implementation NSString(Extras)&lt;br /&gt;//&lt;br /&gt;+(NSString *)emptyString{&lt;br /&gt; &lt;br /&gt;    return @&amp;quot;&amp;quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//&lt;br /&gt;+(NSString *)stringWithNillableFormat:(NSString *)format, ...{&lt;br /&gt;  &lt;br /&gt;    va_list args;&lt;br /&gt;    va_start(args, format);&lt;br /&gt;    &lt;br /&gt;    NSString *formattedString = [[[NSString alloc] initWithFormat:format arguments:args] stringByReplacingOccurrencesOfString:@&amp;quot;(null)&amp;quot; &lt;br /&gt;                                                                                                                   withString:[NSString emptyString]];&lt;br /&gt;    va_end(args);&lt;br /&gt;    &lt;br /&gt;    return formattedString;&lt;br /&gt;}&lt;br /&gt;@end&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Great post!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/604545154383228350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/604545154383228350'/><link rel='alternate' type='text/html' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html?showComment=1320361691174#c604545154383228350' title=''/><author><name>Matt Gallagher</name><uri>http://www.blogger.com/profile/12617910364694969282</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html' ref='tag:blogger.com,1999:blog-371408380585915800.post-6477759699030925020' source='http://www.blogger.com/feeds/371408380585915800/posts/default/6477759699030925020' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-475684210'/></entry><entry><id>tag:blogger.com,1999:blog-371408380585915800.post-2711764243589014390</id><published>2011-11-03T07:08:58.659-07:00</published><updated>2011-11-03T07:08:58.659-07:00</updated><title type='text'>Perfect ... I wish more of Apple&amp;#39;s doc was to ...</title><content type='html'>Perfect ... I wish more of Apple&amp;#39;s doc was to the point as this was.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/2711764243589014390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/2711764243589014390'/><link rel='alternate' type='text/html' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html?showComment=1320329338659#c2711764243589014390' title=''/><author><name>Matt Gallagher</name><uri>http://www.blogger.com/profile/12617910364694969282</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html' ref='tag:blogger.com,1999:blog-371408380585915800.post-6477759699030925020' source='http://www.blogger.com/feeds/371408380585915800/posts/default/6477759699030925020' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-475684210'/></entry><entry><id>tag:blogger.com,1999:blog-371408380585915800.post-7583439469819219019</id><published>2011-09-26T13:05:49.872-07:00</published><updated>2011-09-26T13:05:49.872-07:00</updated><title type='text'>Best blog ever! Thank you for this great job!</title><content type='html'>Best blog ever! Thank you for this great job!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/7583439469819219019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/7583439469819219019'/><link rel='alternate' type='text/html' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html?showComment=1317067549872#c7583439469819219019' title=''/><author><name>Matt Gallagher</name><uri>http://www.blogger.com/profile/12617910364694969282</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html' ref='tag:blogger.com,1999:blog-371408380585915800.post-6477759699030925020' source='http://www.blogger.com/feeds/371408380585915800/posts/default/6477759699030925020' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-475684210'/></entry><entry><id>tag:blogger.com,1999:blog-371408380585915800.post-8408055110373337645</id><published>2011-06-15T13:24:00.558-07:00</published><updated>2011-06-15T13:24:00.558-07:00</updated><title type='text'>here&amp;#39;s my code for a UIAlertView subclass, whi...</title><content type='html'>here&amp;#39;s my code for a UIAlertView subclass, which is the same:&lt;br /&gt;&lt;br /&gt;- (id)initWithTitle:title &lt;br /&gt;            message:message &lt;br /&gt;           delegate:delegate &lt;br /&gt;  cancelButtonTitle:cancelButtonTitle &lt;br /&gt;  otherButtonTitles:otherButtonTitles, ...&lt;br /&gt;{&lt;br /&gt;  self = [super initWithTitle:title &lt;br /&gt;                      message:message &lt;br /&gt;                     delegate:delegate &lt;br /&gt;            cancelButtonTitle:cancelButtonTitle &lt;br /&gt;            otherButtonTitles:nil];&lt;br /&gt;  va_list args;&lt;br /&gt;  va_start(args, otherButtonTitles);&lt;br /&gt;  for (NSString *arg = otherButtonTitles; arg != nil; arg = va_arg(args, NSString*)) {&lt;br /&gt;    [self addButtonWithTitle:arg];&lt;br /&gt;  }&lt;br /&gt;  va_end(args);&lt;br /&gt;  // do something...&lt;br /&gt;  return self;&lt;br /&gt;}</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/8408055110373337645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/8408055110373337645'/><link rel='alternate' type='text/html' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html?showComment=1308169440558#c8408055110373337645' title=''/><author><name>Matt Gallagher</name><uri>http://www.blogger.com/profile/12617910364694969282</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html' ref='tag:blogger.com,1999:blog-371408380585915800.post-6477759699030925020' source='http://www.blogger.com/feeds/371408380585915800/posts/default/6477759699030925020' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-475684210'/></entry><entry><id>tag:blogger.com,1999:blog-371408380585915800.post-2412807388475107367</id><published>2011-06-10T10:56:36.373-07:00</published><updated>2011-06-10T10:56:36.373-07:00</updated><title type='text'>Thank you for the excellent tutorial!</title><content type='html'>Thank you for the excellent tutorial!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/2412807388475107367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/2412807388475107367'/><link rel='alternate' type='text/html' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html?showComment=1307728596373#c2412807388475107367' title=''/><author><name>Matt Gallagher</name><uri>http://www.blogger.com/profile/12617910364694969282</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html' ref='tag:blogger.com,1999:blog-371408380585915800.post-6477759699030925020' source='http://www.blogger.com/feeds/371408380585915800/posts/default/6477759699030925020' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-475684210'/></entry><entry><id>tag:blogger.com,1999:blog-371408380585915800.post-8661184636714270933</id><published>2011-05-26T10:43:50.000-07:00</published><updated>2011-05-26T10:43:50.000-07:00</updated><title type='text'>You probably can&amp;#39;t. Try to create nil button. ...</title><content type='html'>You probably can&amp;#39;t. Try to create nil button. And then add button manually.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/8661184636714270933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/8661184636714270933'/><link rel='alternate' type='text/html' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html?showComment=1306431830000#c8661184636714270933' title=''/><author><name>Matt Gallagher</name><uri>http://www.blogger.com/profile/12617910364694969282</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html' ref='tag:blogger.com,1999:blog-371408380585915800.post-6477759699030925020' source='http://www.blogger.com/feeds/371408380585915800/posts/default/6477759699030925020' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-475684210'/></entry><entry><id>tag:blogger.com,1999:blog-371408380585915800.post-7369585644550979645</id><published>2010-12-20T19:15:57.000-08:00</published><updated>2010-12-20T19:15:57.000-08:00</updated><title type='text'>Thanks for the excellent write up. I&amp;#39;m using i...</title><content type='html'>Thanks for the excellent write up. I&amp;#39;m using it in a debug logging class I&amp;#39;ve created and it works quite well.&lt;br /&gt;&lt;br /&gt;I haven&amp;#39;t been writing objective-c programs for too long, but the one thing about Apple that drives me crazy is how they seem to deprecate methods, without providing a good alternative. As of Snow Leopard, this has happened to the getObjects method, because it could cause buffer overruns. (They don&amp;#39;t trust app developers to make sure the buffer is large enough to hold the object pointers?)&lt;br /&gt;&lt;br /&gt;Dmitry Chestnykh: &amp;quot;Why is that? It&amp;#39;s a pointer, and pointers are 8 bytes on x86_64, be it NSString * or char * or whatever *.&amp;quot;&lt;br /&gt;&lt;br /&gt;I didn&amp;#39;t believe it myself, so I wrote a little test program (XCode 3.2.2 on 10.6.3) and, making sure it was compiling 64 bit, I ran the test which printed the sizes of (char *) (NSString *) and (char) to terminal. The results were, as expected, 8, 8 and 1 byte(s). I&amp;#39;m fairly new to Apple development, so perhaps before OS X had complete 64 bit support this may have been true? (Maybe 64 bit addressing was confined to call and jmp instructions while using 32 bits for data addressing?)&lt;br /&gt;&lt;br /&gt;Anyway, thanks for a great article!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/7369585644550979645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/7369585644550979645'/><link rel='alternate' type='text/html' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html?showComment=1292901357000#c7369585644550979645' title=''/><author><name>Matt Gallagher</name><uri>http://www.blogger.com/profile/12617910364694969282</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html' ref='tag:blogger.com,1999:blog-371408380585915800.post-6477759699030925020' source='http://www.blogger.com/feeds/371408380585915800/posts/default/6477759699030925020' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-475684210'/></entry><entry><id>tag:blogger.com,1999:blog-371408380585915800.post-3609879897740606724</id><published>2010-11-02T06:20:14.000-07:00</published><updated>2010-11-02T06:20:14.000-07:00</updated><title type='text'>Hello all,

I am trying to create a variable argum...</title><content type='html'>Hello all,&lt;br /&gt;&lt;br /&gt;I am trying to create a variable arguments list routine for NSString and then inside that routine pass that args to another routine that has a sentinel.  I created my routine with ... otherButtonsTitles:(NSString*)otherTitles, ... NS_REQUIRES_NIL_TERMINATION; in the declaration and then in the implementation ... otherButtonTitles:(NSString*)otherTitles, ... {&lt;br /&gt;&lt;br /&gt;va_list args;&lt;br /&gt;va_start(args, otherTitles);&lt;br /&gt;&lt;br /&gt;UIActionSheet* actionSheet = [[UIActionSheet alloc] initWithTitle:title&lt;br /&gt;                                                                               delegate:delegate&lt;br /&gt;                                                                               cancelButtonTitle:cancelTitle&lt;br /&gt;                                                                               destructiveTitle:nil&lt;br /&gt;                                                                               otherButtonTitles:args];&lt;br /&gt;va_end(args);&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;this routine complains that it needs a sentinel but I am passing in [@&amp;quot;Yes, @&amp;quot;No&amp;quot;, nil] to this routine.  And when I run it, it fails with EXEC_BAD_ACCESS.&lt;br /&gt;&lt;br /&gt;Any ideas as to why this doesn&amp;#39;t work?&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;&lt;br /&gt;Kenneth</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/3609879897740606724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/3609879897740606724'/><link rel='alternate' type='text/html' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html?showComment=1288704014000#c3609879897740606724' title=''/><author><name>Matt Gallagher</name><uri>http://www.blogger.com/profile/12617910364694969282</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html' ref='tag:blogger.com,1999:blog-371408380585915800.post-6477759699030925020' source='http://www.blogger.com/feeds/371408380585915800/posts/default/6477759699030925020' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-475684210'/></entry><entry><id>tag:blogger.com,1999:blog-371408380585915800.post-5143404897460726979</id><published>2010-05-20T07:46:00.000-07:00</published><updated>2010-05-20T07:46:00.000-07:00</updated><title type='text'>Thanks a lot.</title><content type='html'>Thanks a lot.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/5143404897460726979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/371408380585915800/6477759699030925020/comments/default/5143404897460726979'/><link rel='alternate' type='text/html' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html?showComment=1274366760000#c5143404897460726979' title=''/><author><name>Matt Gallagher</name><uri>http://www.blogger.com/profile/12617910364694969282</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://cocoawithlove.com/2009/05/variable-argument-lists-in-cocoa.html' ref='tag:blogger.com,1999:blog-371408380585915800.post-6477759699030925020' source='http://www.blogger.com/feeds/371408380585915800/posts/default/6477759699030925020' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-475684210'/></entry></feed>
