我是iOS编程的初学者,我想实现回到主视图的功能.
我使用这段代码:
-(IBAction)onclickhome:(id)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
Run Code Online (Sandbox Code Playgroud)
我在主页按钮单击事件中使用了navigationController,但它没有跳转到主屏幕.
您有任何适用于我的代码的建议和源代码吗?
我是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)
提供适用于我的代码的任何建议和源代码....