iphone代码没有解雇

时间:2010-10-07 00:52:33

标签: iphone

我有一个即时使用并且无法获取代码的类

WeatherServer.m
----------------------

- (NSArray *)weatherItemsForMapRegion:(MKCoordinateRegion)region maximumCount:(NSInteger)maxCount
{
//code is not firing
}




myviewcontroller.h
-----------------------
@class WeatherServer;

@interface MapView : UIViewController <MKMapViewDelegate, UITextFieldDelegate, CLLocationManagerDelegate, ADBannerViewDelegate> {

WeatherServer *weatherServer;
}

@property(nonatomic, retain) IBOutlet WeatherServer *weatherServer;

@end




myviewcontroller.m
----------------------

#import "WeatherServer.h"
@implementation MapView

@synthesize weatherServer;

- (void)mapView:(MKMapView *)map regionDidChangeAnimated:(BOOL)animated
{
NSArray *weatherItems = [weatherServer weatherItemsForMapRegion:mapView.region maximumCount:300];
    [mapView addAnnotations:weatherItems];
}

@end

regionDidChangeAnimated会激活,但是weatherItemsForMapRegion中的代码永远不会被触发。

1 个答案:

答案 0 :(得分:0)

我弄明白发生了什么。

我一直在通过界面构建​​器初始化类,但只针对iphone .xib而不是我的ipad .xib。