小编use*_*535的帖子

如何回到Objective-C中的上一个视图?

我是iOS编程的初学者,我想实现回到主视图的功能.

我使用这段代码:

-(IBAction)onclickhome:(id)sender
{

    [self.navigationController popViewControllerAnimated:YES];
}
Run Code Online (Sandbox Code Playgroud)

我在主页按钮单击事件中使用了navigationController,但它没有跳转到主屏幕.

您有任何适用于我的代码的建议和源代码吗?

objective-c uinavigationcontroller ios

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

如何解决[__NSCFString _isResizable]的运行时错误:无法识别的选择器发送到实例?

我是iphone的初学者,在我的代码中由于未捕获的异常'NSInvalidArgumentException'而导致终止应用程序的运行时错误,原因:' - [__ NSCFString _isResizable]:无法识别的选择器发送到实例0x6e6e300'

我的代码是

- (void)viewDidLoad
{
    [super viewDidLoad];
     NSString *path=[[NSBundle mainBundle] pathForResource:@"Animalfile" ofType:@"plist"];
    NSDictionary *dict=[NSDictionary dictionaryWithContentsOfFile:path];
    NSArray *animal=[dict valueForKey:@"image"];
    NSLog(@"print:%@",dict);
    NSLog(@"hello:%@",animal);

    UIImage *img=[animal objectAtIndex:currentImage];
        [animalphoto setImage:img];

}
Run Code Online (Sandbox Code Playgroud)

提供适用于我的代码的任何建议和源代码....

objective-c

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

标签 统计

objective-c ×2

ios ×1

uinavigationcontroller ×1