小编Vit*_*Vit的帖子

我需要在ARC中使用dealloc方法吗?

所以,我上课了:

@interface Controller : NSObject
{
    UILabel* fileDescription;
}

@property(strong, nonatomic) UILabel* fileDescription;
Run Code Online (Sandbox Code Playgroud)

我是否需要使用方法dealloc,其中属性fileDescription将等于nil?
例如:

-(void)dealloc
{
    fileDescription = nil;
}
Run Code Online (Sandbox Code Playgroud)

如果没有,谁将解雇f​​ileDescription使用的内存?

iphone objective-c ios automatic-ref-counting

39
推荐指数
3
解决办法
2万
查看次数

什么可以使用CFReadStreamCreateForHTTPRequest?

对于IOS 9及更低版本,此方法CFReadStreamCreateForHTTPRequest(...)已弃用.

Apple的文档建议使用NSURLSession而不是这个.但是我不明白我如何重新整合与NSURLSession的Live(我使用流)一起工作的功能.

我没有看到任何由NSURLSession加载"live"的可能性.

您通过服务器的特殊URL来加载实时数据的用途是什么?

cfnetwork ios cfnetworking

7
推荐指数
0
解决办法
276
查看次数

为什么不调用UIViewControllerTransitioningDelegate的方法presentationControllerForPresentedViewController?

我想使用自定义UIPresentationController.对于它,当我想要显示新场景时,我称之为代码

UIViewController *cv = [[...]];

cv.transitionManager=[[MyTransition alloc] init];
cv.transitioningDelegate=actionSheet.transitionManager;
cv.modalTransitionStyle = UIModalPresentationCustom;

[self presentViewController:cv animated:YES completion:^{

}];
Run Code Online (Sandbox Code Playgroud)

我的过渡经理有方法:

#pragma mark - UIViewControllerTransitioningDelegate

- (id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source{
    return self;
}

- (id <UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed{
    return self;
}

- (id <UIViewControllerInteractiveTransitioning>)interactionControllerForPresentation:(id <UIViewControllerAnimatedTransitioning>)animator{
    return  nil;
}

- (id <UIViewControllerInteractiveTransitioning>)interactionControllerForDismissal:(id <UIViewControllerAnimatedTransitioning>)animator{
    return self;
}


- (UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented presentingViewController:(UIViewController *)presenting sourceViewController:(UIViewController *)source {
    MyPresentationController *presentationController = [[MyPresentationController alloc] initWithPresentedViewController:presented presentingViewController:presenting];
    return presentationController;
}
Run Code Online (Sandbox Code Playgroud)

但方法presentationControllerForPresentedViewController不调用!

为什么?

iphone objective-c ios ios8 ios8-extension

5
推荐指数
2
解决办法
2921
查看次数

音频队列 - 没有用于调用'AudioSessionInitialize'的匹配函数

我有个问题.我想在我的应用程序中使用一些与声音一起使用的功能.

我找到了示例SpeakHere,并在我的应用程序中包含此应用程序的主要部分功能.但我有3个错误:

没有用于调用'AudioSessionInitialize'的匹配函数

在此输入图像描述

我该如何修复这个错误?

我添加到项目框架:coreAudio,AudioToolbox
我使用ARC.

iphone objective-c core-audio audioqueue ios

4
推荐指数
2
解决办法
2618
查看次数

为什么我有警告“冗余约束‘Self’:‘AnyObject’”

我已将 Xcode 更新到 12.5。现在我可以看到下一个警告:“冗余约束‘Self’:‘AnyObject’” 在此处输入图片说明

是什么导致此警告?(RouterType 必须仅适用于类。)

swift

1
推荐指数
1
解决办法
89
查看次数