【发布时间】:2016-12-21 22:30:31
【问题描述】:
我正在用 Objective C 编写一个应用程序,但我不断收到 Use of Undeclared Identifier 'startClient' 错误。我附上了一个链接到我的项目文件,教程链接在这里:https://www.sinch.com/tutorials/building-one-button-app-conference-calling/ https://drive.google.com/file/d/0B5loU41SFmzDZ2RNbWJsR0xoSk0/view?usp=sharing
我的代码的相关部分在这里...
#import <QuartzCore/QuartzCore.h>
#import "ConferenceViewController.h"
#import "LoginViewController.h"
#import <SinchCallingUIKit/SinchCallingUIKit.h>
@class ConferenceViewController;
@interface UIView ()
@end
@implementation ConferenceViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)viewDidAppear:(BOOL)animated
{
- (void)startClient {}{
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
[[CallingManager sharedManager] startClientWithKey:8b6893bf-41c6-4527-bc68-9d3703c13be3 secret:Ox18uwq7gkiAdeQYzntN6A== userName:[defaults stringForKey:@"userName"] sandbox:NO launchOptions:nil];
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
if ([defaults stringForKey:@"userName"] == nil)
{
[self performSegueWithIdentifier:@"login" sender:nil];
}
else
{
[self startClient];
}
}
【问题讨论】:
-
请在此处发布您的代码的相关部分
-
检查How to Ask并提供minimal reproducible example,因为当代码随时可用时更容易回答问题,而不必点击。
-
@Vladimir 我已经添加了相关部分...
-
@ShreyGupta 所以你的 startClient 方法在 viewDidAppear: 代码中? Objective-c 不支持“嵌套”方法
-
除了嵌套函数的东西。这个“(void)startClient {} {”是什么?所有花括号在那里做什么?
标签: ios objective-c xcode undeclared-identifier