Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iphone代码未启动_Iphone - Fatal编程技术网

iphone代码未启动

iphone代码未启动,iphone,Iphone,我有一个我正在使用的类,无法启动代码 WeatherServer.m ---------------------- - (NSArray *)weatherItemsForMapRegion:(MKCoordinateRegion)region maximumCount:(NSInteger)maxCount { //code is not firing } myviewcontroller.h ----------------------- @class WeatherServer;

我有一个我正在使用的类,无法启动代码

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

RegionDidChangeAnimatedFires正常,但是weatherItemsForMapRegion中的代码永远不会被触发。

我知道发生了什么


我一直在通过interface builder初始化该类,但只对iphone.xib而不是我的ipad.xib进行了初始化。

你能确认weatherServer对象是否正确初始化吗?据我所知。我应该做什么来测试这个?