小编Abo*_*tef的帖子

git pull后无法打开xib文件,元素名称无效

我正在与另一位开发人员合作开发项目.我们正在研究bitbucket.

问题是他对XIB文件进行了更改.之后,当我这样做时git pull,我会收到更改但是在XIB文件上出错.当我试图打开它时,显示警告消息说无法打开

Line 81 startTag: invalid element name.

截图添加

谢谢 :)

git bitbucket xib ios xcode5

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

SDWebImage始终加载占位符图像而不是URL中的图像

嗯在这里使用SDWeb图像

这些我的代码:

        UIImageView *sellerImage = [[UIImageView alloc]init];            
[sellerImage setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:productPicture]]
                        placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
Run Code Online (Sandbox Code Playgroud)

但是它总是加载占位符图像而不是URL中的图像,我试图使用块来确定它是否加载图像并且它进入成功块,这意味着SDWebImage可以从URL加载图像但是它不会更改占位符图像.

这些是代码当我尝试使用块时:

            [sellerImage setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:productPicture]]
                placeholderImage:[UIImage imageNamed:@"placeholder.png"]
                         success:^(UIImage *image, BOOL cached) 
        {
            NSLog(@"success Block");
        }
                         failure:^(NSError *error) 
        {
            NSLog(@"failure Block");
        }];
Run Code Online (Sandbox Code Playgroud)

正如我所说,它总是在成功阻止,这意味着它可以从URL加载图像,但它不会改变占位符图像.

这些是我的问题的屏幕.

在此输入图像描述

iphone objective-c uiimageview ios sdwebimage

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

UITabBarItem图像为蓝色且未更改

嗯使用我自己的TabBarController,ElWafyatTabBarController基本上它继承UITabBarController.

ElWafyatTabBarController.m -> viewDidLoad

我已经创建了一些ViewControllers,然后我UINavigationController用rootViewController 创建了viewControllers我之前做过的步骤.

然后我创建UITabBarItem并设置了每个导航控制器的图像和标题,这rootViewController对于我在第一步中创建的viewControllers,并将tabBarItem这些设置为navigationController这些tabBarItem.

我发现的问题甚至UITabBarItem是正确显示的标题,但图像显示为蓝色.

仅供参考:我创建了两个名为test.png和test@2x.png的图片,尺寸为32x32和64x64,我仍有这些问题,所以任何人都可以提供帮助吗?

这是我的代码:

ElWafyatTabBarController - > viewDidLoad

- (void)viewDidLoad
{
    [super viewDidLoad];
    HomeViewController *homeViewController = [[HomeViewController alloc]
        initWithNibName:@"HomeViewController" bundle:nil];
    NaaiViewController *naaiViewController = [[NaaiViewController alloc]
        initWithNibName:@"NaaiViewController" bundle:nil];
    MushatraViewController *mushatraViewController = [[MushatraViewController alloc]
        initWithNibName:@"MushatraViewController" bundle:nil];
    TakremViewController *takremViewController = [[TakremViewController alloc]
        initWithNibName:@"TakremViewController" bundle:nil]
    UINavigationController *homeNavC = [[UINavigationController alloc]initWithRootViewController:homeViewController];
    UINavigationController *naaiNavC = …
Run Code Online (Sandbox Code Playgroud)

xcode objective-c uitabbaritem uitabbar ios

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

UILocalNotification设置repeatCalendar

我是新来的NSCalander,NSdatesNSDateComponents

基本上我有一个本地通知,我想根据用户的选择重复开火日期,让我们说只在周日和周一.

我们应该使用repeatCalendar属性UILocalNotification但我无法达到如何设置它.

那么任何人都能用简单的代码行帮助我吗?

谢谢

nsdate nscalendar ios uilocalnotification nsdatecomponent

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

从终端以 Rosetta 模式运行 xcode 项目?

我有 M1 机器,我有一个项目,我只需要 Rosetta 来运行它,而不是从 Xcode 获取信息菜单打开/关闭它在此输入图像描述

我尝试运行命令: arch -x86_64 open ~<PROJECTNAME>.xcodeproj

但项目每次都构建失败。

有人可以帮助我使用命令在 Rosetta 模式下从命令行构建项目吗?

terminal xcode command-line-tool rosetta

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