Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8943221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:43:14+00:00 2026-06-15T11:43:14+00:00

Here is my code: .h NSMutableString *buffer, *tmpBuffer; int status; // 0=waiting for <DMX>,

  • 0

Here is my code:

.h

NSMutableString *buffer, *tmpBuffer;
int status; // 0=waiting for <DMX>, 1=recording

.m

 - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    buffer = [[NSMutableString alloc] init];
    tmpBuffer = [[NSMutableString alloc] init];
    status = 0;
}

- (void) receivedData:(NSString *)data {

        // status=0 means we are still looking for start tag
        if(status == 0) {
            // add new data to last examined chunk (if any)
            [tmpBuffer appendString:data];

            // try to locate the open tag inside the tmpBuffer
            NSRange range = [tmpBuffer rangeOfString:@"<DMX>" options:NSCaseInsensitiveSearch];

            // if found, store the portion after the start tag into buffer
            if(range.location != NSNotFound) {
                range.length = [tmpBuffer length] - range.location + 5; // 5 is length of start tag...
                [buffer setString:[tmpBuffer substringWithRange:range]];
                status = 1; // set status to 1 so we know recording started
            } else {
                // store last examined chunk
                [tmpBuffer setString:data];
            }
        } else {
            [buffer appendString:data];
            NSRange range = [buffer rangeOfString:@"</DMX>" options:NSCaseInsensitiveSearch];
            if(range.location != NSNotFound) {
                range.length = [buffer length] - range.location;

                [self fullDMXReceived:buffer];

                [buffer deleteCharactersInRange:range];
                status = 0;
            }
        }
    }

    - (void) fullDMXReceived:(NSString*)finalData {
        NSRunAlertPanel(@"", finalData, @"", @"", @"");
    }

Here is the error:

2012-12-02 14:39:00.356 Chatty Mac[1805:303] *** Assertion failure in -[NSTextFieldCell _objectValue:forString:errorDescription:], /SourceCache/AppKit/AppKit-1187.34/AppKit.subproj/NSCell.m:1532
2012-12-02 14:39:00.362 Chatty Mac[1805:303] An uncaught exception was raised
2012-12-02 14:39:00.367 Chatty Mac[1805:303] Invalid parameter not satisfying: aString != nil
2012-12-02 14:39:00.374 Chatty Mac[1805:303] (
    0   CoreFoundation                      0x00007fff93e350a6 __exceptionPreprocess + 198
    1   libobjc.A.dylib                     0x00007fff8f52e3f0 objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff93e34ee8 +[NSException raise:format:arguments:] + 104
    3   Foundation                          0x00007fff933fe6a2 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 189
    4   AppKit                              0x00007fff92660205 -[NSCell _objectValue:forString:errorDescription:] + 159
    5   AppKit                              0x00007fff9266015f -[NSCell _objectValue:forString:] + 20
    6   AppKit                              0x00007fff926600db -[NSCell setStringValue:] + 39
    7   AppKit                              0x00007fff926f43fc -[NSControl setStringValue:] + 138
    8   AppKit                              0x00007fff928c2ba8 -[NSAlert buildAlertStyle:title:formattedMsg:first:second:third:oldStyle:] + 7479
    9   AppKit                              0x00007fff928c478b _NXDoLocalRunAlertPanel + 343
    10  AppKit                              0x00007fff928c461c NSRunAlertPanel + 157
    11  Chatty Mac                          0x00000001000070bd -[AppDelegate fullDMXReceived:] + 61
    12  Chatty Mac                          0x0000000100007036 -[AppDelegate receivedData:] + 582
    13  Chatty Mac                          0x000000010000e751 -[ORSSerialPortDemoController serialPort:didReceiveData:] + 401
    14  Chatty Mac                          0x000000010000a6fa -[ORSSerialPort receiveData:] + 170
    15  Chatty Mac                          0x0000000100009676 __block_global_1 + 38
    16  libdispatch.dylib                   0x00007fff9637bf01 _dispatch_call_block_and_release + 15
    17  libdispatch.dylib                   0x00007fff963780b6 _dispatch_client_callout + 8
    18  libdispatch.dylib                   0x00007fff9637d0c8 _dispatch_main_queue_callback_4CF + 275
    19  CoreFoundation                      0x00007fff93dd70fe __CFRunLoopRun + 1614
    20  CoreFoundation                      0x00007fff93dd66b2 CFRunLoopRunSpecific + 290
    21  HIToolbox                           0x00007fff949130a4 RunCurrentEventLoopInMode + 209
    22  HIToolbox                           0x00007fff94912e42 ReceiveNextEventCommon + 356
    23  HIToolbox                           0x00007fff94912cd3 BlockUntilNextEventMatchingListInMode + 62
    24  AppKit                              0x00007fff92682613 _DPSNextEvent + 685
    25  AppKit                              0x00007fff92681ed2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
    26  AppKit                              0x00007fff92679283 -[NSApplication run] + 517
    27  AppKit                              0x00007fff9261dcb6 NSApplicationMain + 869
    28  Chatty Mac                          0x00000001000056d2 main + 34
    29  Chatty Mac                          0x0000000100001da4 start + 52
    30  ???                                 0x0000000000000003 0x0 + 3
)
2012-12-02 14:39:00.475 Chatty Mac[1805:303] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: aString != nil'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff93e350a6 __exceptionPreprocess + 198
    1   libobjc.A.dylib                     0x00007fff8f52e3f0 objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff93e34ee8 +[NSException raise:format:arguments:] + 104
    3   Foundation                          0x00007fff933fe6a2 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 189
    4   AppKit                              0x00007fff92660205 -[NSCell _objectValue:forString:errorDescription:] + 159
    5   AppKit                              0x00007fff9266015f -[NSCell _objectValue:forString:] + 20
    6   AppKit                              0x00007fff926600db -[NSCell setStringValue:] + 39
    7   AppKit                              0x00007fff926f43fc -[NSControl setStringValue:] + 138
    8   AppKit                              0x00007fff928c2ba8 -[NSAlert buildAlertStyle:title:formattedMsg:first:second:third:oldStyle:] + 7479
    9   AppKit                              0x00007fff928c478b _NXDoLocalRunAlertPanel + 343
    10  AppKit                              0x00007fff928c461c NSRunAlertPanel + 157
    11  Chatty Mac                          0x00000001000070bd -[AppDelegate fullDMXReceived:] + 61
    12  Chatty Mac                          0x0000000100007036 -[AppDelegate receivedData:] + 582
    13  Chatty Mac                          0x000000010000e751 -[ORSSerialPortDemoController serialPort:didReceiveData:] + 401
    14  Chatty Mac                          0x000000010000a6fa -[ORSSerialPort receiveData:] + 170
    15  Chatty Mac                          0x0000000100009676 __block_global_1 + 38
    16  libdispatch.dylib                   0x00007fff9637bf01 _dispatch_call_block_and_release + 15
    17  libdispatch.dylib                   0x00007fff963780b6 _dispatch_client_callout + 8
    18  libdispatch.dylib                   0x00007fff9637d0c8 _dispatch_main_queue_callback_4CF + 275
    19  CoreFoundation                      0x00007fff93dd70fe __CFRunLoopRun + 1614
    20  CoreFoundation                      0x00007fff93dd66b2 CFRunLoopRunSpecific + 290
    21  HIToolbox                           0x00007fff949130a4 RunCurrentEventLoopInMode + 209
    22  HIToolbox                           0x00007fff94912e42 ReceiveNextEventCommon + 356
    23  HIToolbox                           0x00007fff94912cd3 BlockUntilNextEventMatchingListInMode + 62
    24  AppKit                              0x00007fff92682613 _DPSNextEvent + 685
    25  AppKit                              0x00007fff92681ed2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
    26  AppKit                              0x00007fff92679283 -[NSApplication run] + 517
    27  AppKit                              0x00007fff9261dcb6 NSApplicationMain + 869
    28  Chatty Mac                          0x00000001000056d2 main + 34
    29  Chatty Mac                          0x0000000100001da4 start + 52
    30  ???                                 0x0000000000000003 0x0 + 3
)
libc++abi.dylib: terminate called throwing an exception
(lldb) 

It’s happening where [self fullDMXReceived:buffer]; is called because when I remove it, it doesn’t crash.

What’s happening here? Can anyone decode this error?

FYI, I’m calling receivedData from another class like this: AppDelegate *theAppDelegate = [[AppDelegate alloc] init]; [theAppDelegate receivedData:string]; Could this be a problem?

When I run AppDelegate *theAppDelegate = (AppDelegate *)[[NSApplication sharedApplication] delegate];

I get this error message:

2012-12-03 06:00:12.791 Chatty Mac[1580:303] An uncaught exception was raised
2012-12-03 06:00:12.793 Chatty Mac[1580:303] -[__NSCFString substringWithRange:]: Range or index out of bounds
2012-12-03 06:00:12.797 Chatty Mac[1580:303] (
0   CoreFoundation                      0x00007fff8d0ee0a6 __exceptionPreprocess + 198
1   libobjc.A.dylib                     0x00007fff887e73f0 objc_exception_throw + 43
2   CoreFoundation                      0x00007fff8d0ede7c +[NSException raise:format:] + 204
3   CoreFoundation                      0x00007fff8d0c555d -[__NSCFString substringWithRange:] + 109
4   Chatty Mac                          0x0000000100006ecb -[AppDelegate receivedData:] + 283
5   Chatty Mac                          0x000000010000e772 -[ORSSerialPortDemoController serialPort:didReceiveData:] + 466
6   Chatty Mac                          0x000000010000a6ba -[ORSSerialPort receiveData:] + 170
7   Chatty Mac                          0x0000000100009636 __block_global_1 + 38
8   libdispatch.dylib                   0x00007fff8f634f01 _dispatch_call_block_and_release + 15
9   libdispatch.dylib                   0x00007fff8f6310b6 _dispatch_client_callout + 8
10  libdispatch.dylib                   0x00007fff8f6360c8 _dispatch_main_queue_callback_4CF + 275
11  CoreFoundation                      0x00007fff8d0900fe __CFRunLoopRun + 1614
12  CoreFoundation                      0x00007fff8d08f6b2 CFRunLoopRunSpecific + 290
13  HIToolbox                           0x00007fff8dbcc0a4 RunCurrentEventLoopInMode + 209
14  HIToolbox                           0x00007fff8dbcbe42 ReceiveNextEventCommon + 356
15  HIToolbox                           0x00007fff8dbcbcd3 BlockUntilNextEventMatchingListInMode + 62
16  AppKit                              0x00007fff8b93b613 _DPSNextEvent + 685
17  AppKit                              0x00007fff8b93aed2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
18  AppKit                              0x00007fff8b932283 -[NSApplication run] + 517
19  AppKit                              0x00007fff8b8d6cb6 NSApplicationMain + 869
20  Chatty Mac                          0x0000000100005692 main + 34
21  Chatty Mac                          0x0000000100001d64 start + 52
22  ???                                 0x0000000000000003 0x0 + 3
)
2012-12-03 06:00:12.799 Chatty Mac[1580:303] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[__NSCFString substringWithRange:]: Range or index out of bounds'
*** First throw call stack:
(
0   CoreFoundation                      0x00007fff8d0ee0a6 __exceptionPreprocess + 198
1   libobjc.A.dylib                     0x00007fff887e73f0 objc_exception_throw + 43
2   CoreFoundation                      0x00007fff8d0ede7c +[NSException raise:format:] + 204
3   CoreFoundation                      0x00007fff8d0c555d -[__NSCFString substringWithRange:] + 109
4   Chatty Mac                          0x0000000100006ecb -[AppDelegate receivedData:] + 283
5   Chatty Mac                          0x000000010000e772 -[ORSSerialPortDemoController serialPort:didReceiveData:] + 466
6   Chatty Mac                          0x000000010000a6ba -[ORSSerialPort receiveData:] + 170
7   Chatty Mac                          0x0000000100009636 __block_global_1 + 38
8   libdispatch.dylib                   0x00007fff8f634f01 _dispatch_call_block_and_release + 15
9   libdispatch.dylib                   0x00007fff8f6310b6 _dispatch_client_callout + 8
10  libdispatch.dylib                   0x00007fff8f6360c8 _dispatch_main_queue_callback_4CF + 275
11  CoreFoundation                      0x00007fff8d0900fe __CFRunLoopRun + 1614
12  CoreFoundation                      0x00007fff8d08f6b2 CFRunLoopRunSpecific + 290
13  HIToolbox                           0x00007fff8dbcc0a4 RunCurrentEventLoopInMode + 209
14  HIToolbox                           0x00007fff8dbcbe42 ReceiveNextEventCommon + 356
15  HIToolbox                           0x00007fff8dbcbcd3 BlockUntilNextEventMatchingListInMode + 62
16  AppKit                              0x00007fff8b93b613 _DPSNextEvent + 685
17  AppKit                              0x00007fff8b93aed2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
18  AppKit                              0x00007fff8b932283 -[NSApplication run] + 517
19  AppKit                              0x00007fff8b8d6cb6 NSApplicationMain + 869
20  Chatty Mac                          0x0000000100005692 main + 34
21  Chatty Mac                          0x0000000100001d64 start + 52
22  ???                                 0x0000000000000003 0x0 + 3
)
libc++abi.dylib: terminate called throwing an exception
(lldb) 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:43:15+00:00Added an answer on June 15, 2026 at 11:43 am

    In comments, you say:

    AppDelegate *theAppDelegate = [[AppDelegate alloc] init];
    [theAppDelegate receivedData:string];
    

    That creates a new AppDelegate object, which means the applicationDidFinishLaunching method isn’t being called (it was already called in the first AppDelegate instance). Use the original one instead.

    AppDelegate *theAppDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here is code for regular expression matching #include<iostream> #include<stdio.h> #include<string.h> using namespace std; int
Here is code example class A{ int i; public: A(int i) : i(i) {}
I'm trying to match this block here /code\ int foo(string $bar, int $bleh); Simple
Here's my code: -(void)randommoves { NSArray *possiblemoves =[NSArray arrayWithObjects:@R ,@R' ,@L ,@L' ,@B ,@B'
Why is substringFromIndex not working for my NSMutableString ? Here code similar to what
Here is my code in appdelegate.m NSURL *url = [[NSURL alloc] initWithString:kBioXML]; NSXMLParser *xmlParser
The script is on jsfiddle here : CODE What it does at the moment
Ok the error is showing up somewhere in this here code if($error==false) { $query
Here is code my jqgrid editing through form. $(#DataEnergy).jqGrid('navGrid', '#pagergrid', {}, //options {editdata: {
Here my code, I need to insert into mysql database I have mysql,php,android 1)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.