这是我的{% extends 'base.html' %}
{% load sekizai_tags %}
{% block 'content' %}
<p>that's some sweet content ya got there lad</p>
{% addtoblock "extra" %}wow{% endaddtoblock %}
{% endblock %}
:
AppDelegate.h
这是我的@interface AppDelegate : UIResponder <UIApplicationDelegate> {
ProductHandlerModel *handler;
}
@property (strong, nonatomic) UIWindow *window;
-(ProductHandlerModel*)getHandler;
@end
:
AppDelegate.m
如何从另一个- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
handler = [[ProductHandlerModel alloc]init];
return YES;
}
- (ProductHandlerModel*)getHandler {
return handler;
}
类访问此处理程序对象?
答案 0 :(得分:3)
像
一样打电话AppDelegate *delegate = (AppDelegate *) [[UIApplication sharedApplication] delegate];
[delegate getHandler];
或简单地称为
[(AppDelegate *)[[UIApplication sharedApplication] delegate] getHandler];
别忘了导入。
#import "AppDelegate.h"