Code:
- (NSString *)allLines:(NSString *)searchText {
NSMutableString *string = [NSMutableString stringWithString:@""];
for ( int n = 35; n <= 71115; n++ ) {
if ( [[self.entryList objectAtIndex:n] rangeOfString:searchText].length != 0 ) {
[string appendString:[self.entryList objectAtIndex:n]];
[string appendString:@"\n\n"];
}
}
return string;
}
I have a txt file parsed into an array of NSString and this function is supposed to return each entire line if the searched text can be found on that line. However, each time I try to search within the program, I get the following error:
Code:
Loading program into debugger…
GNU gdb 6.3.50-20050815 (Apple version gdb-960) (Sun May 18 18:38:33 UTC 2008)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".warning: Unable to read symbols for "/System/Library/Frameworks/UIKit.framework/UIKit" (file not found).
warning: Unable to read symbols from "UIKit" (not yet mapped into memory).
Program loaded.
sharedlibrary apply-load-rules all
Attaching to program: `/Users/chuck/Library/Application Support/iPhone Simulator/User/Applications/6C48ABB8-4FD6-4741-A3AA-536ACF674DE5/My.app/My', process 16561.
Am I forgetting to release an object or perhaps I should be using a pointer where I'm using a variable? If you could help me see what I'm doing wrong here, I'd greatly appreciate it.