Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old May 10, 2011, 12:48 PM   #1
teguh123
macrumors member
 
Join Date: Mar 2011
Breaking Conditionally

A variable shouldn't be nil. Say it's nil. How do I break the program when it's nil?

Debug assert? Objective c?
__________________
How to Learn Math
teguh123 is offline   0 Reply With Quote
Old May 10, 2011, 01:00 PM   #2
chown33
macrumors 603
 
Join Date: Aug 2009
C assertions should work.
http://developer.apple.com/library/i.../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/ns...dered-harmful/

Last edited by chown33; May 10, 2011 at 01:07 PM.
chown33 is offline   0 Reply With Quote
Old May 10, 2011, 01:22 PM   #3
PhoneyDeveloper
macrumors 68020
 
PhoneyDeveloper's Avatar
 
Join Date: Sep 2008
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.
PhoneyDeveloper is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Where on earth the 4S Jail Break? billy3785 Jailbreaks and iOS Hacks 49 Oct 20, 2011 09:57 AM
Getting university discount with CONDITIONAL offer (UK) spoccka Buying Tips and Advice 10 Jun 30, 2011 03:03 PM
Obj-C: breaking out of loops and conditionals GregX999 Mac Programming 14 May 10, 2009 01:39 PM


All times are GMT -5. The time now is 06:25 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC