ahe*_*ang -1 cocoa-touch objective-c ios
可能重复:
未调用委托
我在appdelegate类中声明了一个委托,所以它看起来像:
@protocol LoginDelegate
- (void) loadData:(NSObject *)viewCon;
@end
@class RootViewController;
@class DetailViewController;
@interface TestAppDelegate : NSObject <UIApplicationDelegate, LoginViewControllerDelegate, RKObjectLoaderDelegate> {
id <LoginDelegate> delegate;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UISplitViewController *splitViewController;
@property (nonatomic, retain) IBOutlet RootViewController *rootViewController;
@property (nonatomic, retain) IBOutlet DetailViewController *detailViewController;
@property (nonatomic, assign) id <LoginDelegate> delegate;
@end
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//some code
[self.delegate loadData:self];
//some code
return YES;
}
Run Code Online (Sandbox Code Playgroud)
在我的其他课程中,我实现了这个委托:
- (void) loadData:(NSObject*)viewCon
{
NSLog(@"LOADING DATA");
[[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"/groups.json" delegate: self];
}
Run Code Online (Sandbox Code Playgroud)
但是,为什么不被召唤?
| 归档时间: |
|
| 查看次数: |
778 次 |
| 最近记录: |