我有一个以导航控制器开始的应用程序.该导航控制器可以打开模态视图控制器:
- (void)openModalController:(id)sender
{
[self performSegueWithIdentifier:@"SegueIdentifier"];
}
Run Code Online (Sandbox Code Playgroud)
但是当用户使用url方案打开应用程序时,我想在打开模态控制器的情况下显示应用程序.所以我添加了一些方法并尝试:
// Controller
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated]; // animated == NO in initial loading
if (_shouldOpenModalController) {
[self openModalController:nil];
}
}
- (void)setShouldOpenModalController:(BOOL)flag
{
_shouldOpenModalController = flag;
}
// AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if (launchOptions) {
UINavigationController *nc = (UINavigationController *)self.window.rootViewController;
MyViewController *c = (MyViewController *)[ns topViewController];
[c setShouldOpenModalController];
}
}
Run Code Online (Sandbox Code Playgroud)
但是这里有一个问题:openModalController:我在故事板中设置了过渡动画.如何在没有动画的情况下完成?这项任务还有另一种方法吗?
试图解决我遇到的OpenSSL版本问题.
我的Mac上似乎有三个不同版本的OpenSSL.
Python 2.7.11的版本为0.9.7m:
python -c "import ssl; print ssl.OPENSSL_VERSION"
OpenSSL 0.9.7m 23 Feb 2007
Run Code Online (Sandbox Code Playgroud)在终点站:
openssl version
OpenSSL 1.0.1h 5 Jun 2014
Run Code Online (Sandbox Code Playgroud)最近编译/安装:
/usr/local/ssl/bin/openssl
OpenSSL> version
OpenSSL 1.0.2h 3 May 2016
OpenSSL>
Run Code Online (Sandbox Code Playgroud)我最近将OS X升级到10.11.5.在此过程中,导致以前工作的python脚本出现问题.以下是错误消息片段:
Python错误消息:
You are linking against OpenSSL 0.9.8, which is no longer *
RuntimeError: You are linking against OpenSSL 0.9.8, which is no longer support by the OpenSSL project. You need to upgrade to a newer version of OpenSSL.
Run Code Online (Sandbox Code Playgroud)
(* - 是的,这就是错误信息的样子.它在句子的中间被修剪.)
任何有关解决此问题的建议都将不胜感激.我想要的是让Python引用OpenSSL版本1.0.2h与过时版本0.9.7m.
我已经尝试过很多次使用各种帖子/博客来安装Python和OpenSSL,但没有任何运气.
我正在播放文件.来自url的mp3流.我正在使用AVPlayer,当我试图获得构建进度条的总时间时,只要时间是南,我就会得到.
NSError *setCategoryError = nil;
if ([ [AVAudioSession sharedInstance] isOtherAudioPlaying]) { // mix sound effects with music already playing
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategorySoloAmbient error:&setCategoryError];
} else {
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:&setCategoryError];
}
if (setCategoryError) {
NSLog(@"Error setting category! %ld", (long)[setCategoryError code]);
}
NSURL *url = [NSURL URLWithString:@"http://..//46698"];
AVPlayer *player = [AVPlayer playerWithURL:url];
songPlayer=player;
[songPlayer addObserver:self forKeyPath:@"status" options:0 context:nil];
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if (object == songPlayer && [keyPath isEqualToString:@"status"]) {
if (songPlayer.status == AVPlayerStatusFailed) {
NSLog(@"AVPlayer …Run Code Online (Sandbox Code Playgroud) 我在我的应用程序中实现了dataPicker.但它只显示月,日,小时.我怎么能在日期选择器中添加年份.任何的想法?
我的工作簿有以下公开活动:
Private Sub Workbook_Open()
ThisWorkbook.ChangeFileAccess xlReadOnly
End Sub
Run Code Online (Sandbox Code Playgroud)
然后这个按钮:
Sub UnlockDeveloper()
Dim pwd As String
pwd = InputBox("Enter developer password:", "Password")
If pwd = "password" Then
If ThisWorkbook.ReadOnly = True Then
ThisWorkbook.ChangeFileAccess xlReadWrite
End If
Else
MsgBox ("Incorrect password.")
End If
End Sub
Run Code Online (Sandbox Code Playgroud)
这通常很好,但有时运行UnlockDeveloper子会导致VBAProject在VBA窗口中出现两次,我无法知道哪个是真实文件.如果我在错误的位置进行更改,则只要关闭Excel,更改就会丢失.

有人有任何想法如何防止这种情况?
我想在滚动视图底部对齐红色图像。在纵向方向上,它看起来很好,因为滚动视图的高度等于视图高度。
但在横向模式下,它看起来像这样,在横向模式下,我希望它完全隐藏,直到用户滚动到滚动视图的底部,以便红色图像始终位于滚动视图的底部。目前,它在横向模式下看起来像这样。

我已添加红色图像作为滚动视图的子视图,并对其应用了bottommarginautoresizingmask。
我需要从上次设备启动时获取NSTimeInterval值.我发现CACurrentMediaTime()适合这个任务,但在我的应用程序中我没有使用Core Animation,我不认为这是包含这个框架只是为了获得这个功能的最佳方式.有没有另一种方法可以在最后一次启动后的几秒钟内获得更优雅的方式?
问题在标题中给出:我不知道为什么会发生这种情况.有人能告诉我这些技巧是如何运作的.
这是我的代码:
#include<stdio.h>
int main(){
int a = 320;
char *ptr;
printf("%p\n",&a);
ptr =( char *)&a;
printf("%p\n",ptr);
printf("%d\n",a);
printf("%d\n",*ptr);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
输出:
0x7fffc068708c
0x7fffc068708c
320
64
Run Code Online (Sandbox Code Playgroud) 当我点击我的barButtomItem将我的应用程序内容分享到FB,Tw,微博和邮件时,我在调试区域收到此消息.iOs6 XCode 4.5.1
2013-03-08 15:59:31.609细胞学[2088:1cd03]启动服务:注册未知应用程序标识符com.apple.mobilemail失败2013-03-08 15:59:31.610细胞学[2088:1cd03]启动服务:无法找到应用程序标识符com.apple.mobilemail
这是我的代码:
-(IBAction)shareButtonPressed:(id)sender {
NSLog(@"shareButton pressed");
NSString *texttoshare = _txt;
UIImage *imagetoshare = _img;
NSArray *activityItems = @[texttoshare, imagetoshare];
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
activityVC.excludedActivityTypes = @[UIActivityTypeAssignToContact, UIActivityTypePrint];
[self presentViewController:activityVC animated:TRUE completion:nil];
}
Run Code Online (Sandbox Code Playgroud)
尽管编译警告消息我能够成功发布和发送邮件...我读了一些关于使用外部库但我不喜欢这个解决方案.我确定我会错过一些明显的东西.
任何帮助将不胜感激
我最近添加了一个分段控件到我的tableview的节头,一切正常,但它调整错误的方式..我想应用一些边距,但如果我设置框架它没有任何影响的大小分段控制?我做错了什么?这是我的代码:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
if(section == 0) {
UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:@[@"Segment 1", @"Segment 2",@"Segment 3"]];
segmentedControl.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.95];
[segmentedControl setFrame:CGRectMake(10, 0, self.view.bounds.size.width-10, self.view.bounds.size.height)];
return segmentedControl;
}
return nil;
}
Run Code Online (Sandbox Code Playgroud)

ios ×6
objective-c ×3
iphone ×2
avplayer ×1
c ×1
excel ×1
excel-2010 ×1
excel-vba ×1
ipad ×1
macos ×1
openssl ×1
pointers ×1
python ×1
ssl ×1
storyboard ×1
uidatepicker ×1
uikit ×1
uiscrollview ×1
uitableview ×1
vba ×1
vbe ×1
version ×1