小编dic*_*ala的帖子

Mac App Store上的Xcode无法安装,显示磁盘空间不足

我正在使用Mac OS安装XCode10.1。

我在Mac中有18.43GB的可用磁盘空间,

但是当我在应用商店中单击Xco​​de上的安装按钮时,

它始终显示“存储磁盘空间不足,您无法安装产品”警报消息。

如何解决MacOS Mojave(10.14.1)中的问题?

非常感谢你。

在此处输入图片说明

在此处输入图片说明

macos xcode install

85
推荐指数
12
解决办法
4万
查看次数

如何使用getResource.getIdentifier()来获取布局?

大家好,我有一个问题.

我想用来getResource.getIdentifier() 获取XML格式的布局元素(layout/xxx.xml).

但我遇到"资源ID#0x7f070003类型#0x12无效..."错误消息.

我不知道如何解决这个问题.

我使用的方法是返回linearlayout.

这是我的代码如下:

public class MainActivity extends Activity {


 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);

  getWeekOfDay(2).setBackgroundColor(Color.RED);
 }

 private LinearLayout getWeekOfDay(int n)
 {
  int layoutID = getResources().getIdentifier("layout"+n, "id", getPackageName());
  return (LinearLayout) LayoutInflater.from(this).inflate(layoutID, null);
 }
....
...
..
}
Run Code Online (Sandbox Code Playgroud)

我的布局有很多linearlayout,但名称相似(layout1,layout2,layout3 ......).

我想使用call方法获取指定元素.

我的布局代码如下:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/LinearLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity" >

    <LinearLayout
        android:id="@+id/layout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0.37"
        android:background="#cccccc" >

            <TextView
            android:id="@+id/TextView03"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="test1" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/layout2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0.37"
        android:background="#cccccc" >

        <TextView
            android:id="@+id/TextView02" …
Run Code Online (Sandbox Code Playgroud)

user-interface android android-linearlayout

18
推荐指数
1
解决办法
4万
查看次数

在框架头中找不到swift文件

我正在尝试使用swift创建用于测试的简单框架.

我曾与发布问题在Objective-C"创建框架" 之前.它得到了解决.

但我正在尝试用swift创建框架.

我遇到了这个问题.我无法在头文件中导入MyUtility文件.

如下:

在此输入图像描述 在此输入图像描述

有谁知道如何在我的自定义框架中导入文件?

非常感谢你.

==============编辑===========

为@Jerome L

在此输入图像描述

xcode frameworks swift

12
推荐指数
2
解决办法
8365
查看次数

io8如何设置UIPopoverPresentationController大小

我设置了UIPopoverPresentationController来显示UIViewController,就像UIAlertView一样.

但是当我创建自定义的UIViewController并使用UIPopoverPresentationController时.有全屏显示.

我想构建像http://cocoa.tumblr.com/post/92070238973/how-can-i-use-both-uipopoverpresentationcontroller这样的效果

我曾尝试设置preferredContentSize,但它仍然显示全屏.

