Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-09-2010, 04:47 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 1
Sureway is on a distinguished road
Default Can someone please help!

When I build and go, I get no errors and the app launches in the simulator. As soon as it completes launch, it terminates. I get this "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MainView initWithCoder:]" How do I fix this?
Sureway is offline   Reply With Quote
Old 08-09-2010, 06:45 PM   #2 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Step 1 - Search for the error message in your code. Are you doing initWithCoder: anywhere? If so, start in that general area for debugging.

Step 2 - If that doesn't turn anything up, start looking at uses of MainView that might relate to #1. init, load, etc.

Step 3 - (arguably Step 1) Start adding log messages to figure out where it dies.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 08-09-2010, 07:57 PM   #3 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by Sureway View Post
When I build and go, I get no errors and the app launches in the simulator. As soon as it completes launch, it terminates. I get this "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MainView initWithCoder:]" How do I fix this?

The initWithCoder method is the method that is called to create an object from a nibfile.

It sounds like you have a custom class MainView, that is being created from a nibfile. There must be something wrong with the way the object is loaded from the nibfile. Look closely at your nib, checking for references to objects who's types aren't defined, etc.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 08-09-2010, 10:17 PM   #4 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Ypsilanti, Michigan
Age: 63
Posts: 1,549
RLScott is on a distinguished road
Default

Quote:
Originally Posted by Sureway View Post
When I build and go, I get no errors and the app launches in the simulator. As soon as it completes launch, it terminates. I get this "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MainView initWithCoder:]" How do I fix this?
I think that is the error I get when I delete or change an IBOutlet after it has already been hooked to an object in Interface Builder. Go into IB and check all your connections to see if any of them are to IBOutlet names that no longer exist in the code.
RLScott is offline   Reply With Quote
Old 08-09-2010, 10:38 PM   #5 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 27
abhimanipal is on a distinguished road
Default

Do you get any errors when you build ?
abhimanipal is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
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
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 320
8 members and 312 guests
ilmman, iram91419, linkmx, nadav@webtview.com, Objective Zero, Paul Slocum, stanny, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,656
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, iram91419
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:40 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0