T teguh123 macrumors member Original poster Mar 22, 2011 62 0 May 10, 2011 #1 A variable shouldn't be nil. Say it's nil. How do I break the program when it's nil? Debug assert? Objective c?
A variable shouldn't be nil. Say it's nil. How do I break the program when it's nil? Debug assert? Objective c?
chown33 Moderator Staff member Aug 9, 2009 11,450 9,681 A sea of green May 10, 2011 #2 C assertions should work. http://developer.apple.com/library/...nceptual/ManPages_iPhoneOS/man3/assert.3.html Also look up NSAssert. FWIW, google search terms: ios assert site:developer.apple.com And see this: http://vgable.com/blog/2008/12/04/nsassert-considered-harmful/ Last edited: May 10, 2011
C assertions should work. http://developer.apple.com/library/...nceptual/ManPages_iPhoneOS/man3/assert.3.html Also look up NSAssert. FWIW, google search terms: ios assert site:developer.apple.com And see this: http://vgable.com/blog/2008/12/04/nsassert-considered-harmful/
PhoneyDeveloper macrumors 68040 Sep 2, 2008 3,114 93 May 10, 2011 #3 I don't believe that the issue mentioned in the "NSAssert considered harmful" blog post applies on iOS. It does, kind of, on MacOS X. I use NSAssert in both Mac and iOS code and it works as expected. I believe this is what OP should use.
I don't believe that the issue mentioned in the "NSAssert considered harmful" blog post applies on iOS. It does, kind of, on MacOS X. I use NSAssert in both Mac and iOS code and it works as expected. I believe this is what OP should use.