I get a Sigabrt at the NSlog and i have no idea why – any suggestions?
NSString* contentList = [NSString stringWithContentsOfFile:currentFilePath encoding:NSUTF8StringEncoding error:nil];
NSArray* contentArray = [contentList componentsSeparatedByString:@"$$"];
NSLog(@"%@%@",contentList,[contentArray count]);
kunden = [contentArray objectAtIndex:0];
kundenView.text = kunden;
Following Joes suggestions, I now got:
NSString* contentList = [NSString stringWithContentsOfFile:currentFilePath encoding:NSUTF8StringEncoding error:nil];
NSArray* contentArray = [[contentList componentsSeparatedByString:@"$$"] retain];
if ([contentArray count] > 0) {
NSLog(@"%@%@",contentList,[contentArray count]);
kunden = [contentArray objectAtIndex:0];
kundenView.text = kunden;
}
Which gives me an EXC_BAD_ACCESS at the NSLog thing.
Your NSLog statement is trying to print an integer as if it was an object:
Replace
%@with%d.You can read more on format specifiers in the String Programming Guide.