在我的iOS应用程序中,我发现了这个崩溃的来源,我遇到了一个问题,它有一个使用iPhone应用程序的核心数据模型,我无法登录URl。我在iOS 7上使用了相同的代码,它可以工作,但现在我尝试在iOS 8.2上工作。

块点也在下面,检查屏幕快照是否有块错误:
[NetwokManager sharedInstance loginRequestEmail:userEmail和andPassword:userPassword WithResponse:^(id responseObject,NSError *error) { if (!error) { }
使用代码的情况如下:
-(void)sendLoginRequest
{
NSString *userEmail = [[NSUserDefaults standardUserDefaults] objectForKey:@"emailKey"];
NSString *userPassword = [[NSUserDefaults standardUserDefaults] objectForKey:@"passwordKey"];
NSLog(@"Email %@", userEmail);
NSLog(@"Password %@", userPassword);
NSString *mobileNo = [SCUserProfile currentUser].callerid;
NSLog(@"CallerID %@", mobileNo);
[[NetwokManager sharedInstance] loginRequestEmail:userEmail andPassword:userPassword WithResponse:^(id responseObject, NSError *error) {
if (!error) {
NSLog(@"responseString = %@", responseObject);
if (responseObject == nil)
{
NSLog(@"No data from server");
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"No data downloaded from server!"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[alertView show];
}
NSDictionary *resposneDict = (NSDictionary*)responseObject;
NSString *success = [resposneDict valueForKey:@"success"];
if ([success isEqual:@"Authentication Failed"])
{
[self showAlertViewWithMessage:@"Authentication Failed"];
// [self sendLogoutRequest];
[[C2CallAppDelegate appDelegate] logoutUser];
}
else if ([success intValue] == 1)
{
amobilePayUserID = [resposneDict valueForKey:@"user_id"];
[[NSUserDefaults standardUserDefaults] setValue:amobilePayUserID forKey:@"AMobilePay_User_ID"];
NSLog(@"User Id is:= %@",amobilePayUserID);
}
else if ([success intValue] == 0)
{
//[self sendRegistrationRequest];
// [self sendLogoutRequest];
// [[C2CallAppDelegate appDelegate] logoutUser];
}
else
{
[self showAlertViewWithMessage:@"Unable to login AmobilePay"];
}
} else {
[self showAlertViewWithMessage:[error localizedDescription]];
}
}];
}发布于 2015-04-30 06:42:15
坠毁在未知区域2015-04-30 09:56:18.390 AmobipayMerchant337:60b *终止应用程序由于非正常例外'NSInvalidArgumentException',原因:'-MOC2CallEvent成本:未识别的选择器发送到实例0x16ef2dd0‘
在代码中的某个地方,您将costs调用为MOC2CallEvent的一个实例。MOC2CallEvent没有方法或属性costs,所以它当然会崩溃。
https://stackoverflow.com/questions/29958642
复制相似问题