Skip to content

iPhone SDK – __forwarding__ (Error Message)

June 13, 2010

And again, the iPhone finds amazingly cheap ways to report an error message and crash your app. When you’re working in Cocoa Touch, all you gotta remember is MEMORY MANAGEMENT, MEMORY MANAGEMENT, MEMORY MANAGEMENT.

Remember that whenever you are trying to set a variable, especially an instance variable, you MUST either use alloc somewhere in your declaration, or you must retain/copy the data within the variable, to ensure that data belongs to that variable rather than the original object (if that makes sense).

Also, if there is NO alloc, retain, or copy in your variable declarations, you will not be able to release that variable (it will be autoreleased without you knowing), ultimately leading in some very ‘sticky’ memory leaks later on.

I have found that simple problems like these will trip the iPhone OS into an error that eventually leads to the termination of your application, so always ensure that your variables’ data rightfully belong to your variables.

Thank you for reading my blog! 🙂

Advertisements

From → regular

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: