 |
 |
Another Cocoa Question
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: Texas
Status:
Offline
|
|
Ok I have another question that I cannot find an answer to. Hopefully it will be as easy as the last one. Anyways, in the program I am writing, I can run it in Project Builder, but when I try to run it outside of Project Builder, it always crashes... Maybe I have a setting set wrong or something but it is very frustrating.  Anyone have an answer? Thanks!
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: Texas
Status:
Offline
|
|
Well.. I fired up gdb and got the followin error:
2003-11-03 23:44:44.134 Program[4632] An uncaught exception was raised
2003-11-03 23:44:44.134 Program[4632] *** -[NSCFDictionary setObject:forKey:]: attempt to insert nil value
2003-11-03 23:44:44.135 Program[4632] *** Uncaught exception: <NSInvalidArgumentException> *** -[NSCFDictionary setObject:forKey:]: attempt to insert nil value
Know I know I am trying to insert a nil value somewhere... So, time to find it! If you have a suggestion, please let me know!
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Aug 2001
Status:
Offline
|
|
It *sounds* like the type of error you get when an object is being prematurely released. Try doing some research on NSZombie, I've found it to be very helpful for debugging memory problems.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: Texas
Status:
Offline
|
|
Ok, I found my error. However, now my program refuses to read a text file unless I run it in Project Builder... I call the file to open via C and scan through till I find what I need. Is there an easy way to do this in Objective-C?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2001
Status:
Offline
|
|
If this is what you're looking for:
Code:
NSString *fileContents = [NSString stringWithContentsOfFile:@"/ThePath/To/TheFile.txt"];
And then you could you NSScanner (or even simple NSString and NSArray methods), but if performance is important then maybe you could stick to C.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: Texas
Status:
Offline
|
|
Yeah i rewrote everything last night in Cocoa... It runs faster with less code now! Thanks!
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |