2010-05-07 22 views
7

tôi đã cố gắng sử dụng dự án khả năng hiển thị do táo phát hành để phát hiện khả năng hiển thị trong ví dụ của riêng mình. i sao chép khởi nhất, nhưng tôi nhận được thất bại này trong mối liên kết:đã sao chép kiểm tra khả năng hiển thị từ quả táo, nhưng trình liên kết đưa ra lỗi

Ld build/switchViews.build/Debug-iphoneos/test.build/Objects-normal/armv6/test normal armv6 
cd /Users/uid04100/Documents/TEST 
setenv IPHONEOS_DEPLOYMENT_TARGET 3.1.3 
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk -L/Users/uid04100/Documents/TEST/build/Debug-iphoneos -F/Users/uid04100/Documents/TEST/build/Debug-iphoneos -filelist /Users/uid04100/Documents/TEST/build/switchViews.build/Debug-iphoneos/test.build/Objects-normal/armv6/test.LinkFileList -dead_strip -miphoneos-version-min=3.1.3 -framework Foundation -framework UIKit -framework CoreGraphics -o /Users/uid04100/Documents/TEST/build/switchViews.build/Debug-iphoneos/test.build/Objects-normal/armv6/test 

ký Undefined:
"_SCNetworkReachabilitySetCallback", tham chiếu từ: - [reachability startNotifer] trong Reachability.o
" _SCNetworkReachabilityCreateWithAddress", tham chiếu từ: + [reachability reachabilityWithAddress:] trong Reachability.o
"_SCNetworkReachabilityScheduleWithRunLoop", tham chiếu từ: - [reachability startNotifer] trong Reachability.o
"_SCNetworkReachabilityGetFlags", tham chiếu từ: - [reachability connectionRequired] trong Reachability.o - [reachability currentReachabilityStatus] trong Reachability.o
"_SCNetworkReachabilityUnscheduleFromRunLoop" , tham chiếu từ: - [reachability stopNotifer] trong Reachability.o
"_SCNetworkReachabilityCreateWithName", tham chiếu từ: + [reachability reachabilityWithHostName:] trong Reachability.o
ld: biểu tượng (s) không tìm thấy
collect2: ld trở về tình trạng 1 lối

delegate.h tôi:

#import <UIKit/UIKit.h> 

@class Reachability; 

@interface testAppDelegate : NSObject 
<UIApplicationDelegate> { UIWindow 
*window; UINavigationController *navigationController; 

Reachability* hostReach; 
Reachability* internetReach; 
Reachability* wifiReach; 

} 

@property (nonatomic, retain) IBOutlet 
UIWindow *window; @property 
(nonatomic, retain) IBOutlet 
UINavigationController 
*navigationController; 

@end 

delegate.m tôi:

#import "testAppDelegate.h" 

#import "SecondViewController.h" 
#import "Reachability.h" 

@implementation testAppDelegate 



@synthesize window; @synthesize 
navigationController; 

- (void) updateInterfaceWithReachability: 
(Reachability*) curReach { 
    if(curReach == hostReach) { 
     BOOL connectionRequired= [curReach connectionRequired]; 


     if(connectionRequired) 
     { //in these brackets schould be some code with sense, if i´m getting it to run 
     } 
     else 
     { 
     } 

    } if(curReach == internetReach) { } if(curReach == wifiReach) { 
} } 

//Called by Reachability whenever 
status changes. 
- (void) reachabilityChanged: (NSNotification*)note { 
Reachability* curReach = [note 
object]; NSParameterAssert([curReach 
isKindOfClass: [Reachability class]]); 
[self 
updateInterfaceWithReachability: 
curReach]; } 


- (void)applicationDidFinishLaunching:(UIApplication 
*)application {  
    // Override point for customization after application launch 
    // Observe the 
kNetworkReachabilityChangedNotification. 
When that notification is posted, the 
    // method "reachabilityChanged" will be called. // 
[[NSNotificationCenter defaultCenter] 
addObserver: self selector: 
@selector(reachabilityChanged:) name: 
kReachabilityChangedNotification 
object: nil]; 

    //Change the host name here to change the server your monitoring 
hostReach = [[Reachability 
reachabilityWithHostName: 
@"www.apple.com"] retain]; [hostReach 
startNotifer]; [self 
updateInterfaceWithReachability: 
hostReach]; 

    internetReach = [[Reachability reachabilityForInternetConnection] 
retain]; [internetReach 
startNotifer]; [self 
updateInterfaceWithReachability: 
internetReach]; 

    wifiReach = [[Reachability reachabilityForLocalWiFi] retain]; 
[wifiReach startNotifer]; [self 
updateInterfaceWithReachability:wifiReach]; 
    [window addSubview:[navigationController 
view]]; 
    [window makeKeyAndVisible]; } 


- (void)dealloc { [navigationController release]; 
    [window release]; 
    [super dealloc]; } 


@end 

Trả lời

18

quên nó. Tôi chỉ không biết rằng tôi phải thêm khung định cấu hình hệ thống theo cách thủ công. Tôi nghĩ rằng nó sẽ được thêm vào khi nó được nhập khẩu.

+1

Bạn không nhập khung; bạn nhập tiêu đề. Việc nhập một tiêu đề vào một tệp nguồn không thêm một khung công tác cho dự án hoặc cho đích, như bạn đã thấy. –

+5

Có, thêm SystemConfiguration.framework sẽ giải quyết vấn đề. – tszming

Các vấn đề liên quan