我的代码如下:

 - (void)viewDidLoad {
     [super viewDidLoad];
     contentVC = [UIViewController new];
     contentVC.view.backgroundColor = [UIColor darkGrayColor];
     contentVC.preferredContentSize = CGSizeMake(200, 200);


     UIPopoverPresentationController *popPC =      contentVC.popoverPresentationController;
     popPC.delegate = self;
     popPC.sourceView = self.view;
     popPC.sourceRect = CGRectMake(0,0,0,0);
     popPC.permittedArrowDirections = UIPopoverArrowDirectionAny;
 }

 - (IBAction)btnAction:(id)sender {

 [self presentViewController:contentVC animated:NO completion:ni

 }

 -(UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller
 {
     return UIModalPresentationOverCurrentContext;
 }
Run Code Online (Sandbox Code Playgroud)

有谁知道如何设置uiviewcontroller和UIPopoverPresentationController的大小,如网站效果?

我将在UIViewController中设置其他组件(现在只需设置backgroundcolor).

非常感谢你.

objective-c ios uipopover

11
推荐指数
2
解决办法
7931
查看次数

alertView:(UIAlertView*)alertView方法在Appdelegate中不起作用

我在AppDelegate.m文件中设置了UIAlertView.

但是当我选择警报视图上的按钮时.

-(void) alertView:(UIAlertView *) alertView clickedButtonAtIndex:(NSInteger)buttonIndex
Run Code Online (Sandbox Code Playgroud)

没有用.

我在AppDelegate.h文件中设置了UIAlertViewDelegate.

和我的AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:        (NSDictionary *)launchOptions
        {

         [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(reachabilityChanged:)
                                                 name:kReachabilityChangedNotification
                                               object:nil];

            NSString *remoteHostName = REACHABILITY_HOST;
            _hostReachability = [Reachability reachabilityWithHostName:remoteHostName];
            [_hostReachability startNotifier];

            return YES;
        }

        - (void) reachabilityChanged:(NSNotification *)note
        {
         if( [Reachability isExistNetwork] == NotReachable)
            {
                UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil         message:@"my message" delegate:nil cancelButtonTitle:@"ok"         otherButtonTitles:@"set",nil];
                [alertView show];

            }

        }

        -(void) alertView:(UIAlertView *) alertView clickedButtonAtIndex:(NSInteger)buttonIndex
        {

            switch (buttonIndex) {

                case 0:
                    NSLog(@"ok!");
                    break;

                    // set
                case 1:

                    NSLog(@"set!"); …
Run Code Online (Sandbox Code Playgroud)

objective-c uialertview ios appdelegate uialertviewdelegate

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

iOS容器视图和父ViewController通信?

如何与容器视图控制器和父视图控制器通信?我试图进行沟通并在它们之间传递价值.我在绿色视图控制器中添加了一个容器视图.我将segue名称设置为"communicSegue".我搜索了一些方法,我知道我们可以设置prepareForSegue来传递初始值.

 -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
     if ([segue.identifier isEqualToString:@"communicateSegue"]) {
         NSLog(@"call prepare for segue at parent view controller");
     }
 }
Run Code Online (Sandbox Code Playgroud)

但现在我想传递值并更改不同viewcontroller中的标签.不在最初.

我不知道该怎么办?

题:

有谁知道如何实现ParentViewController传递值到Container View Controller并在ContainerViewController中显示标签?

反之,Container View Controller单击按钮然后传递值并使用objective-c更改ParentViewController中的标签show?

谢谢.

我在parentViewController.h中声明变量:#import

 @interface ParentViewController : UIViewController
 @property (weak, nonatomic) IBOutlet UITextField *parentTF;
 @property (weak, nonatomic) IBOutlet UIButton *passValToChildVCBtn;

 @property (weak, nonatomic) IBOutlet UILabel *showContainerValLB;
 @property (weak, nonatomic) IBOutlet IBAction *passValueToContainerEvent;

 @end
Run Code Online (Sandbox Code Playgroud)

在ContainerChildViewController.h #import中

 @interface ContainerChildViewController : UIViewController
 @property (weak, nonatomic) IBOutlet UILabel *showParentValLB;
 @property (weak, nonatomic) IBOutlet UITextField *childTF;
 @property (weak, nonatomic) …
Run Code Online (Sandbox Code Playgroud)

communication objective-c ios

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

是否可以从我的共享扩展保存文件中获取主应用程序中的文件?

是否可以从我的共享扩展名中获取保存文档文件?

我尝试构建共享扩展,共享扩展可以获取文件路径。我编写了一个函数来将文件保存到我的文档文件夹中。

我需要从我的主应用程序获取文件。但我发现我从共享扩展路径保存文件是

/var/mobile/Containers/Data/PluginKitPlugin/9EBF8983-E1DE-49E2-8589-CEE7305EB644/Documents/xxx.png

我使用主应用程序来获取文档路径如下

/var/mobile/Containers/Data/Application/CFD67CD9-5A8A-473E-8ECF-FC1C1CF18098/Documents

文件夹 ID 不相同。

是否可以从共享扩展名保存的文件中获取文件?非常感谢。

share ios

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

无法在iOS 10.3发布版本中使用内部下载iOS应用程序

我将iOS更新为iOS 10.3发行版,

我尝试通过safari下载内部应用程序,

但显示以下错误消息(来自设备的日志).

  itunesstored(libsystem_network.dylib)[240] <Error>: nw_coretls_callback_handshake_message_block_invoke_3 tls_handshake_continue: [-9812]
  itunesstored(CFNetwork)[240] <Notice>:      NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
  itunesstored(CFNetwork)[240] <Error>: HTTP load failed (error code: -1202 [3:-9813])
  itunesstored(CFNetwork)[240] <Error>:      NSURLSessionTask finished with error - code: -1202
  itunesstored[240] <Notice>: LoadExternalDownloadManifestOperation: Request failed with error: <private>
  itunesstored[240] <Error>: Could not load download manifest with underlying error: <private>
Run Code Online (Sandbox Code Playgroud)

我测试内部安装在iOS 10.2.1.它安装正确.

但iOS 10.3将显示警报(无法连接到IP).

有谁知道我的情况发生了什么?

非常感谢你.

safari ios

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

如何在iOS中手动触发touchesBegan值?

我有一个父视图控制器,并且有一个子视图(UIView)。

子视图(名为 xibSubView)称为其他自定义类(xib)文件。

当我单击父视图控制器时,子视图(UIView)将移动到触摸父视图控制器上的开始位置。

父视图控制器有

 // UIViewcontroller.h file
  .....    
 @property (weak, nonatomic) IBOutlet XibSubView *xibSubView;
 .....
Run Code Online (Sandbox Code Playgroud)

以下代码位于父视图控制器.m中

 -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
 {
    self.subViewConstraint.constant = touchLeftScreenPoint.x ;
    self.subViewConstraint.constant = touchLeftScreenPoint.y ;

 }

 -(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
 {
 }

 -(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
 {
 }
Run Code Online (Sandbox Code Playgroud)

xib(subview-xibSubView) 代码具有相同的委托方法。

 // The code is in the parent viewcontroller .m
 -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
 {
 }

 -(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
 {
 }

 -(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
 {
 }
Run Code Online (Sandbox Code Playgroud)

xibSubView 中有很多元素。 …

iphone objective-c uiview ios

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