Application crashes due to NSLog in NSWorkspace isFilePackageAtPath

  • Hi List,

    My application is  getting crashed in the NSLog statement exists in
    NSWorkspace isFilePackageAtPath method.

    Please find the corresponding code and its crash log:

    - (BOOL) isFilePartOfBundle:(NSString *)inPath {
    BOOL result = NO;
    NSMutableString *tempStr = [NSString stringWithString:inPath];

    while ( ! [tempStr isEqualToString:@"/"] ) {
    //        NSLog(@"tempStr %@", tempStr);
      if ([[NSWorkspace sharedWorkspace] isFilePackageAtPath:tempStr]) {
      result = YES;
      break;
      }
      tempStr = [NSMutableString stringWithString:[tempStr
    stringByDeletingLastPathComponent]];
    }
    //    NSLog(@"isFilePartOfBundle result %d", result);
    return result;
    }

    Crash Log:

    0  com.apple.ExceptionHandling     0x95e7a524
    NSExceptionHandlerUncaughtSignalHandler + 17
    1  libSystem.B.dylib               0x9011072c _sigtramp + 49
    2  libSystem.B.dylib               0x9001029c write + 12
    3  com.apple.Foundation           0x9280da9e NSLogv + 198
    4  com.apple.Foundation           0x9284b319 NSLog + 27
    5  com.apple.AppKit               0x93546cdd -[NSWorkspace
    isFilePackageAtPath:] + 102
    6  com.yourcompany.CDP             0x0000304f -[MyDelegate
    isFilePartOfBundle:] + 78
    7  libobjc.A.dylib                 0x90a5cd76 objc_msgSendv + 54
    8  com.apple.Foundation           0x927fc3e4 -[NSInvocation invoke] + 982
    9  com.apple.JavaScriptCore       0x95328588
    KJS::Bindings::ObjcInstance::invokeMethod(KJS::ExecState*,
    KJS::Bindings::MethodList const&, KJS::List const&) + 434
    10  com.apple.JavaScriptCore       0x9532443e
    KJS::RuntimeMethod::callAsFunction(KJS::ExecState*, KJS::JSObject*,
    KJS::List const&) + 238
    11  com.apple.JavaScriptCore       0x95361b17
    KJS::FunctionCallDotNode::evaluate(KJS::ExecState*) + 883
    12  com.apple.JavaScriptCore       0x952faf36
    KJS::AssignExprNode::evaluate(KJS::ExecState*) + 14
    13  com.apple.JavaScriptCore       0x952facc8 KJS::VarDeclNode::evaluate
    (KJS::ExecState*) + 54
    14  com.apple.JavaScriptCore       0x952fac49
    KJS::VarDeclListNode::evaluate(KJS::ExecState*) + 35
    15  com.apple.JavaScriptCore       0x952faad2
    KJS::VarStatementNode::execute(KJS::ExecState*) + 62
    16  com.apple.JavaScriptCore       0x952fa7aa
    KJS::SourceElementsNode::execute(KJS::ExecState*) + 130
    17  com.apple.JavaScriptCore       0x952fa6cd KJS::BlockNode::execute
    (KJS::ExecState*) + 45
    18  com.apple.JavaScriptCore       0x952fe805 KJS::IfNode::execute
    (KJS::ExecState*) + 217
    19  com.apple.JavaScriptCore       0x952fa8c3
    KJS::SourceElementsNode::execute(KJS::ExecState*) + 411
    20  com.apple.JavaScriptCore       0x952fa6cd KJS::BlockNode::execute
    (KJS::ExecState*) + 45
    21  com.apple.JavaScriptCore       0x952fe8a1 KJS::IfNode::execute
    (KJS::ExecState*) + 373

    Thanks & Regards,
    - Apparao.
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today