iOS - 应用程序启动时在try块中崩溃

时间:2014-02-03 10:47:56

标签: ios objective-c try-catch

在if条件[environMent objectForKey:key]中执行时,应用程序启动崩溃。如何修复此崩溃?

崩溃日志:

0x2e2cdfe3 CFDictionaryGetValue + 99
0x00505d87 -[Environments getValueforKey:] (Environments.m:62)

代码:

    @try {
         if (environMent != nil) 
         {
                if ((key != nil) && ![key isEqual:[NSNull null]] && [key length] > 0 && [environMent objectForKey:key])
                {
                    // Build the array from the plist
                    value = [environMent objectForKey:key];
                }
            }
        }
        @catch (NSException *exception) {
            NSLog(@"Failed to get the object from plist: %@", [exception reason]);
        }

完整崩溃日志:http://pastebin.com/LUjPJeAy

0 个答案:

没有答案