Amazon.com Widgets Chapter 16 Program 7 SIGABRT error
Welcome, Guest. Please login or register.
Did you miss your activation email?
June 17, 2013, 11:45:17 PM
Home Help Search chat Login Register   
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+  Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+  Programming in Objective-C, 4th edition
| |-+  Chapter 16
| | |-+  Chapter 16 Program 7 SIGABRT error
Pages: [1]   Go Down
Print
Author Topic: Chapter 16 Program 7 SIGABRT error  (Read 595 times)
randomrat
Newbie
*
Posts: 1


Email




« on: August 02, 2012, 06:21:36 PM »

Hi everyone,

I am always very reluctant to posting new topics in forums in case I get in trouble for not following rules or something, but this time I really am confused even after googling! I am very new to the Objective C programming language!

I have written out Kochan's example program 16.7 from the book and Xcode has produced an error on the "[outFile truncateFileAtOffset: 0];" line. In a green little box (while running the code) comes "Thread 1: Signal SIGABRT".

Here is the error description listed in the output box:

Code: (Objective-C)
2012-08-02 19:55:58.441 prog 16.7[1460:303] *** Terminating app due to uncaught exception 'NSFileHandleOperationException', reason: '*** -[NSConcreteFileHandle truncateFileAtOffset:]: Invalid argument'
*** First throw call stack:
(
0   CoreFoundation                      0x00007fff8e9d6716 __exceptionPreprocess + 198
1   libobjc.A.dylib                     0x00007fff8fda0470 objc_exception_throw + 43
2   CoreFoundation                      0x00007fff8e9d64ec +[NSException raise:format:] + 204
3   prog 16.7                           0x0000000100001b4e main + 414
4   prog 16.7                           0x00000001000019a4 start + 52
5   ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminate called throwing an exception
(lldb)

I honestly don't understand why this error is showing up. 0 should be a valid argument for truncateFileAtOffset:, right?. Nobody else has mentioned this issue so it clearly must be me being stupid or something. And if I'm not being too cheeky saying this, I have a similar-ish problem in prog 16.8 too (I haven't gone any further in the book)...But I'll wait for a response about the question at hand first...

I have attached the main code to this post just if needed. I am running Xcode 4.4 on Mountain Lion (I have tried this program before upgrading to ML).

I would like to say that this book is absolutely fantastic and it has been very very well written! Smiley
Thanks for your time reading this post!
Logged
Pages: [1]   Go Up
Print
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.