开发者

Objective-C & Compare two NSStrings

I am trying to compare 2 NSStrings to see if they match but my app keeps crashing with a EXC_BAD_ACCESS and it just shows me an assembly output and not the actually location within my code that it keeps crashing.

Here is my compare:

NSString *compareAlarm = [lblTime stringValue];
[lblTime setStringValue:[self getTime]];

if ([sAlarmTime isEqualToString:compar开发者_StackOverflow中文版eAlarm])
{
    NSLog(@"Alarm Hit");
}

[compareAlarm release];

Does anyone see why this would fail? If I comment out the if statement the crash stops.

Thanks in advanced.


you aren't retaining compareAlarm but you release it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