2010-05-07 5 views
7

विफलता देता है मैंने अपने उदाहरण में पहुंचने योग्यता का पता लगाने के लिए सेब द्वारा प्रकाशित पहुंच-योग्यता प्रोजेक्ट का उपयोग करने का प्रयास किया है। मैं सबसे प्रारंभ की नकल की है, लेकिन मैं लिंकर में इस विफलता मिलती है:सेब से पहुंच-परीक्षण की प्रतिलिपि बनाई गई है, लेकिन लिंकर

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 

अपरिभाषित प्रतीक:
"_SCNetworkReachabilitySetCallback", से संदर्भित: - Reachability.o
में [गम्यता startNotifer] " _SCNetworkReachabilityScheduleWithRunLoop ",_SCNetworkReachabilityCreateWithAddress" Reachability.o
में: + [गम्यता reachabilityWithAddress] , से संदर्भित " 10 से संदर्भित: - Reachability.o में [गम्यता startNotifer]
"_SCNetworkReachabilityGetFlags", से संदर्भित: - [गम्यता connectionRequired] Reachability.o में - [गम्यता currentReachabilityStatus] में Reachability.o
"_SCNetworkReachabilityUnscheduleFromRunLoop" , से संदर्भित: - [गम्यता stopNotifer] Reachability.o
"_SCNetworkReachabilityCreateWithName" में, से संदर्भित: + [गम्यता reachabilityWithHostName:] में Reachability.o
ld: प्रतीक (रों) नहीं मिला
collect2: ld 1 से बाहर निकलें स्थिति

लौटे

मेरी delegate.h:

#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:

#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 

उत्तर

18

यह भूल जाओ। मुझे अभी नहीं पता था कि मुझे मैन्युअल रूप से सिस्टम कॉन्फ़िगरेशन-फ्रेमवर्क जोड़ना है। मैंने सोचा कि इसे आयात किए जाने पर जोड़ा जाएगा।

+1

आप ढांचे को आयात नहीं करते हैं; आप हेडर आयात करते हैं। एक स्रोत फ़ाइल में हेडर आयात करना प्रोजेक्ट या लक्ष्य के लिए एक ढांचा नहीं जोड़ता है, जैसा आपने देखा है। –

+5

हां, SystemConfiguration.framework जोड़ना समस्या हल करेगा। – tszming

संबंधित मुद्दे