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 online now   0 Reply With Quote
Old May 10, 2011, 01:22 PM   #3
PhoneyDeveloper
macrumors 68030
 
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

Similar Threads
thread Thread Starter Forum Replies Last Post
Breaking point cube Mac Peripherals 1 Mar 23, 2014 04:16 PM
MagSafe Keeps Breaking sober2ndthought MacBook Pro 31 Jan 5, 2014 08:14 AM
Jail Breaking EarthMLG Jailbreaks and iOS Hacks 21 Feb 8, 2013 06:09 AM
Base model iPhone + base model iPad mini = conditionally, very smart cperry2 iPad 0 Oct 25, 2012 06:33 PM

Forum Jump

All times are GMT -5. The time now is 06:05 PM.

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

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