在我的iOS项目中,我已将其设置Generate Debug Symbols
为Yes
,但.dYSM文件未在DerivedData文件夹中创建.我在我的iPhone上运行这个应用程序.因为我需要它来映射它来做时间分析器,因为时间分析器显示十六进制地址中的所有符号.必须象征性地确定完成任务的时间.
提前致谢.
我有一个如下的模型类,它位于用Objective-C编写的库中.我正在快速的项目中使用这个类.在swift中它变成了类型的属性String!
.有时该财产将是零.所以,我正在测试nil验证如下:
Vendor.h
@interface Vendor: NSObject {
@property (nonatomic, strong) NSString *firstName;
@property (nonatomic, strong) NSString *lastName;
@property (nonatomic, strong) NSString *middleName;
}
Run Code Online (Sandbox Code Playgroud)
在我的Swift项目中,我正在检查middleName属性的nil验证,如下所示:
if anObject.middleNam != nil { // Here, It throws runtime error: fatal error: Unexpectedly found nil while unwrapping an Optional value
}
Run Code Online (Sandbox Code Playgroud)
它抛出了以下运行时错误:
fatal error: unexpectedly found nil while unwrapping an Optional value
Run Code Online (Sandbox Code Playgroud)
如果Objective-C属性暴露在swift中,String?
那么我将使用以下内容:
if let middleName = anObject.middleName {
}
Run Code Online (Sandbox Code Playgroud)
我如何检查未包装的可选变量.
提前致谢.
我创建了一些示例Web服务方法,并尝试使用Tomcat v8.0在我的localhost中发布.我使用Eclipse Java EE IDE for Web Developers with Mars version 4.5.0.我配置了服务器Tomcat v8.0.我在Eclipe的Servers列表中获得了配置的服务器.我启动服务器.但Eclipse提示说
Publishing to tomcat v8.0 Server at localhost..." has encountered a problem.
Run Code Online (Sandbox Code Playgroud)
而错误的详细信息显示,多个上下文有一个路径/HelloWorldServlet
和/com.vogeila.jersy.first
.这些是我在工作区中创建的servlet项目.
我听了这个回答.
"localhost上的服务器Tomcat v7.0服务器无法启动",而无需堆栈跟踪,而它在终端中工作
但它对我的情况不起作用.分享您的想法.
可能重复:
iPhone上的NSOperation
我是Objective-c Iphone的新手,我开始了解NSOperation和NSOperationQueue.在哪里使用它,我该如何使用它?有人能用任何小例子程序给我解释吗?
提前致谢...
我在网址上有一个视频,点按一下我就要播放一个视频,为此我用UIWebView来播放这个视频,为此我使用了以下代码:
-(void)viewDidLoad
{
NSString *string = @"http://www.boxmusiq.com/ThiruvasakamVideo/VTS_01_2_converted.mp4";
youtubeview = [[YouTubeView alloc] initWithStringAsURL:string frame:CGRectMake(0, 0, 320, 480)];
NSLog(@"the url is: %@",string);
[self.view addSubview:youtubeview];
}
Run Code Online (Sandbox Code Playgroud)
在YouTubeView.m中,YouTubeView是UIWebView的子类;
- (YouTubeView *)initWithStringAsURL:(NSString *)urlString frame:(CGRect)frame;
{
if (self = [super init])
{
// Create webview with requested frame size
self = [[UIWebView alloc] initWithFrame:frame];
// HTML to embed YouTube video
NSString *youTubeVideoHTML = @"<html><head>\
<body style=\"margin:0\">\
<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
width=\"%0.0f\" height=\"%0.0f\"></embed>\
</body></html>";
// Populate HTML with the URL and requested frame size
NSString *html …
Run Code Online (Sandbox Code Playgroud) 在我的 Iphone 应用程序中,我在 viewDidLoad() 方法中使用了以下 3 个图像的动画代码,并使用左变换加载此 ViewController。但是这些 imageView 并没有显示在视图上。
NSArray *newArray = [[NSArray alloc]initWithObjects:[UIImage imageNamed:@"search1.png"],
[UIImage imageNamed:@"search2.png"],
[UIImage imageNamed:@"seach3.png"],
nil];
UIImageView *imageView = [UIImageView alloc];
[imageView initWithFrame:CGRectMake(240, 60, 60, 30)];
imageView.animationImages = newArray;
imageView.animationDuration = 0.25;
imageView.animationRepeatCount = 3;
[self.view addSubview:imageView];
Run Code Online (Sandbox Code Playgroud) 在我的iPhone应用程序中,我正在实施音频录制,它适用于iPhone模拟器/设备,它说文件丢失如下:
Missing File
file://localhost/.../WaveView.h: warning: Missing file: /..../WaveView.h is missing from working copy
Run Code Online (Sandbox Code Playgroud)
并且文件WaveView.h和WaveView.m在左侧滑动条中显示红色,我在finder中显示删除此文件,但该文件不存在于app文件夹中.
任何人都可以建议我解决这个问题
提前致谢!!!
我有一个类HomeView,作为我的iPad应用程序上的UINavigationController的rootViewController.仅在info.plist文件中设置了横向方向,并且HomeView未实现shouldRotateToInterfaceOrientation:
,但是在模拟器旋转时视图正在为两个方向旋转.
我如何仅在UIViewController中使用横向方向?
我有一个函数assignName(name :),它会抛出一个错误.当从具有多个catch的do块调用该函数时,它将错误显示为:
Errors thrown from here are not handled because the enclosing catch is not exhaustive
Run Code Online (Sandbox Code Playgroud)
我的代码是:
enum PersonError: ErrorType {
case IsNotAPerson
case IsNotAGoodPerson
case IsNotAValidPerson
}
func assignName(name: String?) throws {
guard name != nil else {
throw PersonError.IsNotAPerson
}
personName = name
}
func catchingSpecificError() {
do {
try assignName(nil) // Compiler Error displays at this line.
}catch PersonError.IsNotAPerson {
print("Propagated error is caught in catch on case .NotAPerson")
}
}
Run Code Online (Sandbox Code Playgroud)
提前致谢!
在我的iPhone应用程序中,我正在使用结构并从Objective C UIViewController类访问它,在我的一个AudioInput.h文件中,我有以下内容:
typedef struct
{
AudioStreamBasicDescription format;
AudioQueueRef queue;
AudioQueueBufferRef buffers[ NUM_AUDIO_BUFFERS ];
SampleBuffer samples;
bool running;
bool done;
UInt32 playPos;
} AudioRecording;
Run Code Online (Sandbox Code Playgroud)
在我的ViewController MainViewController.m中我实现了AudioInputCallback()
如下:
static void AudioInputCallback(
void *userData,
AudioQueueRef queue,
AudioQueueBufferRef buffer,
const AudioTimeStamp *startTime,
UInt32 numPackets,
const AudioStreamPacketDescription *packetDescriptions
)
{
// TRACE( "AudioInputCallback\n" );
MainViewController *controller = (MainViewController *) userData;
AudioRecording *audioRecording = & controller->audioRecording;
if( audioRecording->done )
{
TRACE( "AudioInputCallback: done\n" );
return;
}
if( numPackets == 0 && audioRecording->format.mBytesPerPacket > 0 …
Run Code Online (Sandbox Code Playgroud) objective-c ×7
iphone ×6
ios ×3
xcode ×3
xcode4 ×2
animation ×1
eclipse ×1
instruments ×1
ios5 ×1
ipad ×1
java ×1
orientation ×1
servlets ×1
swift2 ×1
swift3 ×1
web-services ×1
xcode4.2 ×1
xcode7.3 ×1